From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-19-2016 07:52 AM - edited 10-19-2016 07:52 AM
hey all,
i have an 1D array with thousands of pictures and i want to overlay them all in one as fast as possible.
i've tried different approaches ... so far the best one i found is to use "concatenate strings" but still too slow for my need.
anyone got any idea?
Solved! Go to Solution.
10-19-2016 09:22 AM
The subVI you use (Draw Point.vi) is not a reentrant VI, so parallelism doesn't help.
How fast you need?
> i have an 1D array with thousands of pictures
Actually, that's 1D array of points, not pictures.
Why not use chart/graph ?
10-19-2016 09:54 AM - edited 10-19-2016 10:13 AM
thx for the reply, zou!
good to know that parallelism doesnt work here ... it actually slows it down by a factor of 2 i've just realized.
> i have an 1D array with thousands of pictures
Actually, that's 1D array of points, not pictures.
Why not use chart/graph ?
yeah it's a 1d array of points ... but in pictures. so thousands of pictures with one black pixel each.
i know chart/graph would be way easier here ... but i've got to implement this in an already existing VI and everything that's graphic there is handled as a pattern image. besides i need to to export the pattern imager (respectively the 1d array of points) as *.bmp file
the pattern/picture i want to draw consist of e.g. 4.000.000 points (x/y coordinates).
so i need a way to draw all those points in one picture ... ideally in under 5minutes.
in my first version i overlayed picture by picture through a shift-register in the for-loop. that was way too slow.
10-19-2016 10:50 AM
Put the content of the subVI in your VI.
Try the modified VI.
10-19-2016 03:28 PM - edited 10-19-2016 03:30 PM
How many colors are there? Initialize a 2D array of U8, then replace elements according to the coordinates. Create a color map that contains the 256 colors you have and form the image at the end using flatten pixmap. Or use draw unflattened pixmap directly if it is just for display! (You could even us an intensity graph!).
If you have more colors, do the same with U32.
Can you attach a VI that contains some typical inputs?
10-19-2016 03:44 PM - edited 10-19-2016 03:52 PM
Here's what I had in mind....
Modify as needed. As I said, you can use draw unflattened pixmap to create an image from the result or add it to an existing image.
10-19-2016 03:53 PM
10-19-2016 04:23 PM
You are adding 4 million pixels (quite a few probably in duplicate), which is significantly more than "thousands". I would expect to solve original problem to be much, much faster. (<<<1s) 😄
10-19-2016 04:44 PM
10-19-2016 04:50 PM
Using an array of 4M coordinates on a 4kx4k array takes about 18ms here. Drawing the flattened pixmap is the slow step and takes hundreds of milliseconds. I would stay away from picture functions and use simple 2D arrays.