05-20-2017 06:20 AM
Hello, how can i process video in color, because when i apply filters or brightness and contrast it processed only in black and white,here the VI attached,thank you for answering me.
05-20-2017 07:10 AM
Posting from mobile Can't see code.
- There are many algorithms which are specific to gray-scale images.
- When you are not having extra buffer then most of them will change the original and image.
- If you want to have original image unchanged then keep separate buffer for original image and use imaq copy to have another image and process it.
- Read more on image types : https://zone.ni.com/reference/en-XX/help/370281AC-01/nivisionconcepts/image_types/
05-21-2017 08:18 AM
Hi, Touitou.
The IMAQ Create function, by default (meaning if unwired) will create a buffer for an 8-bit greyscale Image. Many (most?) of the Image Processing Functions work on 8-bit data. Color images are made by arranging four "planes" in a u32 representation (three of those planes are R, G, and B 8-bit values) -- you need to do some "extra work" to handle color processing (and it gets complicated pretty quickly).
In the VI you attached, all of your IMAQ Buffers were 8-bit, hence "shades of grey".
Bob Schor
05-24-2017 04:59 PM
separate your image RGB plane with imaq extract color planes use your filter and BSG on plane and at the end gather them with imaq replace color plane
use a simple white image with same size for replace color plane
05-27-2017 06:00 AM
thank you for replying me,but i didn't know how to apply what you had say in this VI.can you help me?
05-28-2017 04:08 AM
try some thing like this
05-28-2017 06:47 AM
Its not working,they give me three errors.
05-28-2017 09:57 AM
Here is a suggestion -- start simple. Forget about processing Video images, but instead work with a single color Image. One that I like to use is Desert.jpg, contained in the Sample Pictures folder in the Public Pictures folder. Use the IMAQ ReadFile to input the Image and simply display it in an Image Display. Now play with the Image to figure out how to do whatever Image processing you want, without having to worry about Grab, timing, saving, reading/writing, etc.
Here is a two-Image-VI routine to get you started, built essentially on the code that you posted. Note that you'll have to Browse for the Image, which is not going to be exactly where mine was stored (in all likelihood).
This code runs fine, and produces the following image (I used Zoom-to-Fit to see the entire Image):
See the lovely colors? I explained, in an earlier post, exactly why the code that you are using produces gray images instead of the following:
Read my earlier response in this string, "fix" the code that I posted, and see the Desert in Color.
Once you have a proper Color Image, you can work on "taking it apart" or "modifying the Colors". Do the processing one (small) step at a time, displaying the intermediate results so you know you are "doing the right thing". Experiment, try things out -- you won't "break" any pixels.
Bob Schor