Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Turning a grayscale AVI into a color one?

Hello,
 
I am trying to use a JAI Pulnix TM-1640 camera
0 Kudos
Message 1 of 11
(5,215 Views)
Hello again,
 
Sorry about the double posting...I'm not really sure how that happened. O_O
Anyway, my full question was this: I'm using a JAI Pulnix camera and the Sequence and Save to AVI VI to create a color AVI.  The program takes the AVI just fine, but when I view it the video is in grayscale.  I tried to modify the VI to cast the images into color, but I don't see any change when I take new AVIs.  I read in another thread that the program assigns the same value turning out the RGB components and this is why the video still turns out as a grayscale, but I don't know where to change these values so that I actually CAN see the colors.  I have also tried modifying the device settings on MAX, but other than the palette settings in the camera attributes, I can't seem to find any place to change the image properties.  Any suggestions as to how I can accomplish this?  I attached the modified VI below.
 
Thank you!
Melissa
0 Kudos
Message 2 of 11
(5,214 Views)

Questions:

Is this a color camera?  If not, you won't ever get color images from it.

Can you view live images in true color, using either MAX or LabVIEW?  I don't mean false colors generated by the different palettes.

If this is a grayscale camera, there isn't an easy way to record the colorized version shown when using palettes.  You could probably get it by displaying each image and retrieving the control image using property nodes, but you wouldn't be able to do that at full frame rates.

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 11
(5,205 Views)
Bruce,

It's a color camera.  I've been able to grab live images in true color when I use the White Balancing Utility, but I haven't had any success in LabView, and the only results I've ever gotten with MAX are the false colors. I read somewhere on the site that I can change these settings by changing the properties in MAX, but the other problem is that I can't get to the properties manager, at least not in the ways that have been suggested to me (right-clicking the PCI, going to File->Properties).

Melissa
0 Kudos
Message 4 of 11
(5,196 Views)
Hi Melissa,

One thing to do would be to make sure that you have the correct camera file selected.  To do this, go to MAX»NI-IMAQ devices»[your camera].  Right click and go to camera»select camera.  Here you should be able to choose from a list of camera files which will govern how the image data from your camera is brought in through the driver.

Wes P
Applications Engineer
National Instruments
Wes Pierce
Principal Engineer
Pierce Controls
0 Kudos
Message 5 of 11
(5,177 Views)

Wes,

As you suggested, I went into MAX to see if the camera file I was using was the right one, and I don't believe it was.  However, I couldn't find a file that matched my camera's name.  I then searched the NI website to see if my camera was one of the current supported cameras, and it was (it is a Pulnix TMC-6740CL).  There were two camera files under the available downloads--the Pulnix TM-6740 (1428) file is the one that is currently selected in MAX.

The camera link that I am using is the NI-PCI 1426 Camera Link.  Is it possible that I cannot get color images because these are not compatible?

Melissa



Message Edited by mb056145 on 03-13-2008 02:57 PM
0 Kudos
Message 6 of 11
(5,162 Views)
It sounds like you have the right camera file.  Did you select a color mode in the main camera setup page?
 
Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 11
(5,154 Views)
Hi,

Sorry for the delay in replying... I don't think I've ever seen any options for choosing a color mode in MAX, other than the palette options.  When I try to change the camera attributes in MAX, I only have the options to make the images 8 bits or 10 bits, but not RGB (32 bits).  So far this is the only way I know to change camera settings.  Is there another program or method that might work?

Melissa
0 Kudos
Message 8 of 11
(5,079 Views)
It looks like your camera uses Bayer encoding to get color information.  If you zoom in on your image, it probably has a checkerboard pattern in it.  You will need to use Bayer decoding to turn it into a color image.
 
MAX may have an option to do the Bayer decoding onboard, but I am not sure.  Your only other option is to use the Bayer decoding VI in LabVIEW, which will be painfully slow but will work well.  It will turn your grayscale image into the appropriate color image, with a little work.
 
You might want to do a little searching and reading about Bayer patterns so you understand what is going on.
 
Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 9 of 11
(5,070 Views)
Since you are using the PCI-1426, you are using the NI-IMAQ driver (as opposed to IMAQdx, etc.).  Therefore, you will need to use the Bayer Decoding VI in LabVIEW, as suggested by Bruce. KnowledgeBase 3H4F8GL6: Color Camera Shows Black & White Images in MAX is a great reference.  It also contains some links to other relevant references.  I hope this helps!

Wes P
Applications Engineer
National Instruments
Wes Pierce
Principal Engineer
Pierce Controls
0 Kudos
Message 10 of 11
(5,053 Views)