Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ AutoMThreshold question

Hello,

I have a vi that is meant to take in a picture of a bunch of various grey circles and do a threshold and label each various grey circle as an object with an assigned color.  When number of classes is greater than 2, two "shades" get output so the BKG is labeled zero and all objects are labeled one. But when number of classes > 2, the BKG gets labeled 1 and all other objects get labled 2, and some objects (the dark ones) get labeled 1 and disappear into the BKG. Why does this happen?
Thanks,
Candice
Download All
0 Kudos
Message 1 of 4
(3,428 Views)
Hey Candice,
 
Thanks for contacting NI.  I've looked at your VI and your image that you've attached but I'm afraid that I don't completely understand your program.  I loaded the image that you supplied and experimented around with the class feature. I'm a little confused because you refer to the number of classes being greater than 2 twice.  The range of that variable is 2-255.  This determines how specific the auto thresholding function is when it performs its operation on the image.  If you could provide me with a few more details, I could better help determine what is going wrong here.  Thanks and I hope you found some of what I said helpful!
 
Take Care,
Evan D.
Installer R&D
National Instruments
0 Kudos
Message 2 of 4
(3,400 Views)

If it is a simple bitmap like the one you attached, you could just find the min pixel intensity in the image and threshold one or two points higher than that.

In real life, the intensities won't be quite as uniform.  You would need to look at the histogram and threshold just above the first peak.

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 4
(3,397 Views)
Hey Bruce & Evan,

Thanks so much for your help. It looks like we decided to abondon the built-in thresholding functions and are working on a custom in-house routine.  I really appreciate your help.

Thanks,
Candice


Message Edited by Candice on 12-21-2007 08:33 AM
0 Kudos
Message 4 of 4
(3,389 Views)