10-21-2016 09:04 AM - edited 10-21-2016 09:16 AM
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:
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.
10-21-2016 09:23 AM
How about the general ctrl invoke node:
Get ctrl image ?
Could you show us the image/picture ?
10-21-2016 09:41 AM
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).
10-21-2016 10:27 AM
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
10-21-2016 12:24 PM - edited 10-21-2016 12:28 PM
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.
10-21-2016 12:26 PM
@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.
10-21-2016 12:28 PM
@altenbach:
how so? even to fill the interior of any given shape without using picture functions?
10-21-2016 12:46 PM
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.
10-21-2016 01:00 PM - edited 10-21-2016 01:05 PM
>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.
10-21-2016 01:21 PM - edited 10-21-2016 01:25 PM
@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.