Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Application of Geometric Transformation Sometimes, the transformation matrix T is not given to find this transformation matrix T you need 3 points on the

image text in transcribed
image text in transcribed
4. Application of Geometric Transformation Sometimes, the transformation matrix T is not given to find this transformation matrix T you need 3 points on the input image and corresponding points on the target image. Simply display the image in an OpenCV window and click the point that you want to know the coordinates of OpenCV window will show the coordinates in the lower left comer. Record these points information and the target locations of these points in two separted point shape atas pist and 2 Then transformation matrix can be found by the function eV2 getAfline Transform img - cv.inread("Your image.jpe,CV. IMREAD_COLOR) width, height, dim - img.shape ptsi - np.float32([[x1,1],[X2,72],[x3,y3]]> pts2 = np.float32([[xx',y1'], [x2,y2),[x3*,y3')) T = cv.getAffineTransform(ptsa,pts2) dst = cv.warpaffine(img.T. (width, height)) (2) Now consider a practical scenario where geometric transformation can be used to remove distortion. If you are given an distorted mage distorted pg This image is obviously has been through a series of geometric transformations However, you don't know the transformation matre Now based on the information given find three points from the distorted image that you know clearly their undistorted coordinates are, and record these corresponding coordinates In [11Record your code below cv.destroyallidindows() 4. Application of Geometric Transformation Sometimes, the transformation matrix T is not given. To find this transformation matre T. you need 3 points on the input image and contesponding points on the target image. Simply display the image in an OpenCV window and click the point that you want to know the coordinates of, OpenCV window will show the coordinates in the lower le comer. Record these points information and the target locations of these points in two separted point shape arraya plst and plu2 Then transformation matre can be found by the function 2.getAfline Transform ing - cv.inread("Your image.jpe',CV.IMREAD_COLOR) width, height, dining shape ptsi - np. float32(Etx,y),(x2,72), [x3,y3]]) pts2.ro.float32([[x2,42), [x2,ya'), [x3,73'))) t.cv.getAffinetransform(pts,pts2) dstv.warpaffine(ing. 1. (width, height) (2) Now comider a practical scarto where geometric transformation can be used to remove distortion you are given an distorted image ostorted po" This image is obviously has been through a series of geometric transformation. However, you don't know the transformation mart Now based on the information given in three points from the distorted image that you know clearly their undistorted coordinates are and record these corresponding coordinates In (11): Hecord your code below cw.destroyal icindows

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions