Code Monkey home page Code Monkey logo

apap-image-stitching's Introduction

As-Projective-As-Possible Image Stitching with Moving DLT


2020.12.28. ~ 2021.01.03.

Local-Homography warping

This program takes a list of images and performs stitching recursively.

This is a re-implementation with Python.

Official Matlab Code here: https://cs.adelaide.edu.au/~tjchin/apap/

1. Target Research Paper

The research paper: https://cs.adelaide.edu.au/~tjchin/apap/files/mdlt.pdf

Zaragoza, Julio, et al. "As-projective-as-possible image stitching with moving DLT." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2013.

Figure1

2. Dependencies

python == 3.8.5

numpy == 1.19.2

opencv-python == 4.4.0.46

opencv-contrib-python == 4.4.0.46

pillow == 8.0.1

tqdm == 4.50.2

argparse
  • Editor: PyCharm

3. Quick Start

Windows User

  • unzip demo_bat.zip.
  • run demo.bat files on terminal.

Linux User

  • unzip demo_sh.zip.
  • run demo.sh files on terminal.

You can give various types of options, check out "option.py". The "demo"s are tutorials.

4. Pipeline

  1. Image Loading
  2. Grayscaling & SIFT(OpenCV)
  3. Brute-Force Matching
  4. RANSAC
  5. Global-Homography Estimating & Final Size Extracting
  6. Local-Homography Estimating
  7. Superpixel Warping
  8. Uniform Blending (50:50)

5. Why do stitching recursively?

  • If stitching is performed sequentially from the left, the picture is excessively oriented to one side. In that case, it becomes difficult to estimate the correct homography.
  • APAP doesn't consider perspective distortion of multiple image stitching.
  • Recursive Stitching:

Recursive

  • Sequential Stitching:

    figure3

  • In addition, if the size of the input image is too small, it is difficult to extract feature points, so that an incorrect homography may be estimated.

6. References

code

  1. https://github.com/lxlscut/APAP_S
  2. https://github.com/fredzzhang/Normalized-Eight-Point-Algorithm
  3. https://cs.adelaide.edu.au/~tjchin/apap/#Source

demo images

  1. https://github.com/daeyun/Image-Stitching
  2. https://github.com/opencv/opencv_extra
  3. https://www.pyimagesearch.com/2018/12/17/image-stitching-with-opencv-and-python/

thanks.

7. Optimization

There is room for optimization in the local warping algorithm by using numpy library. (operation speed)

8. Author

Dae-Young Song

Undergraduate student, Department of Electronic Engineering, Chungnam National University

[Github]EadCat (Dae-Young Song) (github.com)

apap-image-stitching's People

Contributors

eadcat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

apap-image-stitching's Issues

there r something i cannot understand

i am read your excellent code of APAP. but i found the (std_x and std_y) are the same in the red box I painted。could u please tell
me sth about that? thanks

image

ValueError: Sample larger than population or is negative

Thanks for your work! when I run the code in some samples, it will get the error: 'ValueError: Sample larger than population or is negative'. The last code executed is ‘final_src, final_dst = ransac.thread(src_match, dst_match, self.opt.ransac_max)’. Could you please give me a solution? Thanks you very much.

Questions about warp_local

hello, I have a questions about warp_local

for i in tqdm(range(self.final_height)) if progress else range(self.final_height): m = np.where(i < mesh_h)[0][0] for j in range(self.final_width): n = np.where(j < mesh_w)[0][0] homography = np.linalg.inv(local_homography[m-1, n-1, :]) x, y = j - self.offset_x, i - self.offset_y source_pts = np.array([x, y, 1]) target_pts = self.warp_coordinate_estimate(source_pts, homography) if 0 < target_pts[0] < ori_w and 0 < target_pts[1] < ori_h: warped_img[i, j, :] = ori_img[int(target_pts[1]), int(target_pts[0]), :]

The local_h is obtained by meshing the src, but in the end, it is obtained by reverse warp the mesh of the image of the large canvas, 1. Is this my misunderstanding? 2. Is this reasonable if I understand correctly?

please Help me !

Hi, it's a nice code.
I am a beginner who is learning image-stitching.
I don't know how to use the code to calculate the RMSE of image1 and image2.
Could you please write it?
Thanks you very much.
image

help !!!

Hi, it's a nice code.
I am a beginner who is learning image-stitching.
I don't know how to use the code to calculate the RMSE of image1 and image2.
Could you please write it?
Thanks you very much.
image

question about Decay weights

Hello! Thanks for your work!

 weight = np.exp(-(np.sqrt(dist[:, 0] ** 2 + dist[:, 1] ** 2) * inverse_sigma))

Is there an extra np.sqrt() here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.