LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stitch/view images in memory without building massive arrays?

Solved!
Go to solution

I wrote a program which will capture up to 100 images, total of 500MB.  I queue each image (12bit 1D array) in an array of queues.  I would like to "view" the queues selectively, grab the data (but not destroy each queue), and display this data as a large stitched image.

 

I've been able to do this by building an array from each queue and manipulating rows/columns until the images are stitched in my pattern.  Does this create another 500MB of wasted memory since I'm "copying" the queue data into another array?

 

Also, is there a simpler method of doing this?

 

 

0 Kudos
Message 1 of 8
(4,411 Views)
Solution
Accepted by topic author dre99gsx

Hey dre99gsx,

Iv written an example that seems to be the most scalable option to building a large image at present its restricted to using grayscale(U8) and only builds a 1D array formation.

 

Is it a requirement that u can access the separate images after they've been stitched.

 

Hope this helps

 

Philip


Philip
Applications Engineer
National Instruments
UK Branch

===If this fixes your problem, mark as solution!===
0 Kudos
Message 2 of 8
(4,356 Views)

Thanks Phillip.  That works, although I was looking for a one-stop-shop VI that handles memory allocation as efficiently as possible.  I ended up creating something similar to yours with some added features where you can hover over the stitched image and get image "stats", or, double click on the image and the full-res version appears. 

 

My main concern was with alignments since I may want to stitch these images from left to right or top to bottom.  There were eight combinations. 

 

Thanks again.

0 Kudos
Message 3 of 8
(4,330 Views)

Hey dre99gsx

 

Im glad that helps with regards to different alignments I seems you would have to use an ENUM and case statement

then write the code for each case using transpose array function's

 

I did find that there is a size limitation to the shift register in the region of 750MB that maybe machine dependent

 

I have attached code that I modified from the existing VI so that it arranges the images in to a 2D array but it is not very pretty. 

When running the VI there must be a square number of images in the folder that you direct it to. 


Philip
Applications Engineer
National Instruments
UK Branch

===If this fixes your problem, mark as solution!===
0 Kudos
Message 4 of 8
(4,324 Views)
Sorry here's the VI

Philip
Applications Engineer
National Instruments
UK Branch

===If this fixes your problem, mark as solution!===
0 Kudos
Message 5 of 8
(4,323 Views)

Hello, could you post that example for LabView 8.5 ?

 

thanks!!!!

0 Kudos
Message 6 of 8
(4,048 Views)

Dear Philip,

The 'Image Stitch' Vi that u have built stitches only non-overlapping images. I would like to ask you is there any way how to upgrade ur code in order to stitch overlapping images.

I am working on a problem where I have 6 (or 10 at most) images from long screws and I want to stitch them together into one image (for inspection purposes). Any tips or hints how to upgrade ur code will be very helpful.

 

Regards,

Zoran

0 Kudos
Message 7 of 8
(3,988 Views)

Notice that in the inner while loop there is a place where the multiple arrays are being stitched together (at the Build Array function). Here, you can choose to delete certain sets of pixels and then stitch the images, depending on which pixels you want "overlapped." Does this make sense?

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 8 of 8
(3,970 Views)