The Panorama Stitcher script is a Python-based utility that enables the seamless stitching of a sequence of images to create a panoramic view. It utilizes the OpenCV library for image processing and provides optional cropping and salvaging functionalities to enhance the final stitched result. It will work even with unorganized and duplicated sequence of images.
- Introduction
- Table of Contents
- Features
- Requirements
- Installation
- API Usage
- Script Usage
- Options
- Examples
- Contributing
- License
- Acknowledgments
- Stitch multiple images together to create a panoramic view.
- Optional cropping and optimizing to remove black pixel outlines and enhance the visual quality.
- Command-line interface for easy execution and customization.
- Utilizes OpenCV for efficient image processing.
- Include API for ease of use
- Python 3.x
- OpenCV library
- Numpy library
- argparse library
- FastAPI library
- Pillow library
- Install the required libraries using the following command:
pip install opencv-python numpy argparse
- If you are using API, please install the required libraries using the following command:
pip install opencv-python numpy argparse fastapi uvicorn pillow
-
Clone or download this repository to your local machine.
-
Navigate to the API directory.
-
Launch the FastAPI app by executing the following command:
uvicorn pano_stitcher_api:app --host 0.0.0.0 --port 8000
-
Access the FastAPI documentation by navigating to
http://localhost:8000
in your web browser. -
Utilize the
/stitch_image
endpoint to upload images for stitching and processing. The script will return the stitched and processed image. -
You can share the API with someone else on the same network using
http://your-ipv4:8000
with your own IPv4
-
Clone or download this repository to your local machine.
-
Organize your input images in the same folder.
-
Navigate to the script directory.
-
Run the script with the following command:
python pano_stitcher.py -i 'input_folder_path' -o 'output_folder_path'
- To see more option with cropping, use
python pano_stitcher.py -h
-h
,--help
: Show help message and exit.-i INPUT
,--input INPUT
: Path to the folder containing the input images. Default:./images/real
.-o OUTPUT
,--output OUTPUT
: Path to the folder where output images should be saved. Default:./output
.-c
,--crop
: Use this flag to enable cropping and salvaging. By default, cropping is enabled.--no-crop
: Use this flag to disable cropping and salvaging. By default, cropping is enabled.
- Basic Stitching:
python pano_stitcher.py -i './input_images' -o './output_images'
- Stitching with Cropping Disabled:
python pano_stitcher.py -i './input_images' -o './output_images' --no-crop
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.
- OpenCV: https://opencv.org/
- FastAPI: https://fastapi.tiangolo.com/