10-28-2014 05:39 AM
Hello.
I need to measure the area of an irregular shaped object. Ideally I would create a binay image, but I fear it is not possible for my solution, since the background and conditions in general varies.
So I wonder if there is a way to detect the shape (I know it's possible, I already did it) and then somehow measure on this shape?
Either by measuring the number of pixels contained in this shape, or somehow convert only the shape to binary? I.E. the shape is 1, the rest of the image is 0.
Any thoughts would be much appreciated.
10-28-2014 05:57 AM
Hello,
if the background varies, did you try the adaptive thresholding methods?
If you can extract the contour of the object you could construct a custom (polygon) ROI and convert it to mask using the IMAQ ROI to Mask.
How do you detect the shape of your object?
Best regards,
K
10-28-2014 07:06 AM
Well, the question was actually also about detecting a shape.
I played around with the contour analysis tool. With this I was able to detect the desired contour. I actually only need to be able to measure how many pixels are contained within this contour.
10-29-2014 03:38 AM - edited 10-29-2014 03:44 AM
Hello,
if you extracted the contour points, you could construct a ROI and convert it to mask, followed by the particle analysis:
One thing that is strange though, in the example above, the rectangle/mask of the particle analysis shows +1 pixel in both directions. I am not sure what is the reason for this.
Regarding the detection - it's impossible to say, since you did not provide any examples.
Best regards,
K