Skip to content

A python script to get Perspective Transformed(birds eye view) version of an input image using OpenCV. This is analogous to the CamScanner select region feature.

Notifications You must be signed in to change notification settings

kushalchaudhari21/PerspectiveTransform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is an python script to get a perspective transformed version for given input image

The demo for the project can be found in folder demo.

Sample Invocation

In the terminal, in the project directory input the following to execute the script

python perspectiveTransform.py

executionCommand

Usage

1. Refer to the sample invocation section and run the program.

2. Next, a window pops up on the screen on which you can select 4 points in given sequence to select the region of interest(ROI).

selectPoints

3. Perspective transform function is written as:

def get_persp(image,pts):
        ippts = np.float32(pts)
        Map = cv2.getPerspectiveTransform(ippts,oppts)
        warped = cv2.warpPerspective(image, Map, (AR[1], AR[0]))
        return warped

4. After the execution, the output image is added in same directory.

Important Insights

  • Order in which points are selected can be changed using different value of pointIndex.
  • These points can be stored as annotations by exporting them into different file formats like csv.

About

A python script to get Perspective Transformed(birds eye view) version of an input image using OpenCV. This is analogous to the CamScanner select region feature.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages