can we think of the first step towards the hardware management?

106 views
Skip to first unread message

Alex Liberzon

unread,
Sep 25, 2021, 4:59:05 AM9/25/21
to openpiv-users
A new member asked if OpenPIV can control the laser and the camera. This brings me to the question if anyone of you has some ideas about the way to implement it in Python? Maybe something like Arduino or Rasberry Pi? Obviously we could think only of some simple and standard communication protocols available out there. If there is some interest into this direction - we could start thinking of organizing a dedicated team. 


Thanks for the ideas,
Alex

Ivan Nepomnyashchikh

unread,
Sep 25, 2021, 5:36:52 PM9/25/21
to openpiv-users
It was me who asked that, thank you Dr. Liberzon. So as I understand, I can't get the images themselves with the help of OpenPIV. I asked the same question on RG and a user there responded that PIVlab can control a laser and a camera. Even though PIVlab isn't an option for me, I did have a look at their educational video. So far, they have support for LaVision lasers only and for a camera that I haven't seen before. Still they want to expand. I'm sorry I can't help you with implementing the feature in OpenPIV since I'm not a computer major and I'm way too busy with my Ph.D. currently. May be later I'll be able to dedicate some time for that. The one thing I'd like to express my wish about is that it would be great if the feature could be implemented for Linux first.
Ivan

Ivan Nepomnyashchikh

unread,
Sep 26, 2021, 7:39:01 PM9/26/21
to openpiv-users
It seems that not that many people is interested in the idea. So, I'm researching it myself. Very gradually though ... I saw papers that make use of iPhone cameras in PIV. I also know from Apple presentations that Apple gives programmers access to the iPhone cameras so that they could write different apps. Therefore, I have formulated the first milestone for myself: to write a code that can do basic manipulations with my iPhone camera and integrate it into a forked OpenPIV branch.
Disclaimer: even though I use programming in my work, I don't like computers and programming. It's a pain for me learn all these things. So, if there is a better person out there who is interested in the matter, please pick it up. Or at least, very briefly educate me on how to write software for hardware so that I could approach the problem from the right angle.

Alex Liberzon

unread,
Sep 27, 2021, 12:42:27 AM9/27/21
to Ivan Nepomnyashchikh, openpiv-users
Using smartphones is one possibility - which might have some good things, but will not give the PIV capabilities one might need from OpenPIV. 

Don’t need to program OpenPIV - there are couple of existing smartphone packages that already do some PIV. One is called SmartPIV and there is a paper about it in Exp Fluids and another is under active development on Github, I think it is called ml-app or something like that. 

In the past, Beat Luethi company also programmed some sort of OpenPIV into their river water discharge app, don’t remember it’s name. 

Probably there are more. 

Regards
Alex



--
You received this message because you are subscribed to the Google Groups "openpiv-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiv-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiv-users/f41117e0-7c92-44d7-98a2-e0ef02e16aa5n%40googlegroups.com.

Ivan Nepomnyashchikh

unread,
Sep 27, 2021, 11:18:40 AM9/27/21
to openpiv-users
I see, that clarifies the things and saves me time, thank you. I'll be changing the direction of my thinking then.
One thing I've been struggling with is your suggestion to use either Arduino or Raspberry Pi. I read about these things and I can't understand how they can be applied to our situation. Are they going to play a role of some signal processors? I.e., a laser and a camera send signals to a Raspberry PI --> Raspberry Pi does something with the signal --> Raspberry Pi sends the signal to a computer?
If you could clarify your vision a very little bit so that I could understand where to look at, I'd appreciate that.
Thank you in advance.
Ivan

Alex Liberzon

unread,
Sep 27, 2021, 12:39:09 PM9/27/21
to Ivan Nepomnyashchikh, openpiv-users
First you have to describe your experiment and your needs. Things might be simpler than I imagine 

From: openpi...@googlegroups.com <openpi...@googlegroups.com> on behalf of Ivan Nepomnyashchikh <nepo...@oregonstate.edu>
Sent: Monday, September 27, 2021 6:18:40 PM
To: openpiv-users <openpi...@googlegroups.com>
Subject: Re: [openpiv-users] Re: can we think of the first step towards the hardware management?
 

Ivan Nepomnyashchikh

unread,
Sep 27, 2021, 1:42:21 PM9/27/21
to openpiv-users
I'm getting ready to do a transient two-phase flow PIV with one camera and one laser. The laser allows for time-resolved PIV. The camera gives us 1000 f/s. That's the ultimate goal. The starting goal is to do steady two-phase flow not time resolved PIV with one laser and one camera to see what we can get and amend our ultimate goal if necessary. Since I have no experience in PIV, I'm not sure what additional details I should give. But I'm happy to give whatever are the necessary ones.

The reason I raised my question is because I didn't understand the purpose of OpenPIV. OpenPIV can only process the images. I still have to purchase software that operates the laser and the camera in order to get the images themselves. On the other hand, Dantec or LaVision do both: operate the laser-camera system and process the images. So, I have to purchase Dantec or LaVision in anyway in order to be able to operate the laser-camera system. But if I purchase Dantec or LaVision they automatically have an option to process the images. In this case, why do I need OpenPIV then? I just can't get my head around this contradiction. I asked this question and I haven't received an answer from anybody thus far. From this perspective, it makes total sense to me why PIVlab introduced laser-camera control option. But PIVlab is MATLAB only and I don't use MATLAB.

Anyways, we have a laser and a camera in the lab. Both are pronounced obsolete by their respective manufacturers. Our version of software that operates them is valid for Win XP and Win 7. Neither of them is supported by our IT department. So, I decided it would be a good idea if we had an open source Linux based software that can both operate our old laser and camera and process the images. That's another reason I'm looking in that.
Ivan

Alex Liberzon

unread,
Sep 28, 2021, 1:04:26 AM9/28/21
to Ivan Nepomnyashchikh, openpiv-users
Thanks for the info. 
OpenPIV is the open source PIV analysis and it is designed to be open, simple, educational, innovative and yours. With the commercial vendors you never know what is inside. We do not have capacity to replace them. But we know from experience that sometimes the results one get from some commercial software does not make sense. Plus people want to understand the basics and invent new algorithms, open source allows this innovation. 
Many developers and users also bring images from different areas: microscopy, geotechnical, photogrammetry, radar, just a few to mention. They need the PIV sort of analysis but no lasers or synchronization. We are happy to help them as well. Plus all the learning activity with the smartphones, drones, digital cameras with flashes, etc - we help students and researchers without fluid mechanics records get their analysis done. 

So, yep, OpenPIV does not compete with these vendors, yet if somebody has ideas on how to incorporate also the hardware control, we would gladly learn together on building a more complete project. 



Sent: Monday, September 27, 2021 8:42:21 PM

Rodrigo J. Gonçalves

unread,
Sep 28, 2021, 10:33:11 AM9/28/21
to Alex Liberzon, Ivan Nepomnyashchikh, openpiv-users
May I add, sometimes you can do PIV with no laser at all. For example, in microscopy or when using macro (i.e. close-up) lenses, you only "see" a thin layer which is in focus (i.e. a 'shallow' depth of field), so you don't need a laser to illuminate particles. You can do PIV with the particles "you see" in focus, and you can be sure that it is a very thin layer which is representative of the fluid at that (focal) plane.
So, openPIV is perfectly suitable for many cases even if it does not control a laser. I wish I knew it when I used LaVision software (which crashed all the time by the way, and I had to go back and forth with the support guy). Not only was I chasing mosquitoes with a cannonball, but the gun did not work well and I could do nothing because nobody knows the internal functioning.

So openPIV is perfectly suitable for many, many cases. And yes, it does not always replace other software, but in many cases it makes much more sense to use it.

Best,
Rodrigo



--

Rodrigo J. Gonçalves

Plankton Science

Google Scholar // Researchgate // ORCiD


CESIMAR CONICET

Puerto Madryn - Argentina

Ivan Nepomnyashchikh

unread,
May 6, 2023, 6:06:58 PM5/6/23
to openpiv-users
Hello dear OpenPIV users.

First, I remember that Dr. Liberzon asked to use GitHub discussions for feature suggestions. But since we've already had this thread and this particular feature is not strictly about OpenPIV itself, I decided to post my thoughts here.

In the past year and a half, I've been working on this problem. I learnt Arduino, tinkered with different PIV systems, assembled general DAQs with LabView and Arduino and feel more or less confident that I have a general understanding of electronics control systems.

Thus, I think I'm poised to start working on an open-source PIV control system. I'm fine to work on it on my own (especially, because I'm working very slowly due to the lack of free time). But if there have appeared people wanting to work on it together, I'll happy to join the efforts.

Before I (or we) start doing something, I want to develop a strategy. I.e., I want to set a big goal and break it onto baby steps. And that's what I want to discuss in this post.

Let me start by acknowledging, that having gained more PIV experience, I've come to realization that what I want to do (an open-source PIV system) may not seem that necessary and it is not obvious how to do it.

Having acknowledge that, let me say that I don't care and still want to proceed with the idea.

There is a myriad of OpenPIV applications as Rodrigo mentioned. We can't consider the entire myriad. We have to focus on something. I suggest focusing on classical 2D PIV systems.

I don't think making toys is a good idea. In other words, laser pointers + smartphone cameras + algae as seeding particles should be out of consideration. I think we need the real thing.

If we go with the real thing, what are the options?

The first option is the best one: to do what William Thielicke did. He is designing and manufacturing PIV hardware. Even though that's the ideal option, we - as a community - don't have capabilities for that. In other words, that's impossible to do from the open-source stand point. There have to be a commercial company for that.

The second option - which I think we should pursue - is the following. We leave it up to the users to separately purchase commercial "PIV-graded" cameras, lasers and synchronizers. We write software that can control any combination of cameras, lasers and synchronizers. Arduino will play the role of controlling piece of equipment. If Arduino will not work, we'll design an open-source circuit board and will explain how to assemble it.

Here are the problems with this approach. Lasers can be controlled "easily". But cameras and synchronizers require commercial drivers. Moreover, synchronizers are not that easy to find.

I'm not yet sure how to solve this problem. I thought of the Linux approach, where commercial hardware manufacturers write drivers for Linux. We could approach camera and synchronizer manufacturers with the idea to do the same thing for us.

We could make our own open-source synchronizer, but I don't think we can achieve commercial performance. And we can't make a camera.

Let me point out why I think having open-source PIV control system is a good idea. PIV systems are ridiculously expensive. A governmental lab or a commercial company can afford them. But a university lab ...  where each grant comes with such great pain, where the university takes 50% of the grant, where Ph.D. students (like myself) can't work quickly (due to the lack of skills) and can't help generate new grants quickly ... it is very difficult for a university lab to afford a PIV system.

Creating an open-source PIV control system, we reduce the costs for a university lab by as much as $14000! $14000 is how much a new license for a base Dantec package costs. The base package includes 2D PIV analysis + PIV control system. Their annular license updates are also very expensive ($3000 as far as I remember).

I'm wondering what the community thinks about all that.

Thanks.
Ivan

Alex Liberzon

unread,
May 7, 2023, 3:53:04 PM5/7/23
to Ivan Nepomnyashchikh, openpiv-users
Hi Ivan,

I support the idea of brainstorming the future open hardware and software PIV system development. I do not know if there's a sufficient market for such systems, but if PIVLab can sell a couple, probably this community can also make some. I'd personally prefer developing an utterly open solution, i.e. using only open hardware and protocols. Regarding the performance and quality - I think it will be difficult to ensure a volunteer work high-quality product; at some point, we need a sustainable business model, e.g. vendor donations or selling the support or something like that.

Let's start with collecting the papers about low-cost and open-source PIV systems and create a table of available solutions - what open-hardware solutions exist and what it takes to use them. For instance, http://opensourcepiv.weebly.com/parts-and-how-to-build.html

Other possibly relevant sources


You received this message because you are subscribed to a topic in the Google Groups "openpiv-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpiv-users/xi7qt28IGEE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpiv-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiv-users/53939644-d45c-4f42-a9bd-2df334f30568n%40googlegroups.com.

Alex Liberzon

unread,
May 7, 2023, 3:55:23 PM5/7/23
to Ivan Nepomnyashchikh, openpiv-users

Brian Mapes

unread,
May 7, 2023, 4:03:20 PM5/7/23
to openpiv-users
Does anyone have opinions on optical flow (for instance Deepflow from OpenCV) to estimate velocity fields, and how it may compare to PIV? 

I like the straightforward math and bare fast numpy of openPIV, but much more development time has probably been devoted to optical flow. 
I will need to commit and invest for a project in a few months. 

My first success for the proposal was with openPIV, but some people recommend optical flow. 


Well, these days, one can simply ask chatGPT: 

what are the advantages and disadvantages of PIV versus optical flow for estimating velocity fields from image sequences?
ChatGPT

Both Particle Image Velocimetry (PIV) and optical flow are widely used methods for estimating velocity fields from image sequences in fluid dynamics research. Here are some advantages and disadvantages of both techniques:

Advantages of PIV:

  1. High accuracy: PIV is known for its high accuracy in estimating velocity fields, especially in cases where the flow is highly structured or contains vortices.
  2. Robustness: PIV can handle high noise levels in the images and is relatively robust to illumination variations.
  3. Spatial resolution: PIV can provide high spatial resolution by using small interrogation areas.

Disadvantages of PIV:

  1. Limited temporal resolution: PIV requires two images taken at different times to estimate the velocity field. Therefore, it is not suitable for capturing highly dynamic or transient events.
  2. Limited field of view: PIV requires a high density of tracer particles or other markers in the flow, which limits the field of view that can be analyzed.
  3. Data processing: PIV requires significant computational resources and time to process the data and obtain the velocity field.

Advantages of optical flow:

  1. High temporal resolution: Optical flow can estimate velocity fields from a single image sequence, making it suitable for capturing highly dynamic or transient events.
  2. Large field of view: Optical flow can estimate velocity fields over a larger field of view than PIV, making it suitable for studying flows in larger systems.
  3. Ease of implementation: Optical flow algorithms are relatively simple to implement and require fewer computational resources than PIV.

Disadvantages of optical flow:

  1. Low accuracy: Optical flow is sensitive to noise and illumination variations, which can lead to errors in the estimated velocity field.
  2. Limited spatial resolution: Optical flow algorithms often use large averaging areas, which can result in lower spatial resolution than PIV.
  3. Dependence on image features: Optical flow algorithms rely on tracking image features, which can be challenging in regions of low contrast or with complex flow patterns.

In summary, both PIV and optical flow have their own strengths and weaknesses, and the choice of technique depends on the specific requirements of the flow analysis. PIV is more suitable for studying structured flows with high accuracy, while optical flow is more suitable for studying highly dynamic flows with a large field of view.




Brian Mapes

Alex Liberzon

unread,
May 7, 2023, 5:03:03 PM5/7/23
to Brian Mapes, openpiv-users
I have some experience with optical flow methods for PIV; there was a lot of work in 90s https://hal.science/hal-00953823/document and later for echocardiography. For "standard" PIV settings, the displacement of particles is too large for optical flow. The "best" optical flow for PIV (!) code I know today is according to this publication https://www.researchgate.net/publication/320531639_OpenOpticalFlow_An_Open_Source_Program_for_Extraction_of_Velocity_Fields_from_Flow_Visualization_Images and there's a code in Matlab on GitHub

I thought to translate it into Python but didn't have time for it. Maybe chatgpt will do it for us :) But the pros/cons that are written above are not really true ;)

Regards
Alex


--
You received this message because you are subscribed to the Google Groups "openpiv-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiv-user...@googlegroups.com.

Alex Liberzon

unread,
May 7, 2023, 5:12:59 PM5/7/23
to Brian Mapes, openpiv-users
A newer paper by the same author tries to bring the best of both worlds. This would definitely be worthy it for OpenPIV to have a python version of this idea.


Hybrid_optical_flow_PIV_326-4748-1-PB.pdf

Ivan Nepomnyashchikh

unread,
May 7, 2023, 5:59:52 PM5/7/23
to openpiv-users
These are the articles about custom made PIV systems that I found (attached). We need a generalized storage for the articles or the links. I'm thinking what should better be used.

Ring et al. - 2013 - Development of a Low Cost Particle Image Velocimet.pdf

Ivan Nepomnyashchikh

unread,
May 7, 2023, 6:01:39 PM5/7/23
to openpiv-users
Another article which I can't seem to attach to this post is Hong and Altman - 2008 - Lift from Spanwise Flow in Simple Flapping Wings. There they use wave generators instead of a synchronizer. That seemed a clever idea to me.

Ivan Nepomnyashchikh

unread,
May 7, 2023, 6:14:51 PM5/7/23
to openpiv-users
Dr. Liberzon, even though I support making open-source PIV hardware, that's going to be an enormous endeavor.

Though, I'm on board with you on that.

You mentioned starting with the "lit review". We can do that. But also let me bring up the main issue (which you have partially already brought up): money.

I don't have money. I could barely afford my own Arduino kit. And we need to buy equipment to start tinkering with the project.

If we find sponsors, we have to commit to hard work on the project. I can't commit to that. I'm doing Ph.D.. That's my main work. I can only afford several hours per week working on side projects.

I think we could start with student electronics clubs. What do you think about that? We have Tekbots club at OSU: https://eecs.engineering.oregonstate.edu/education/tekbotSuite/tekbot/

Tekbots exist at several universities around the world: https://en.wikipedia.org/wiki/TekBots

They are sponsored by Tektronix in particular (https://www.tek.com/en). May be Tektronix will agree to allocate some funds to buy equipment for the project. And may be they will be willing to help starting Tekbots at TAU.

What do you think Dr. Liberzon? Should I talk to our Tekbots folks?

Ivan

Erich's Lab

unread,
May 7, 2023, 10:10:55 PM5/7/23
to openpiv-users

Hi all,

I would like to add some information about open source PIV hardware. For one, hardware synchronization is often difficult to manage accurately and precisely without the use of dedicated hardware. However, the Arduino Due (have not bought one yet, so not tested) may be quite suitable due to a 16 bit timer. Theoretically, jitter can be minimized when using the Due compared to other budget micro controllers when sending 3.3V TTL pulses and may even be in the nanosecond range if one access the timer directly. If we do use the Arduino Due or similar for hardware synchronization, using serial input/output with '\n' delimiter would be the way to go (at least in my opinion). We can create a repository which controls the Arduino micro controller and we may even provide Thingiverse files for 3D printing a professional looking synchronizer case for the Arduino.

To validate the use of an Arduino micro controller among others as a hardware synchronizer, I decided to put money aside to invest in an oscilloscope to analyze the 3.3V TTL pulses. Hopefully, we can analyze hardware synchronizers to find one that is capable of hopefully accurate and precise timing of lasers/LEDs, cameras, and other wonderful technologies.

On hardware, pulsed laser diodes may be expensive and dangerous. To lower costs, overdriven LEDs may be the way to go with published pulse energies around 14 millijoules (if I remember correctly). The LED light is collimated with a spherical lens and fed into fiber optics with a light sheet attachment on the end. This allows one to easily reposition the light sheet if needed as the pulsed light generator is not directly connected to the light sheet optics (like a laser module with light sheet optics directly mounted on it). LEDs and particle shadow velocimetry is another possible route especially with volumetric PIV. I think quite a few pulsed LEDs accept TTL pulses for an external trigger, so they should be able to work with an Arduino micro controller.

Additionally, dedicated PIV cameras are often out of range for most researchers, especially undergraduates like me. If an open source synchronizer is to be used to precisely control equipment, the camera must accept a TTL external trigger. Many global shutter cameras with external triggers are available through FLIR and Mouser. However, they still come with a price of around $300-$1500 USD (e.g., still quite expensive, especially for 3D PIV with four cameras). I personally used a 1 MP monochrome camera from Arducam, but as some have stated, the exposure is not vertical and this could cause some biases from motion blur and timing issues. Additionally, many USB driverless cameras have delays in their external triggers among other things giving one an inter framing time of around 800 microseconds (I think William Thielicke said he got one USB driverless camera down to 500 microseconds interframe time). Again I think an oscilloscope may be able to help here. Note, I have no experience with commercial PIV hardware, so I cannot help much with commercial drivers.

Like many have said, time and money is not on our side. However, a working team of developers would help further this idea of hardware management.

Alex Liberzon

unread,
May 7, 2023, 11:24:21 PM5/7/23
to Ivan Nepomnyashchikh, openpiv-users
Thanks to everyone for contributing to the discussion. Before the next step, please read those articles, check the additional hardware options, put it all in an open google doc or overleaf tex file and lets meet to brainstorm. 

we need a leading concept - why do you do it and what is our main goal. then we can get a strategy on how to get there. As far as I see, it is not very related to the OpenPIV software, cause any PIV analysis' software can do the job. It is only that we are a community that can contribute and we like PIV :)

Do we want the system to be cheap, accurate, robust, then we need minimal requirements and start from there. The main thing is still to decide about thr main goal

Regards
Alex 

Sent: Monday, May 8, 2023 1:14:50 AM
To: openpiv-users <openpi...@googlegroups.com>
Subject: Re: [openpiv-users] optical flow vs. PIV, opinions (including GPT's answer)
 
--
You received this message because you are subscribed to the Google Groups "openpiv-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiv-user...@googlegroups.com.

Ivan Nepomnyashchikh

unread,
May 13, 2023, 4:30:53 PM5/13/23
to openpiv-users
I opened it to the public, so, theoretically, anybody with the link should be able to access it. Let me know if that's not the case.
I'm going to create a Word document there where I start writing lit review and another Word document with the list of the links.
We can add articles to that folder.
Note, that Drive is attached to my university account, it will go away once I graduate. I don't have personal Google account (I don't like Google). If anybody wants to create a shared folder attached to his personal Google account I will not mind.
Ivan

Alex Liberzon

unread,
May 13, 2023, 4:41:46 PM5/13/23
to Ivan Nepomnyashchikh, openpiv-users

this document should be editable by anyone and it's on my university account (if you need to ping - use my gmail account)

Reply all
Reply to author
Forward
0 new messages