Is there a better approach to stitch images if they are linearly spaced

asked 2020-07-24 07:20:05 -0500

Sfeeeen gravatar image

updated 2020-07-24 10:31:57 -0500

My goal is to 'scan' an object. To achieve this I hacked into my 3Dprinter and made a certain automation so that the printhead moves to grid positions who are lineairly spaced in the x and y position. The z position is a fixed height. My smartphone is attached to the printhead and takes a picture at each position.

All is achieved throughout python and after capturing the images I would like to stitch them to one picture in order to counteract distortion in the x- and y-axis.

I defined a 5x5 grid. So there were 25 coordinates where my printer would move to and take a picture.
first row of images:

image description image description image description image description image description

final result:

image description

At the moment I tried to use OpenCV's stitch method as so:

stitcher = cv2.Stitcher_create(mode = 1)

(status, stitched) = stitcher.stitch(images)

But the result is not so good.

I was wondering if there would be a better perhaps simpeler way to stitch these images. Because the opencv stitcher class tries to find features in order to find overlaps in the pictures but maybe this isn't necessary in my case because of the info I got extra: I know that the pictures are spaced linearly and I know the amount of spacing. Any suggestions?

edit retag flag offensive close merge delete

Comments

1

please put some example images here, not on some dropbox (done ;)

also please clarify: are the images you take really 5x5 pixels, or is that some "offset" ? i cannot imagine, how you could stitch such small patches, given that ORB keypoints already work on a 31x31 patch

berak gravatar imageberak ( 2020-07-24 07:36:33 -0500 )edit
1

You are right, I changed my post and added some! :)

I explained myself incorrectly: I defined a grid of 5x5 so there were 25 coordinates where my printer would move to and take a picture, the pictures were 3120x4160 but I downscaled them to 312x416

Sfeeeen gravatar imageSfeeeen ( 2020-07-24 07:48:51 -0500 )edit
1

hehe, right , and thanks for downscaling them to show here ;)

berak gravatar imageberak ( 2020-07-24 07:55:00 -0500 )edit