Skip to content

ZhangYH-999/APAP-Image-Stitching

Repository files navigation

APAP-Image-Stitching

the APAP image stitching algorithm in python,

requirement: OpenCV 3.4.2.16(important), numpy , scikit

image-20220929151230141image-20220929151235342

image-20220929151239532

Image Stitching

1. SIFT

through SIFT algorithm, finding feature points of an image on different scale spaces and matching feature points

imgimg

2. RANSAC

The RANSAC algorithm correctly classifies "inner" and "outer" points in a set of data containing "outer" points. (red points: outer, yellow points: inner)

imgimg

3. Moving DLT

The general flow of the APAP algorithm is as follows:

  1. A global homography matrix is calculated using DLT and SVD to predict the size of the panoramic image.

  2. Divide the target image with a fixed grid, calculate the Euclidean distance and weight between each grid centroid and each feature point in the target image, construct the matrix by Moving DTL, and use SVD decomposition to find the local homography matrix of the current grid.

  3. Use the local homography matrix to map the target image into the panoramic canvas to obtain the APAP stitched image.

image-20220929144842818

Image Blending

Seam line fusion algorithm, which calculates the energy value of each pixel in the image using energy function, then finds the seam line with the lowest cumulative energy value using dynamic programming algorithm, finally fuses the two images by feathering the seams.

image-20220929144944115

image-20220929145001505

image-20220929145009436

Example:

example 1:

image-20220929150255166image-20220929150259689

image-20220929150305422

example 2:

image-20220929150504348image-20220929150513919

image-20220929150519295

Document Intro

main.py: run the program to stitch two images

constant.py: define some parameters, like the original images file path

seam.py: find the seam line by DP algorithm

matcher.py: matcher to detect and match the feature points

About

the APAP image stitching algorithm in python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages