Giter VIP home page Giter VIP logo

delicate-jerk / image-overlaying-prespective Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.46 MB

Perform perspective warping and image fusion in Python using OpenCV and NumPy. Select four points on the base image to define the region where the subject image will be warped and fused. The script creates a fused image and saves it as Final_Output.png. ๐Ÿ–ผ๏ธ๐ŸŒŒ๐Ÿ”ฎ

Python 100.00%
image numpy opencv python swap

image-overlaying-prespective's Introduction

Perspective Warping and Image Fusion ๐ŸŒŒ๐Ÿ”ฎ

This Python script allows you to perform perspective warping and image fusion between two images. It enables you to select four points on the base image, and then it warps and fuses the subject image onto the selected region of the base image. ๐Ÿ–ผ๏ธ๐Ÿ”

Prerequisites ๐Ÿ› ๏ธ๐Ÿ”ง

To run this script, you need to have the following libraries installed:

  • OpenCV (cv2) ๐Ÿ“ธ
  • NumPy ๐Ÿงฎ

You can install the required libraries using pip:

Usage ๐Ÿš€๐Ÿ“

  1. Clone or download the repository. ๐Ÿ“ฅ

  2. Navigate to the project directory. ๐Ÿ“‚

  3. Run the Python script with the required arguments:

Selecting the corner points
Every time you click on a point, the chosen point is highlighted using a red dot as shown below.

Output :

Usage :

To run without debug enabled :-
python main.py --base_img base_img.jpg --subject_img subject.jpg

To run with debug enabled :-
python main.py --base_img base_img.jpg --subject_img subject.jpg --debug True

Enabling debug would allow you to visualize the intermediate masks and processed images so that you can better analyze where you're going wrong and remedy the problem accordingly.

Notes ๐Ÿ“๐Ÿšฉ

  • Make sure the selected points form a convex polygon. Otherwise, the script may not produce the desired results. ๐ŸงฉโŒ

  • The subject image will be scaled to fit the selected region on the base image. The aspect ratio of the subject image may be distorted if the selected region is not a parallelogram. ๐Ÿ”๐Ÿ”„๐Ÿ”ฎ

  • The script saves the final fused image as Final_Output.png in the project directory. ๐Ÿ’พ๐Ÿ’ผ


Please make sure to include this README.md file with your project so that users can understand how to use the script effectively. ๐Ÿ“๐Ÿ†’

Do let me know if you face any issues. I'll do my best to help :)
Happy Learning People ! Keep chasing your dreams ! โญ๏ธ

image-overlaying-prespective's People

Contributors

delicate-jerk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.