12-23-2008 12:56 PM
I have a an I16 image going into AutoMThreshold and what comes out is always 0-255 (as a single) when it should be 0-4095 (My camera has a bit depth of 12). Am I doing something wrong?
Assuming there's no way to get an I16 out of AutoMThreshold, do I bit shift the result by 4 bits or 8 to get the right answer?
12-29-2008 12:23 AM
Hello,
These are statements in the Detailed Help for the IMAQ AutoMThreshold function:
"Number of Classes is the number of desired phases. This algorithm uses a clustering method and can use any value between 2 and 256. The default value is 2."
"Lookup Table is an array containing the values of the 256 transformed elements encoded between 0 and (n – 1), where n is the Number of Classes. You can connect this array to the IMAQ UserLookup VI to perform a threshold operation directly."
"Threshold Data out outputs an array containing the Number of Classes compatible with the IMAQ MultiThreshold VI. The results range from 0 to (n – 1), where n is the Number of Classes"
As you can see, the outputs of this function can only have a value that ranges from 0 - 255. I hope this helps.
12-29-2008 01:22 AM - edited 12-29-2008 01:23 AM
Maybe I was not clear enough. I'm not talking about the number of elements in the Threshold Data output. I'm using the default number of classes (2) and I get an array of clusters with indices 0 and 1 as expected.
The upper value and lower value pixels inside the clusters are coming out wrong though. For example if I have a 12 bit image represented with an I16 image type and my noise floor is roughly 1000 I won't get 1000 for the upper value of the cluster with index 0. I'll get something on the order of 170 or something. Even if I get a mostly white image with the average pixel value around 3500, I still won't get anything above 255 for my upper value. I'll get something like 220 or something.
01-05-2009 01:26 PM
Can someone try out autothreshold for me with an I16 image and see what they get out for upper value of the first cluster coming out of Threshold Data output? Does that threshold value make sense for your particular image?
TIA
01-08-2009 03:36 PM
I tried it out on my end and noticed the same behavior. We will look into this further on our end; look for another post sometime soon.
01-08-2009 06:04 PM
01-13-2009 11:26 AM
01-13-2009 12:43 PM - edited 01-13-2009 12:44 PM
03-15-2010 12:26 PM
Has a CAR been issues/corrected, I have the same issue in LV 2009 currently. I need to threshold a 16bit image into multiple classes and do not want to write my own if possible.
03-15-2010 01:14 PM - edited 03-15-2010 01:15 PM
As a crude workaround you could use Image Cast to take it down to 8 bit and then use the autothreshold and then just multiply the results by 256.