07-21-2011 04:14 AM
For grayscale images (U8 type) I use the IMAQ AutoB Threshold.vi (Method=Clustering) to determine the optimal threshold of an image (ie. some threshold value between 0 to 255) which I then parse to the IMAQ Threshold.vi which then applies this threshold level to the image.
However I can't seem to find an equivalent AutoThreshold VI for colour (RGB type) images, which is currently forcing me to manually set the colour thresholds to the IMAQ Color Threshold.vi.
The only VI that comes close is the IMAQ ColorHistogram.vi and I was just wondering if there was something else I had missed?
What I'm trying to do is isolate a blue vertical bar in a colour ultrasound image (where most of the image is either black or white). So I set the Red/Green range low (Min=0/Max=100) and the Blue range high (Min=200/Max=255). However I then got an image which had a purplish tinge to the background so the FIXED threshold ranges didn't isolate the blue vertical bar properly.
So I wanted some dynamic way of detecting the colours in the image and then set the thresholds appropriately so it would always isolate the vertical bar.
Chris
Solved! Go to Solution.
07-21-2011 10:17 AM
Hello
What I suggest is to extract the color planes of your RGB image. For example, extract the blue plane as it might be the one with the greatest contrast due to your blue line. Then use the IMAQ autoB threshold on the blue image (wich is actually in 8bit) and the threshold returned should be applied as the
blue threshold on your color image.
Regards
07-21-2011 09:51 PM
Thanks Toto, your idea worked perfectly. If I knew how to give you Kudos I would.
Chris
07-21-2011 09:52 PM
Oh right - you just click on the Kudos button - well der!!