01-26-2009 10:54 PM
Please, could someone explain what these two vi's do? When I perform a RGB gain calculation and initialize the LUT, it doesn't do much of anything. Please look at my code and let me know if I am doing something wrong.
Thank you in advance.
Matt
01-27-2009 01:17 PM
Hey Matt,
I'll have to look around for a firewire cam so I can test your VIs, but first I wanted to see if you've tried some of our Bayer examples? I assume you have, but its worth looking into if you haven't.
Looking at your code, I don't see anything that really sticks out, minus you using a case strucutre for false to become true and vice versa. You merely need to use a Boolean not for that.
01-28-2009 09:04 PM
01-29-2009 01:26 AM
Please disregard the LUT question, I just saw that I could see the code, and I will try to decipher that.
Matt
01-29-2009 08:48 AM
Matt,
As far as being able to set the attributes only once with the property nodes, I have a suggestion. I would assume it is the same with IMAQdx as it is with our framegrabbers, I will have to look into it to verify. Anytime you change attributes of the camera, you need to end the camera session and open it again. Even in MAX when you change an attribute, it doesn't look like it is ending the session, but on very low-level, it actually is. So, normally the best way around this is to create an event structure, where if the gain settigns change, end session and restart it.
As far as changing gain, with firewire cameras, it is stored on the camera, so your assumptions are correct.
01-29-2009 07:00 PM
Chris,
If this is the case, why is the raw 8 bit bayer image data that is transmitted from the camera not reflecting the gains that were set in the camera? When I set the gain in the camera and then put a gain value of 1 into the Bayer LUT vi, and then create a RGB image witht the Bayer decoded image vi the image still has the color as if the gains were not set in the property node first? I also made indicators that showed the gain from the camera with a property node (a read node) and they reflected the values I set at the beginning.
Matt
01-30-2009 12:57 AM
Hi Matt,
I have a couple of suggestions...
Presumably the color gains you were setting via the IMAQdx property nodes were the Bayer gains that IMAQdx uses for its internal image decoding (these are not on the camera). However, you were grabbing raw image data as an array and decoding it yourself and doing a manual de-bayering of it via the Vision bayer decode VIs. Since IMAQdx is not doing the decoding to a color image, its bayer gains are not used.
What you probably want to do is instead tell IMAQdx to decode your image with a Bayer pattern. You can change this option in MAX on the last tab that selects the Bayer pattern to use. Depending on your camera this may be set automatically if you go into a color video mode. However, you can tell the driver manually to decode it as a bayer image. You can also change all of these things programatically in LabVIEW as well but it might be easier to start by saving the settings in MAX first. You can then switch to using a normal Grab VI instead of getting the raw data as an array. Even if you didn't want IMAQdx to do the Bayer decode, you would probably be better off still just telling IMAQdx to not apply a pattern ("None") and grabbing it as a Mono image and then running it through those Vision VIs to de-bayer.
Now what Chris mentioned about the session needing to be closed is not quite true. In the IMAQ framegrabber driver, "camera" attributes (ie ones that exist on the camera and controlled via serial commands as described by the camera file) do in fact need to reconfigure the framegrabber when you modify them to keep the camera's settings coherent with the driver. In the IMAQdx driver, this is not true and each attribute (whether in the driver or the camera) may have a different policy regarding when it can be written to. However, the one you are talking about that controls the Bayer gains is not writable while the acquisition is "configured". This is because the image decoder must recalculate the lookup table. However, there may be another option. Many color cameras offer on-board color correction as well where they adjust the gains individually on the pixels representing each color of the bayer pattern. You may want to see if your camera offers a White Balance or Hue attribute (it would show up in MAX) that may achieve the desired effect. In fact, they may have a mode to make it do a continuous automatic white balance too.
Hope this helps,
Eric
02-01-2009 05:11 PM
Eric
Thanks for the reply but your post brings up some questions.
Is there any way to set the gains first with the property node, and then take that image and correct it with the Bayer LUT and Decode vis? The reason is when I set the gain with the property node it works pretty well, but I want to be able to make small small color adjustments to that image, but the best way seems to be using the Bayer LUT and Decode.
Also, I think I may be missing something. What is the differnece between IMAQ and IMAQdx? I can't seem to find anything. Please let me know, or at least fill me in where to look.
Thanks again,
Matt
02-02-2009 08:21 AM
Hey Matt,
To answer the second half of your post, IMAQ and IMAQdx are different drivers that both come in Vision Acquisition Software. IMAQdx requires a license and can communicate with firewire and GigE cameras. IMAQ is used for our framegrabbers.