Beginner Questions

412 views
Skip to first unread message

reh...@berkeley.edu

unread,
Jun 1, 2016, 7:00:52 PM6/1/16
to openptv
Hi I am a graduate student at UC-Berkeley just beginning to use OpenPTV. It has been downloaded and I have gone through the online manuals most especially the manual by Hristo Goumnerov, however, I still have some questions with regards to the explanations in the manual just because i'm new to the field. For example, what is mean in the man_ori.par as image 1 p2 , or in the orient.par as k1,k2, etc. I was wondering if anyone would be able to help me better understand the manual or point me in the direction of a book or manual to better understand this new terminology. I'm currently reading Experimental Fluid Mechanics by Tropea et al. to understand PTV, but i'm still having trouble fully understanding how to run the program. Any help would be greatly appreciated. 
Thank you, 
Rachael Hager

Alex Liberzon

unread,
Jun 2, 2016, 2:58:20 PM6/2/16
to openptv
I think reading the relevant chapter in Dracos book (see our documentation for the references) or a short review in the thesis of Jochen Willneff (it's not his work, but Maas from 1990's) 
would explain the camera model parameters (p1,... k1, ..) . Basically these are camera intrinsic parameters helping to work with real lenses and cameras rather than with a simple linear pinhole model. 

best
Alex

reh...@berkeley.edu

unread,
Jun 6, 2016, 8:06:54 PM6/6/16
to openptv
Dear Dr. Liberzon 

First I wanted to say thank you so much for the quick reply (I am sorry mine has been a bit longer), and thank you for the recommended reading and the link to Dr. Willneff's Thesis this was very helpful.

I still have a few more questions with regards to the OpenPTV manual by Hristo Goumnerov and also Dr. Willneff's appendix in his thesis, if it would be possible to ask these. The questions are:

1. In the track.par file are dvxmin, dvxmax, dangle, and dacc  the limiting min velocity, max velocity, change in angle , and acceleration for a particle to be considered corresponding in the next time step.     
2. Are the four points selected for the man_ori.par the four most extreme points for image 1 (i.e. the corner points in the reference frame)?
3. I was also wondering what the xp and yp are measuring under the orient.par file?
4. In the criertia.par file is the illuminated layer data the lengths in x and z for the laser sheet created that's illuminating the particles it seemed this was true but I wanted to confirm. Also for the cirteria.par is the corr, related to the correlation coefficient to identify related particles, i saw the following in one of the forum questions, but was still a little confused
  • min corr for ratio (criteria for correspondences tab in main parameters window)

correlation between the size/shape of the particle in the following images, this parameter is used to allow selecting complex objects with some preference to their shape. usually not valid for "identically" looking particles

5. I also had trouble understanding the explanation for the sortgrid.par and was wondering if there was any further explanation on this, it seems to just be a flag to use the most updated version
6. Finally, I just wanted to confirm when it says "flag for frame" that this subtracts a mask so that it just detects the flow and not objects in the image

again thank you for your help, I'm very excited to begin using openptv. We currently have PIV and LDV set-up and are excited to compare the results!
Rachael Hager

reh...@berkeley.edu

unread,
Jun 6, 2016, 8:12:40 PM6/6/16
to openptv
Dear Dr. Liberzon 

I appologize I realized I had a mistake in one of my questions number 5 I was responding with pft_version in mind (meaning a flag for  the newest version), but it was in fact sortgrid.par as stated in the question, which I had trouble understand the explination for this input. 
Thank you
Rachael

Alex Liberzon

unread,
Jun 7, 2016, 3:46:02 PM6/7/16
to openptv
Dear Rachael (you can call me Alex)

You're definitely right - many things are not yet visible at the first sight and one has to dig out through numerous documents to find the answers. I'll try to help. If you'd be willing to organise the frequently asked questions to our documentation somehow, it would be of great help. 

I'll try to answer below: 



On Tuesday, June 7, 2016 at 3:06:54 AM UTC+3.wrote:
Dear Dr. Liberzon 

First I wanted to say thank you so much for the quick reply (I am sorry mine has been a bit longer), and thank you for the recommended reading and the link to Dr. Willneff's Thesis this was very helpful.

I still have a few more questions with regards to the OpenPTV manual by Hristo Goumnerov and also Dr. Willneff's appendix in his thesis, if it would be possible to ask these. The questions are:

1. In the track.par file are dvxmin, dvxmax, dangle, and dacc  the limiting min velocity, max velocity, change in angle , and acceleration for a particle to be considered corresponding in the next time step.     

 
2. Are the four points selected for the man_ori.par the four most extreme points for image 1 (i.e. the corner points in the reference frame)?
better if these are two corners of the calibration target and better if the calibration target fills the image - otherwise the uncalibrated regions won't work well 
 
3. I was also wondering what the xp and yp are measuring under the orient.par file?

the location of the "pin-hole", in the aligned sensor it would be 0,0, in reality these will take on part the shift of the sensor (or the lens). See image of the imaging model in Willneff's thesis, also copied here https://dl.dropboxusercontent.com/u/5266698/ptv_camera_model.png


 
4. In the criertia.par file is the illuminated layer data the lengths in x and z for the laser sheet created that's illuminating the particles it seemed this was true but I wanted to confirm. Also for the cirteria.par is the corr, related to the correlation coefficient to identify related particles, i saw the following in one of the forum questions, but was still a little confused
  • min corr for ratio (criteria for correspondences tab in main parameters window)

first we work with the volume and not so much with the laser "sheet". yes, these are object volume and correspondences parameters in criteria.par. The min_corr (there are 3, see page 5 in Willneff's manual) 
0.02 min corr for ratio nx 
0.02 min corr for ratio ny 
0.02 min corr for ratio npix

and they basically say how close should images of the same particle look in different images (in time I think, but maybe also in space). The low values for correlations mean that we know (empirically) that these parameters are not very helpful in the most general case, i.e. the particles shape is changing very rapidly and we cannot tell the software to prefer only the similarly looking particles. 


 

correlation between the size/shape of the particle in the following images, this parameter is used to allow selecting complex objects with some preference to their shape. usually not valid for "identically" looking particles

so this sentence above repeats it. 
 

5. I also had trouble understanding the explanation for the sortgrid.par and was wondering if there was any further explanation on this, it seems to just be a flag to use the most updated version

pft_version is some old parameter that we do not change - in the past Jochen has tried different versions of particle detection and I think that the default now is 3 and we use the peak-fitting procedure that does the most robust and fast job. 
 
6. Finally, I just wanted to confirm when it says "flag for frame" that this subtracts a mask so that it just detects the flow and not objects in the image

no, it's something also very prehistoric - in the past the cameras were interline - odd and even lines of the same images were sent by separate images. We had to tell the software (I feel very old now ;)) to know which frame is which or to use only even or only odd ones. Since the CMOS cameras are on the market, it's irrelevant. We're just slow to remove things from the software and we try to keep many things backward-compatible, so it stays. 
 

again thank you for your help, I'm very excited to begin using openptv. We currently have PIV and LDV set-up and are excited to compare the results!
Rachael Hager

I hope you don't try to compare 3D-PTV with the  PIV/LDV options - these tools are all built for different and specific experiments, each has its own pros and cons but they're not competitors. Just use the one which is best for your application. 

I've heard recently from one of Berkley professors about the revival of the Ocean and Marine Engineering which I understand you belong to. If you'd be willing to share with us your research and the application for 3D-PTV, maybe someone on the group could help with the tips/ideas. 

Best

reh...@berkeley.edu

unread,
Jun 8, 2016, 2:36:43 AM6/8/16
to openptv
Dear Alex, 

Thank you for the great advice, especially with regards to comparing the LDV, PIV, and PTV results. I have actually just switched from the ocean engineering group, which I was with for 4 years to the fluid mechanics group and have begun to study droplet droplet interaction in turbulent flows. We are using an Eaton box to create isotropic, homogeneous turbulence and creating droplet of approximately 15 microns in diameter. The LDV (is actually a result of PDA, which I'm using to separately determine the change in droplet size spectrum as they collide) and the PIV is being used to characterize the flow field and produce an energy spectrum. I have been interested in following the droplet trajectories, however, to better understand why they cluster and also how they collide. Any tips or ideas would be warmly received. 

With regards to organizing frequently asked question, I have actually already begun to compile a version of the manual (it was to organize my thoughts) and have basically copied and pasted all the documents I can find on openptv into a single document which I have filled in with answers from the openptv forum. I hope this will be of some use to the group and will send it to you with in a day or two ( I just want to add in some final comments). Thank you again for all the assistance. 

Best wishes,
Rachael Hager

Alex Liberzon

unread,
Jun 8, 2016, 6:15:36 AM6/8/16
to openptv
H Rachael, 

The droplet - droplet interaction is a very hot topic. I know also that some of the forum members are from TU Eindhoven or Twente groups that use 3D-PTV for very similar type of studies, injecting droplets and tracking them in 3D. We'll also have a project in our lab of a slightly different setup of impaction of droplets/particles that we need to implement with 3D-PTV. The problem at the moment is the speed of our cameras is not high enough. So we do some in-house development of the real time image processing to increase the recording time and decrease the bandwidth of the data transfer to storage. On the other side of the particle-particle interaction spectrum we did some work with the ETH Zurich people (also on the forum) of colloidal aggregate breakage. There are two additional things that would be very useful for you - the post-processing of 3D-PTV data, that Yosef Meller has developed. He will send here on the forum his draft I believe soon. The software is an open source like everything else we do - and we'd be happy to help you to use it. 

According to your youtube channel you're very talented educator and so I hope we'll see a very clear and constructed manual that will take this community a great step forward. Looking forward.

Best
Alex 

reh...@berkeley.edu

unread,
Jun 22, 2016, 4:42:27 AM6/22/16
to openptv
Dear Alex, 

I am so sorry this took me so long to reply,  I have been trying to read up more  to understand Openptv before I ask any more questions. But I first wanted to say thank you once again for the information on those studying droplets/particle interactions using ptv and with the news on the post processing data by Yosef Meller!! (I have just started to look at his flowtracks code and am currently trying to learn how to use it)

I have attached what I have so far stitched together as a manual for myself (which again is just a copy  and paste of the information from other manuals, so  no words of my own but it was a way to organize my thoughts so it's repetitive of the other manuals), but I am working on expanding the sections you'll see labeled as "to be filled in", which should be new and will get an updated copy to you as soon as i'm done expanding on this.  

I was also wondering if it would be possible to ask just a few more clarifying questions. They are as follows:

1.I was wondering on an issue I seem to be running into with the test_cavity-master case that is posted online and in tutorial 2. I am able to go through the calibration steps fine up until I select orientation. Once I've selected orientation all is still okay, and the .ori file is updated as expected, but then if I select orientation with particles" the .ori file is filled with NAN statements. I was wondering if others have had this issue and why there was such a difference between orientation and orientation with particles. 

2. I was also wondering about the definition for "sortgrid.par", i have found in one of the manual that it states "distance between detected image coordinate and projected control point in pixel" but was unsure of this meaning.  

3.I wanted to confirm my understanding of the XYZ protective center and the xp, yp distance. The xp/yp is the offset distance from the imaging axis to the sensor plane. This would come from the lens or camera I was using. The XYZ protective center, however, is the distance from the calibration plate's origin to the  camera's sensor. 

4. Also I was going through the 2D jet example online and found that although there seemed to be a calibration plate from the calblock.txt file the cal_1.tiff was just an image of particles from a jet and was wondering if I was missing. I saw in the post https://groups.google.com/forum/#!searchin/openptv/2D/openptv/Ytbv_laq4W8/qTpww0vE2vEJ that calibration is still necessary, which makes sense. Is a flat 2D plate just used in the 2D case?


Thank you again for such positive responses to my questions! 

Best wishes, 
Rachael 
PTV_V1.pdf

Alex Liberzon

unread,
Jun 22, 2016, 4:16:34 PM6/22/16
to openptv


On Wednesday, June 22, 2016 at 11:42:27 AM UTC+3,.edu wrote:
Dear Alex, 

I am so sorry this took me so long to reply,  I have been trying to read up more  to understand Openptv before I ask any more questions. But I first wanted to say thank you once again for the information on those studying droplets/particle interactions using ptv and with the news on the post processing data by Yosef Meller!! (I have just started to look at his flowtracks code and am currently trying to learn how to use it)

I have attached what I have so far stitched together as a manual for myself (which again is just a copy  and paste of the information from other manuals, so  no words of my own but it was a way to organize my thoughts so it's repetitive of the other manuals), but I am working on expanding the sections you'll see labeled as "to be filled in", which should be new and will get an updated copy to you as soon as i'm done expanding on this.  


Thanks for all the work. It's a very good approach. 
 

I was also wondering if it would be possible to ask just a few more clarifying questions. They are as follows:

1.I was wondering on an issue I seem to be running into with the test_cavity-master case that is posted online and in tutorial 2. I am able to go through the calibration steps fine up until I select orientation. Once I've selected orientation all is still okay, and the .ori file is updated as expected, but then if I select orientation with particles" the .ori file is filled with NAN statements. I was wondering if others have had this issue and why there was such a difference between orientation and orientation with particles. 


first, it's probably the least documented part of the calibration. in our jargon this calibration with particles is called "shaking" as we basically "shake the camera parameters" in order to reduce the epipolar distance to each of the previously detected and tracked (!) quadruplets (not sure maybe also triplets). The way it should work is: 
- Start/Init
- Sequence
- Tracking
- Calibration
- Load images
- Calibrate with particles (without using detection, etc. of the target images)

However, it's very much likely that this part is still broken in our present code - this pull requested is a long-standing one: https://github.com/OpenPTV/openptv-python/pull/29
and not yet approved. What is possible to do is to pull the branch of the fix and try it. 

In general, this is the last resort for the calibration and it improves the calibration just a little bit if the calibration is already correct. but if it's a wrong calibration, then shaking leads to disasters. Always recommended to backup a working calibration set. 
 



 

2. I was also wondering about the definition for "sortgrid.par", i have found in one of the manual that it states "distance between detected image coordinate and projected control point in pixel" but was unsure of this meaning.  


The way the calibration works is first to take a list of a known 3D points (provided in a text file, e.g. calblock.txt) and project those onto an image (using some rough estimate after 4 clicks of the manual orientation). Around each projected point a circle of the radius specified in sortgrid.par is drawn and if there is a dot detected by image processing in the image of the calibration target, then the dot receives the number of a known point. The radius should be a reasonable number varying between few pixels for very dense calibration targets to a larger radius for sparse calibration targets. It should be less than the pixel distance between the neighbour dots. 


 

3.I wanted to confirm my understanding of the XYZ protective center and the xp, yp distance. The xp/yp is the offset distance from the imaging axis to the sensor plane. This would come from the lens or camera I was using. The XYZ protective center, however, is the distance from the calibration plate's origin to the  camera's sensor. 


I'm not sure, please point me to this XYZ thing, I do not understand what you refer to. If it's the first row in the cam1.ori file for instance, than it's a 3D position of the camera sensor in mm in the coordinate system attached to the calibration target (as defined in the text file). The angles, by the way, in the second row of the same file are camera-attached angles. 


 

4. Also I was going through the 2D jet example online and found that although there seemed to be a calibration plate from the calblock.txt file the cal_1.tiff was just an image of particles from a jet and was wondering if I was missing. I saw in the post https://groups.google.com/forum/#!searchin/openptv/2D/openptv/Ytbv_laq4W8/qTpww0vE2vEJ that calibration is still necessary, which makes sense. Is a flat 2D plate just used in the 2D case?


The 2D calibration requires a 2D flat plate, right. It will help to check for all kind of aberrations and mainly the angle between the imaging plane and the measured plane. 

Farzan

unread,
Aug 21, 2016, 6:43:58 PM8/21/16
to openptv
Dear Alex,

I am also a beginner user of OpenPTV and have been trying to learn to use the code. I found the questions and answers in this thread very helpful in clarifying my own questions. I am posting my questions in this thread since I think they are related to the topics discussed herein. 

My background is in primarily in PIV and Micro-PIV and now I am planning to use OpenPTV for particle tracking in 2D and may later expand the work to 3D. I started from the "2D_jet" example and noticed the missing calibration image that Rachael pointed out. In order to better understand the code and the processing parameters, I decided to make synthetic images (with known particle size, count, and displacement) and start from processing them. I think I have the calibration right, and the code detects all the particles. but there seems to be a problem with tracking, as the code output in terminal shows all links as "lost".

Attached I am sending the experiment folder containing the images, calibration target (also a synthetic image) and all the parameters file. I would greatly appreciate if you could help me resolve the issue.

Best regards,
Farzan
test_FK3.zip

Alex Liberzon

unread,
Aug 22, 2016, 11:33:31 AM8/22/16
to openptv
Hi Farzan

I've looked at the folder and applied some changes. See the compressed file https://goo.gl/z1rc58 


 Please, send us all the things that are not clear from the documentation/tutorial - it will help many others. Several issues that I've noticed and changed 

- calibration - the ORI files
- pixel size and index of refraction I set all to 1.0 so we have 1:1 pixel to mm conversion for easier discussion
- I checked everywhere the highpass and include pairs - these are needed if you work with 1 camera I think
- somehow Sortgrid fails, but Sortgrid with initial guess works fine, I used that
- I just shifted the cameras instead of rotating them, but it shouldn't matter much
- there is a bug in the code, it might affected your case too, not sure. Please, update with the latest openptv-python (i think it's fixed now, use the parameter.py from this file https://github.com/OpenPTV/openptv-python/archive/debug_print_ori_issue.zip
- you cannot name img.10001.tif - the .tif extension is not working. I renamed all the images to img.10001 - that's how Sequence can find them
- now, after 1:1 magnification, the shifts are in pixels and it's easy to find out what is needed for tracking. So tracking works as well. 

Good luck 

Farzan

unread,
Aug 22, 2016, 3:27:28 PM8/22/16
to openptv
Thank you very much Alex for the clarification. I will compile a list of questions/comments and post on the forum.

Best,
farzan

Lukas Engelen

unread,
Oct 26, 2017, 6:16:52 AM10/26/17
to openptv
Dear Farzan,

I tried to run you example but as you mentioned in a previous post, all the particles get lost during tracking, although I used the updated version of Alex:

Determinate
Match: 0, => rms = -nan micron, rms_x,y,z =  -nan/ -nan/ -nan mm
 Determinate done
Starting sequence action (default algorithm)
10001 10030
img/img.

Object volume is scanned in 19 slices!

zdim: 2.000000, max: 1.000000, min: -1.000000, st: 0.105263
1
Setting image: img/img.10001

Highpass switched on

 Peak fitting version is 3


Transformation to metric coordinates

determined 1133 points from 2Dunidentified objects = 0
Setting image: img/img.10002

Highpass switched on

 Peak fitting version is 3


Transformation to metric coordinates

determined 1130 points from 2Dunidentified objects = 0


and so on and

Average over sequence, particles:  39.9, links:   0.0, lost:  39.9
tracking without display finished

Could you tell me how you solved the problem?
Thanks in advance,

Lukas

Op maandag 22 augustus 2016 21:27:28 UTC+2 schreef Farzan:

Lukas Engelen

unread,
Oct 27, 2017, 3:06:47 PM10/27/17
to openptv
For completeness, I have the same problem with the other 2D test cases (2D jet and Track example). I assume it has something to do with not finding correspondences across multiple frames (multiple cameras).
Does anyone has suggestions how to proceed when applying OpenPTV to 2D setups?

Op donderdag 26 oktober 2017 12:16:52 UTC+2 schreef Lukas Engelen:

Alex Liberzon

unread,
Oct 27, 2017, 5:37:01 PM10/27/17
to openptv
Hi Lucas

Please try the example here: 

I suggest you clone it using git and not just copying the zip file (although it's fine to do). I specifically left inside the results and temporary files (_targets, rt_is. files, ptv_is. files and so on) and if you use git then after your run you can immediately see what changed. I think something is not right with the parameters in your case, or the calibration - the prints above in some cases show that you find "no particles" and it's strange. 

If the example still fails for you, we need to see what's changed and try to figure out what's wrong. 

Alex Liberzon

unread,
Oct 27, 2017, 6:01:17 PM10/27/17
to openptv
The calibration in this example was wrong for some reason (probably my fault). I fixed it and it's over here: 

Reply all
Reply to author
Forward
0 new messages