Ask Your Question
0

mosaicing a sequence of overlapping images

asked 2016-04-24 23:48:06 -0600

epinux gravatar image

I'm trying to generate a mosaic from a sequence of overlapping images.

I thought that a possible approach could be to loop over each image, find matching points and mosaic the first 2 images, then use the resulting mosaic as input array and find the matching point with the next image... and so on until the last frame. Pseudo code:

def mosaicing(imagesequence):
    matchingpoints = {}
    #
    # imagesequence can be a list of numpy array
    # 
    mosaic=imagesequence[0]
    for i in imagesequence[1:]:
        xy = find_matching_points(mosaic, i)
        # xy could be a list of x and y values for the matching point between 2 arrays
        # something like: 
        # matchingpoints[image_12] = [  [[x1,y1],[x2,y2], ... [xn,yn]] ,
        #                               [[x1,y1],[x2,y2], ... [xn,yn]]  ]
        # where the first array stores the pixel position for the mathcing points in image_1    ,       
        # and the second  array stores the pixel position for the same points  in image_2     
        #                                         
        mosaic = imagestiching(mosaic, i, xy) 
        # where mosaic is the first image and "i" is the second image
    return mosaic

In my use-case each image has an overlap of ~40%, they are collected along a straight line path with minimal pitch/roll, so I guess a rigid affine transformation based on 2 or more matching points should work fine. I stored 4 images sample (png) at [1]

Have you any clue on how to do this using python and opencv? I'm looking for a solution to:

  1. detect matching point between 2 images (numpy nD arrays)

  2. apply matching point to the 2 arrays to generate a new one which can be then used as input to detect the other matching points with the next frame

[1] http://epinux.com/test_images/

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-04-25 04:57:22 -0600

There is a full stitching pipeline in OpenCV.

You can also have a look at the feature2d tutorials to implement a custom stitching approach (with a look at the stereoCalibration sample to have a clue). You should prefer the stitching pipeline, or a least have a look at it, to be sure you understand how it works before jumping on implementing your own. Googling the stitching methods could also be interesting.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-04-24 18:04:13 -0600

Seen: 2,114 times

Last updated: Apr 25 '16