Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.34 KB

README.md

File metadata and controls

37 lines (25 loc) · 1.34 KB

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.