From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I use IMAQ imaging tools to track a bubble moving through a tube BUT TROUBLE WITH HOW I GET MY MM/PIXELS...

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.

 

MY ISSUE:

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!

 

 

Inline image 1

0 Kudos
Message 1 of 4
(2,431 Views)

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.

0 Kudos
Message 2 of 4
(2,423 Views)

Hello,

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.

 

Thanks

0 Kudos
Message 3 of 4
(2,347 Views)

Hi Question93

 

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:

 

http://digital.ni.com/public.nsf/allkb/815CFD0DACE4AFB08625770F004EE84E

 

-N

National Instruments
Staff Certification Engineer
0 Kudos
Message 4 of 4
(2,314 Views)