LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stitch images along overlapping area

My aim is to stitch images which is having fixed horizontal and vertical overlap with neighbour images. I have images stored in folder. For example, consider first image it is having some overlap (say 10%) with image on right and horizontal overlap with image on bottom of first image (say 10%). My final output should be M by N image with overlapping areas among images correctly joined.(M rows and N columns)

I have a VI where image detection,homography, matching blending is applied to 2 images acquired from camera. Right now , I am concentrating on part that images are already stored in folder.

 

But I need M by N images stitched as final panaroma with proper blending techniques applied.

 

I have attached VI.

Kindly help.

0 Kudos
Message 1 of 8
(3,219 Views)

My aim is develop a VI to stitch array of images which are having some fixed amount of overlap in both horizontal and vertical directions(say 10%).  User has to specify number of rows, columns, overlap  in X direction, Y direction.

 

For example, my first image (image in row1 column1 )in folder has some vertical overlap with second image (image in row1 column2)and horizontal overlap with bottom image(image in row 2 column 1 when arranged in form of array).

 

I have a VI that can perform image stitching on images with image detection, matching, homography, blending of 2 images acquired using camera.

But I tried to  produce a final stitched image with proper overlapping area among images stitched. If user inputs M (rows) and N (columns), output should be panaroma. But I am not getting proper output for images selected from folder for M by N images.

 

I have attached VI.

Please help

0 Kudos
Message 2 of 8
(3,217 Views)

You've basically posted the same question twice, and now you have posted what is essentially the same thing again!  Haven't we already "solved" your problem for you?  I recommend that you start doing your own work, or hire a competent LabVIEW Developer who can use the VIs we've already provided to you to solve your task.

 

Bob Schor

0 Kudos
Message 3 of 8
(3,186 Views)

I got solution for previous work ,i.e, join images without overlap. Now I am looking the case where images are having overlap.

 

Where I can get best online training in LabVIEW? Is NI offering the same?

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

Bob, I think  SSG0484  is asking this time for something like

http://matthewalunbrown.com/autostitch/autostitch.html

 

"AutoStitch works from unordered collections of images, automatically finding matches between images using the SIFT algorithm. It then robustly aligns all images and uses advanced blending algorithms to form seamless panoramas"

 

 

Obviously, that's far more more complicated than the task you asked for

in Re: Stacking images in array.

 

The files you attached in stitch images.zip ‏2037 KB 

look like an IMAQ demo.

Moreover, here's a Knowledge Base article from NI:

Information about Image Stitching

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000004BDJSA2&l=de-DE

 

I agree with Bob's statment:

"I recommend that you start doing your own work, or hire a competent LabVIEW Developer"

0 Kudos
Message 5 of 8
(3,150 Views)

@alexderjuengere:  Thank you for the Knowledge Base Article.  I read the one on "Stitch Images Together with the VDM" and recognized where SSG0484 got his original algorithm (he copied the Example, but didn't understand how to use it).

 

I was thinking how I'd stitch a collection of Images whose order was unknown but which I "knew" formed a complete picture.  I came up with the following (possibly inefficient) algorithm:

  • Make a Grayscale copy of the Images so I don't have to worry about "color".
  • Loop:
    • Take an Image as the Test Image
    • For all the remaining Images, try to put it to the right, below, to the left, and above the Test Image.  See if it "fits" by testing if adjoining pixel row/column values (row for above/below, column for left/right) have "similar" Gray values.  If it "fits", record its position with respect to the Test Image.  Continue until you have either 4 "neighbors" or run out of remaining Images.  
  • Go back and "fill in the blanks".  For example, if you find Image 5 is to the right of Image 1, when you get around to testing Image 5, you'll only test Images 6 on against it, so in this step, you say "If 5 is to the right of 1, then 1 is to the left of 5".
  • Find the Image that has nothing to the left or above,  This goes in position 0, 0.  Fill out the 0 row by adding its right neighbors.
  • Now fill out the remaining rows by starting with the Image below the Image at the start of the previous row.
  • Once all the Images are identified, replace them with their Colored counterparts.

Bob Schor

0 Kudos
Message 6 of 8
(3,142 Views)

Bob, your approach sounds totally reasonable.

 

The most interesting part is the "fitting the most similar"  part:

 


@Bob_Schor wrote: [...]
    • For all the remaining Images, try to put it to the right, below, to the left, and above the Test Image.  See if it "fits" by testing if adjoining pixel row/column values (row for above/below, column for left/right) have "similar" Gray values. 

I wonder if this can be achieved with a 2d cross correlation

 

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

Interesting topic.

 

If the camera is always a fixed distance from the object, and fixed orientation (like on a microscope, where the target is only making movements in X,Y) then stitching images is a much smaller problem. as it only takes XY translation of the images, looking for regions of overlap.

 

If the camera or object has moved, (or zoomed), or can have any degree of rotational movement, then something like the mentioned SIFT algorithm is required. This is because each image is now a 2 flattened version of a 3d model whos model view matrix has just changed. Pixel values are affected by scale and skew from rotation and translation.

 

Rebuilding 3d topographic models from only pictures can be quite good fun. Its called photogrammetry if you haven't encountered it before.

 

https://en.wikipedia.org/wiki/Photogrammetry

 

0xDEAD

0 Kudos
Message 8 of 8
(3,122 Views)