Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Mismatch in centroid value obtained using sequence and grab

Hi,
 
I am working on a process where I monitor the image of an emission spot (see attached image in the zip file) as it travels across the CCD screen.  I use Labview 7.1 with "NI-IMAQ for IEEE 1394 cameras" driver software for image acquisition.  To monitor the process, I built two VIs:
 
1) To capture a sequence of images and simultaneously analyze each image to compute the coordinates of the centroid [see 22 October'05_Capturing desired image frames and avi and centroid output.vi].
 
2)To grab a video while simultaneously analyzing each image to obtain the coordinates of the centroid [see Grab .avi video with centroid information.vi]
 
Both the VIs use the same subVI [see Testing BA_Centroid of image.vi] to compute the centroid value.
 
The acquisition parameters of the camera during the execution of both programs was the same. 
 
Coming to the results, the centroid values (obtained by the program that captures the sequence of images) of the emission spot as it travels across the CCD tallies with the real position of the spot on the CCD array. 
 
However, to my surprise, I realized that the centroid values obtained by the grab program seems to be way off from the actual position of the emission spot on the CCD.  For example, say the emission spot is around pixel #600 on the CCD, the centroid value instead of being close to pixel #600 seems to be at pixel #450 which should not be the case as the emission spot intensity is concentrated in one small region on the CCD.
 
Can someone enlighten me as to what could be wrong with the Grab program?  The time it takes to compute the centroid value is about 15msec which is much faster than the frame rate of the camera (30fps).
 
Thanks.
 
Ram
 
0 Kudos
Message 1 of 7
(4,678 Views)
Ram,
 
There is nothing wrong with either program.  They both should work fine.  I would check to make sure that the image grabbed by both setups is exactly the same.  My intuition tells me they will be different.
 
My guess is that the camera is acquiring a different image than you were expecting and that your program is actually working great.  I am not familier with your setup, so I can't say for sure.
 
The best way to check would be to only grab 1 image and analyze the image yourself and get a rough estimate of the centroid of the emission and compare that to the centroid calculated by your program.
 
Good Luck,
Lorne Hengst
Application Engineer
National Instruments
0 Kudos
Message 2 of 7
(4,662 Views)
hi,

    Iam facing a similar problem but my application is relatvely easier..Iam havin an image of four dots as jpeg file..i need to find the centroid of each dot and mark apoint there..for this i used an image subset to create 4 subsets of the image and used IMAQ CENTROID.vi..but when i plot(after adjustin for the change of origin) the points lie somewhere else..pls help me with this mismatch..im attachin my file and image..
Download All
0 Kudos
Message 3 of 7
(4,451 Views)
hi,
    i actually added some values like -230 etc. to make the point appear on the dots..There is some compatibility problem with coordinates..pls help..
0 Kudos
Message 4 of 7
(4,448 Views)
Hi BHARATHINDIAN,

It might be easier if, instead of breaking the image up into four different images, you mask the image for each of the four spots. After masking each spot, then find the centroid of each masked region. There is a mask input to the IMAQ Centroid VI. You'll need to use multiple IMAQ Create VIs so that you do not write over your original file each time you mask the image.

This way you will have the centroid coordinates with respect to the whole image, not with respect to each piece of the image.

Does this make sense?
--Michelle

National Instruments
0 Kudos
Message 5 of 7
(4,408 Views)
hi,thanks for the reply..i tried masking but im not able to..pls help.

0 Kudos
Message 6 of 7
(4,394 Views)
BHARATHINDIAN,

Here is an example VI I put together to find two of the four centroids using an ROI which I converted into a mask for the IMAQ Centroid VI. To get the constant for the ROI Descriptor I ran IMAQ ConstructROI and copied this value to the constant. Give this a try.
--Michelle

National Instruments
0 Kudos
Message 7 of 7
(4,366 Views)