Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting RGB image to a useable format

I'm taking a live image from an RGB Sony camera and what to simply 'invert' the image palette so the colors are reveresed. I get the good ole' invalid image type error. I've tried the 'convert 16-bit to 8-bit image - but it too. Gives me the 'invalid image type' error.
 
I am doing a rather intense vision application  and would like to see if I can configure the camera in MAX to give a color image in a format that I can use the invert function without doing the rather math intensive  convert.
 
Why is this such a pain? Why dosen't the canned pixel and color pane manipulation routines NOT work in a standard out-of-the-box RGB camera?
 
Regards
 
0 Kudos
Message 1 of 2
(3,068 Views)

Hi Alias,

In Vision, there is an imaqInverse function which outputs the inverse of an image.  I am assuming this is what you are using, because it only supports grayscale images and will give the 'invalid image type' error if a color image is used.  You could use the Vision function Extract Color Planes which will give numeric values for R, G, and B.  You can then perform simple math (255-x) to get the inverse and then use imaqReplaceColorPlanes to recompile the image.

Regards,

Ryan M.
Applications Engineer
National Instruments

0 Kudos
Message 2 of 2
(3,049 Views)