LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create image with black and white patterns

Solved!
Go to solution

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.

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
Download All
0 Kudos
Message 1 of 13
(6,872 Views)

Yeah, there are a lot of ways, what exactly are you trying to do?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 13
(6,864 Views)

i need to create a template image that looks like Picture2.

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 13
(6,860 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 13
(6,855 Views)

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


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 13
(6,852 Views)

Image as in Picture 2 has to automatically generated.

 

Yes mike. That was a mistake. Actual images have to be in PNG format.

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 13
(6,837 Views)

Automatically generated based on what? The drawing functions could put a black rectangle wherever you want it.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 13
(6,831 Views)

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

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 8 of 13
(6,786 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Download All
0 Kudos
Message 9 of 13
(6,760 Views)

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

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
Message 10 of 13
(6,756 Views)