Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7684355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:00:19+00:00 2026-05-31T19:00:19+00:00

Something appears to be afoul with getPerspectiveTransform in the python2 wrapper for opencv. For

  • 0

Something appears to be afoul with “getPerspectiveTransform” in the python2 wrapper for opencv. For starters, it takes two arguments instead of the expected three.

So instead of the first wrapper’s:

cv.GetPerspectiveTransform(source,destination,3x3mat)

It’s now:

cv2.getPerspectiveTransform(?,?)

If I try to put in two sets of four quad vert coordinates as the arguments like so:

cv2.getPerspectiveTransform(first_set_of_corners, second_set_of_corners)

it spits out the following error:

cv2.error: C:\slave\WinInstallerMegaPack\src\opencv\modules\imgproc\src\imgwarp.
cpp:3194: error: (-215) src.checkVector(2, CV_32F) == 4 && dst.checkVector(2, CV
_32F) == 4

If the checkVectors shouldn’t equal four (hence the “quad” in quadrangle) then I’m not certain what it wants from me. As with everything else in the python2 wrapper this feature is completely undocumented so I don’t know if it’s broken or, more likely, that I’m doing it wrong. Has anyone here managed to get this to work properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:00:20+00:00Added an answer on May 31, 2026 at 7:00 pm

    cv2.getPerspectiveTransform is not broken anyway.

    May be, your points are of not length 4 or they may not be float32 numbers.

    Try following :

    import cv2
    import numpy as np
    
    img = cv2.imread('1original.jpg',0)
    
    src = np.array([[50,50],[450,450],[70,420],[420,70]],np.float32)
    dst = np.array([[0,0],[299,299],[0,299],[299,0]],np.float32)
    
    ret = cv2.getPerspectiveTransform(src,dst)
    print ret
    

    Result is :

    [[  8.36097696e-01  -4.51944700e-02  -3.95451613e+01]
     [ -4.51944700e-02   8.36097696e-01  -3.95451613e+01]
     [  6.45161290e-05   6.45161290e-05   1.00000000e+00]]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

it appears if you have something like var my_var = {foo : bar}; in
Something is interrupting threads in my application. It appears to happen when the JVM
When Delphi (2006) goes quantum: I've got something that appears to be both a
It appears like something is stopping my errors from displaying normally an in ASP.NET
I am using matplotlib.pyplot.scatter to draw some simple scatter plot. However, something wrong appears
I was parsing a webpage but sometimes I copy something that appears to be
I am looking to implement something that appears to have shopping cart functionality, but
I'm seeing something that's got me stumped. Maybe you folks can advise. What appears
There appears to be something wrong with this code, each time its saying that
I don't know if I'm missing something obvious, but it appears that I'm unable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.