01-06-2014 01:14 PM
I have an image which is a signed int16 with no mask hooked up (externally masked). The IMAQ centroid vi is reporting the center of the ROI instead of providing the answer to the centroid. Why is it doing this?
Solved! Go to Solution.
01-06-2014 05:14 PM
Unable to reproduce - seems to be works as expected:
Andrey.
01-07-2014 07:26 AM
You have a perfect image. The centroid calculation works perfectly with a simulated Guassian beam. It is when a real image from a camera is used that the centroid is calculated incorrectly. Turns out that it is not the ROI, but happened to be the ROI the one time I showed it to someone else.
01-07-2014 10:25 AM - edited 01-07-2014 10:26 AM
@Steve_Block wrote:
You have a perfect image. The centroid calculation works perfectly with a simulated Guassian beam. It is when a real image from a camera is used that the centroid is calculated incorrectly...
In general Centroid is pretty simple and straight forward operation - this should be independent from the image's content.
If you get feeling that in some cases this computes incorrectly, then you can compute it with pure LabVIEW primitives something like that:
In comparison with IMAQ this will be a bit slow, but you will check that IMAQ centroid calculated correctly or not for your images.
Andrey.
01-07-2014 02:44 PM
I can believe the this a little more. I was concerned about something like overflow or truncation altering the results.