04-03-2008 10:13 PM
04-07-2008 09:56 AM
04-09-2008 02:35 PM
Hi,
LabView Vision module has IMAQ Centroid VI that calculates centroid - see attached picture 1. Centroid calculations are pretty sensitive to image noise and/or any thresholding operations performed on image. Special care shall be taken when applying any morphological/particle-based operations. Quite often these operations make image binary and all intensity information is lost. If Centroid VI is applied to that type of image, it will give GEOMETRICAL center of the spot (assuming uniform density), and not its actual intensity-weighted centroid.
Attached pictures 2 and 3 illustrate the situation. Image is sum of 2 gaussian functions separated by 100 pixels in X:
I(x,y) = 3*EXP(-( (x-x01)^2+(y-y01)^2 )/w1^2) + (EXP(-( (x-x02)^2+(y-y02)^2 )/w2^2) and scaled to Imax = 255
y01 = y02 = 0, w1 = w2 =60, x01 = -50, x02 = +50
It's easy to show analytically that image centroid shall be located at (-25.0 = (3*-50 + 1*50)/4, 0.0) pixels.
Centroid VI applied to that image gives pretty close result of (-25.03, 0.0) and its location is indicated by Green circle.
When image is thresholded at 128, Centroid VI calculates wrong centroid location at (-43.02, 0.0) even when intensity values above threshold are kept same as in original image (see Picture 2). When intensity values above threshold are replaced by max=255, centroid location is calculated at (-42.20, 0.0) - see Picture 3. Wrong centroid location is maked by Red circle in both pictures.
Correct image centroid location is strongly effected by image tail and may be quite apart from the image brightest spot.
03-13-2013 07:19 PM
Hi all
I am new to Labview and I am using it to do image recognition. I got that working but now my problem is that I need to get the centroid of the image that it had recognized. I understand that the image mask input on th IMAQ Centroid block provides a boundary search area to calculate the centroid. But I dont know how to connect it up. I need the centroid of the object that I had recognized.
Please if someone could attach an image on how to wire this block up it will be a major help for my mechatronics project or email it to me shiraubayd@gmail.com
Thank you in advance
03-14-2013 10:23 AM
For help learning how to appropriately use a subVI I suggest using the Context Help (CTRL+H) which will give an overview of what the subVI does and what the inputs and outputs are. This works by hovering over the subVI in question. If you need additional help, follow the Detailed Help link that comes up in the Context Help. This will give more information about each input and how to use it.
If you have more questions I recommend creating a new thread on the Machine Vision Forum. This thread has not been posted on in 5 years. Newer threads with fewer posts will get more attention from other users.
03-14-2013 10:47 AM
Thanks. I used all those help options that is why I am consulting the forum because I need an example of some sort maybe just on how to connect my image mask to create a defined area for labview to do the centroid calculation. I shall create a new thread.
Thank you.