blends images using three different methods
Project description
tile_stitch
(this was a university submission project)
Package implements methods for image dissection into tiles and their recomposition with three different stitching method.
The three implemented methods at the moment:
- min
- max
- multiband
min and max behaves similarly, when there is an overlap a max or min function is applied to the overlapping area, this way each color channel is compared on a pixel level and a max or min value is used per channel for the final image.
In multiband mode the module uses this implementation https://github.com/cynricfu/multi-band-blending
Blending example
image 1 | image 2 |
minimum | maximum | multiband |
Installing requirements
- python >= 3
- numpy==2.1.0
- opencv-python==4.10.0.84
python3 -m pip install numpy opencv-python
Installing tile_stitch package
from PyPI repoisitory
python3 -m pip install tile_stitch
or from this git pulled repo (requires setuptools)
python3 setup.py sdist bdist_wheel
python3 -m pip install .
Usage example
As a module
python3 -m tile_stitch -s exampleimages/ll.png -f exampleimages/rr.png -o 100 -m multiband -r result.png
or source code, excerpt from main
import tile_stitch
import cv2
img1 = cv2.imread('img1.png')
img2 = cv2.imread('img2.png')
overlap_w = 20 #20px overlap
bounds = tile_stitch.calculate_bounds([img1.shape[0],img1.shape[1],img1.shape[2]],[int(img1.shape[0]/2)+overlap_w,int(img1.shape[1]/2)+overlap_w,img1.shape[2]],[overlap_w,overlap_w,0])
tiles1 = tile_stitch.tile(img1,bounds) # tiles from img1
tiles2 = tile_stitch.tile(img2,bounds) # tiles from img2
tiles = [tiles1[0], tiles2[1], tiles2[2], tiles1[3]] # combined into one array
result = tile_stitch.stitch(tiles, bounds, stitch_type='multiband')
cv2.imwrite('result', result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tile_stitch-0.0.0.tar.gz
.
File metadata
- Download URL: tile_stitch-0.0.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0372083f04801903c5e75edd2d640b49892cfe584ea0fdff9a8f69603cefffe9 |
|
MD5 | 65a49198b4a767ad05e5d23edef65deb |
|
BLAKE2b-256 | 8947424007a7479333215164734a15d2f540ac1f84fcf11daab57a719fc8f286 |
File details
Details for the file tile_stitch-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: tile_stitch-0.0.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 144e79de288e994edb538efa1b26f802ad161a5902360427736ec19abf2dd2ae |
|
MD5 | 4361ebbda5c8d64022cfaf03beef9a7c |
|
BLAKE2b-256 | 9042bfca77deaa6242dc92eb91ec049fef08b547d35bf20008907a297af162f8 |