Question: **In python using OpenCV, numpy and matplotlib** ***I need help with the code that transforms the image using the matrices below, not the actual answer

**In python using OpenCV, numpy and matplotlib**

***I need help with the code that transforms the image using the matrices below, not the actual answer to the question about what does each matrix do to the image***

Please Help with this question

h) Apply the following perspective transformations to image pixels (augmented vector:

[

1])

and obtain new pixel positions

[ x'

] from [

] = * [

1]

Display the resulting image.

1 = [ 2 0 0

0 1 0

0 0 1 ]

2 = [ 2 2 0

2 2 0

0 0 1]

3 = [1 0.2 0

0.2 1 0

0 0 1]

4 = [1.1 0.1 0

0.2 0.9 0

0.1 0.2 1]

Explain what does each transformation do?

*I keep getting an error using cv2.perspectiveTransform() to get the image points "cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\matmul.dispatch.cpp:550: error: (-215:Assertion failed) scn + 1 == m.cols in function 'cv::perspectiveTransform'

How do I properly get pixel positions from an image that I chose and transform the pixel positions into new pixel positions using the matrices shown?

I am new to python and openCV so any help is greatly appreciated!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!