Skip to main content

A Python package for fast and robust Image Stitching

Project description

stitching

A Python package for fast and robust Image Stitching.

Based on opencv's stitching module and inspired by the stitching_detailed.py python command line tool.

inputs

result

Installation

Use pip to install stitching from PyPI.

pip install stitching

Usage

The command line interface (cli) is available after installation

stitch -h show the help

stitch * stitches all files in the current directory

stitch img_dir/IMG*.jpg stitches all files in the img_dir directory starting with "IMG" and ending with ".jpg"

stitch img1.jpg img2.jpg img3.jpg stitches the 3 explicit files of the current directory

Enable verbose mode with stitch * -v. This will create a folder where all intermediate results are stored so that you can find out where there are problems with your images, if any

You can also use the Stitcher class in your script

from stitching import Stitcher
stitcher = Stitcher()

Specify your custom settings as

stitcher = Stitcher(detector="sift", confidence_threshold=0.2)

or

settings = {"detector": "sift", "confidence_threshold": 0.2}
stitcher = Stitcher(**settings)

Create a Panorama from your Images:

  • from a list of filenames
panorama = stitcher.stitch(["img1.jpg", "img2.jpg", "img3.jpg"])
  • from a single item list with a wildcard
panorama = stitcher.stitch(["img?.jpg"])
  • from a list of already loaded images
panorama = stitcher.stitch([cv.imread("img1.jpg"), cv.imread("img2.jpg")])

The equivalent of the --affine cli parameter within the script is

from stitching import AffineStitcher
stitcher = AffineStitcher()
panorama = stitcher.stitch(...)

The equivalent of the -v/--verbose cli parameter within the script is

panorama = stitcher.stitch_verbose(...)

Questions

For questions please use our discussions. Please do not use our issue section for questions.

Contribute

Read through how to contribute for information on topics like finding and fixing bugs and improving / maintaining this package.

Tutorial

This package provides utility functions to deeply analyse what's happening behind the stitching. A tutorial was created as Jupyter Notebook. The preview is here.

You can e.g. visualize the RANSAC matches between the images or the seam lines where the images are blended:

matches1 matches2 seams1 seams2

Literature

This package was developed and used for our paper Automatic stitching of fragmented construction plans of hydraulic structures

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stitching-0.5.0.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stitching-0.5.0-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file stitching-0.5.0.tar.gz.

File metadata

  • Download URL: stitching-0.5.0.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for stitching-0.5.0.tar.gz
Algorithm Hash digest
SHA256 3a74fc5b5dafbc0fc18c34f7a920a1faeef979da82a56ee3a92bdd0903f555b2
MD5 1ca628d267b74c49d7d0d1f94c5afb00
BLAKE2b-256 52324c50dc746624c498015c2b3f10acceff2ccb5ac0ac01cf2f1c3e37062f25

See more details on using hashes here.

File details

Details for the file stitching-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: stitching-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for stitching-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be98d245277c16c5fafdba4050274675cce716fe58bb2652ad2bd18123de3b26
MD5 63c7e5fcd362848f6fcb181af7f81fe1
BLAKE2b-256 1861809efccacac113f8d5b90b52d68c27aa219d2ddaadddf5c69ee7535903cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page