Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to test if an image is binary (before binary processing functions return error messages)?

How to test if an image is binary (before binary processing functions return error messages)?

ImageInfo can only tell me whether a user-provided image from disk or live camera is of IMAQ_IMAGE_U8 type etc - but how can I check whether it is actually binary?!
0 Kudos
Message 1 of 3
(3,277 Views)
There is no function available to explicity check if an image is binary, since it is just an 8-bit image after thresholding. You can write a function to go through the pixel values and see if there are only two values (0 and 1), which will tell you if it is binary. Otherwise, simply catch the error and apply the thresholding before running the binary processing functions.

Julie S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,277 Views)
I am not particularly impressed by this answer.
It is not exactly an elegant way to fix this problem.

I would like to put in a feature request to add this ability to the ImageInfo() function.
0 Kudos
Message 3 of 3
(3,277 Views)