11-15-2013 12:04 PM
First off I did not write this program. I inherited it after it hasn't been in use for a couple of years. In the picture below there is a for loop within a case structure set to "default 0".
A Little Background:
this VI captures the pixels per time that a bubble moves through a tube. This information is the pink icon with the label "pixels vs. time 1". This information then is unbundled, and if you follow the wires it eventually is converted to cm from the pixels and that is stored once again into arrays that have various mathematical things done to it. There is another icon, the orange yellow labeled "mm/pixel" that is also wired to the compound arithmetic function and helps in the conversion of the pixels to length in cm.
the important question a have is with the yellow icon for mm/pixel. How has this number been calculated? In the VI that number will change according to the pixels captured from the camera. The issue is that I am not sure if this number is correct or not. Because doesn't height need to be taken into consideration when calculation this number? Or does some sort of calibration need to take place?
Does the compound arithmetic function factor into this issue or does it just make the calculation?
Any help or hints would be extremely appreciated. Thanks in advance!
11-15-2013 01:06 PM - edited 11-15-2013 01:10 PM
I cannot see the picture you included (broken link maybe?), but I can kind of get the gist of your question. Turning pixels into real world coordinates like mm can be done through a calibration. You point the camera at a target that usually has a dot grid pattern, you tell the calibration tool the dimensions of the dots, and then you get a conversion factor.
You can find the Calibration palette in the Vision Utilities palette. I like to do it through Vision Assistant and then generate a VI with it.
01-15-2014 11:32 AM
thanks for the answer but I'm still lost about finding a solution. I will attach the VI and maybe you can take a look at it and see a solution. THe setup in my lab includes a stand where the camera is fastened looking downwards. I want to make sure that when my VI is making calculations I have the correct numbers.
01-16-2014 09:01 AM
As BFeigum mentioned in his previous post, to convert from pixels to real-world coordinates, you will have to calibrate your camera, and then apply that conversion factor to an image to get the real world distance. Here is a KB article on requirements for calibrating a camera: