LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image/Picture to to 2d Array Without Using PictureToPixmap

hey everybody,

 

iam trying to convert a picture/image to a 2D array ... doesn't matter if it is a 1bit- or 24-bit pixmap.

the problem iam facing is that the dimension of my picture is too big for the VI "picture to pixmap" cause that VI only allows max 16bit integer ... so anything bigger than 32768px get's cut.

 

here you can see what i mean:

Fill-Pattern.png

 

i've tried all day long to find a workaround ... but i wasnt succesful. maybe you can help me. 🙂

 

the reason why i actually want to do all this is:

i've got a set of point coordinates that define the edge of any shape (e.g. rectangle) and i want to fill that shape using the VI "Draw Multiple Lines".

in the end i need the point coordinates of every pixel of that filled shape. so using that VI "Draw Multiple Lines" is crucial.

0 Kudos
Message 1 of 22
(5,031 Views)

How about the general ctrl invoke node:

Get ctrl image ?

 

Could you show us the image/picture ?

 

George Zou
0 Kudos
Message 2 of 22
(5,008 Views)

thx for the fast reply, zou!

 

i think that doesnt work cause that would require that the picture on the front panel got the wanted dimension.

i've just tried it and i cant get the picture wider than 16006px (see attached VI).

 

 

0 Kudos
Message 3 of 22
(5,001 Views)

My post in your other thread suggested a comparison. That would create a boolean array of the same size as your input array. The boolean array is essentially a 1-bit pixmap of course.

 

Lynn

0 Kudos
Message 4 of 22
(4,980 Views)

There is no need for any picture function, because all you want at the end is a plain boolean array. This can be created and operated on in-place very efficiently using simple array operations.

 

Do you really need all these pixels or are they quantized to simple integer multiples?

 

Where does the image data come from?

 

In any case, all your operations can be done on arrays. Picture functions are orders of magnitude less efficient.

 

0 Kudos
Message 5 of 22
(4,967 Views)

@johnsold:

 

good idea!

but this way i can't use the VI "draw multiple lines" to fill the interior of the shape.

your suggestion only works when i draw a picture for every single point coordinate and then i only have the edge of the shape.

 

as i said it is crucial for me to fill the interior of any given shape.

 

0 Kudos
Message 6 of 22
(4,966 Views)

@altenbach:

 

how so? even to fill the interior of any given shape without using picture functions?

0 Kudos
Message 7 of 22
(4,961 Views)

Are the individual shapes large or are there many small shapes spread over a large area?  If the shapes are small you can use the picture function to draw the filled shape at the origin and then place it at the proper location in the image array.

0 Kudos
Message 8 of 22
(4,951 Views)

>Do you really need all these pixels or are they quantized to simple integer multiples? >Where does the image data come from?

 

i really need all these pixels. i'll explain the idea behind the program:

 

i have a map of let's say 2mm x 2mm and i want to write a shape like this one which is equally large (2mm long, 1mm wide):

 

the given shape is available as bézier curve and i then define a grid size (e.g 20nm) to subdivide the edge of the shape in equidistant point and calculate those coordinates (x/y).

these are the coordinates that go into the VI "draw multiple points" as input.

 

in the end i need a 1d array of cluster of 2 elements (x/y point coordinates) of the given shape (with filled interior) as well as a BMP of this shape for a process called EBL where an electron beam draws that shapes on an electron-sensitive resist.

every black pixel in the picture is written and is essential for the shape.

 

0 Kudos
Message 9 of 22
(4,945 Views)
@re-fuse wrote:

how so? even to fill the interior of any given shape without using picture functions?


If a picture function can do it, you can do it with array functions. Just traverse the array in memory order and switch color at each transition. Maybe tweak for edge effects at the start of each row. Also watch out for single pixel edges.

0 Kudos
Message 10 of 22
(4,933 Views)