01-25-2013 08:14 AM
Hello
With the attached VI I am able to create an image which is completely black ( or white or any color according to values in color palette). See picture1.
Is it possible to create an image like Picture 2 and picture 3 Or any other form which consists of black and white patterns? I need an image with black and white regions which a camera can recognize.
Thanks for any help.
Solved! Go to Solution.
01-25-2013 09:34 AM
Yeah, there are a lot of ways, what exactly are you trying to do?
Mike...
01-25-2013 09:53 AM
i need to create a template image that looks like Picture2.
01-25-2013 09:59 AM
Do you need to do it programmatically or do you just need the image? Simple monochrome imagess are fairly easy to create. If you use a 2D Boolean array that is the same dimensions are your graphic simply set the bits you want black to True.
01-25-2013 10:00 AM
Use a 2D picture control functions to draw what you want and then save it as the proper file type.
Picture to Pixmap.vi converts the picture to a standard image format, Write to PNG File.vi will save that image to disk.
Mike...
PS: the files you posted said JPG, but they were really PNGs
01-25-2013 10:21 AM
Image as in Picture 2 has to automatically generated.
Yes mike. That was a mistake. Actual images have to be in PNG format.
01-25-2013 10:25 AM - edited 01-25-2013 10:25 AM
Automatically generated based on what? The drawing functions could put a black rectangle wherever you want it.
Mike...
01-28-2013 03:01 AM
Hello Mike
I tried to draw a Black rectangle in a white IMAQ image. See the attached VI. I found a VI in a forum that converts IMAQ Image to picture ( https://decibel.ni.com/content/docs/DOC-20071) and then i added the Draw Rect.vi from picture controls to draw a rectangle. But now i have a few problems. The IMAQ image being saved is white but it is not being read. The color to RGB vi should also work with a white image, right? OR do i need to convert it to 8/16bit image before converting to RGB?
See attachment
01-28-2013 08:14 AM
Where exactly are you getting the error that you mention on the block diagram of your code? What is the error?
If all you need is a black rectangle drawn on a 500x500 white background, why bother with the IMAQ drivers at all?
Mike...
01-28-2013 08:48 AM
Hi Mike
I cant open your vi. ( am having 2011 version) . But i managed to get the required result in another way. May b its not a perfect approach , but it works.
I created an IMAQ white image ( PNG format). Then read the PNG file and convert it to picture. Then draw the rectangle and convert it back to IMAG PNG format.
I need the IMAQ drivers bcos later in the VI i need it for other purposes.
See Screenshot
Thanks anyway