0

this is definitely a simple question but I have a mental block and can't put two and two together.

I want to convert this:

cv::Point2f p[4];

to a python equivalent. right now I am using:

q = [(0,0)]*4

Is this correct? or do I need to mimic the struct?

This seems to beworking in terms of being compatible with the usual convention of storing points, however im running into this error "new style getargs format but argument is not a tuple"

1
  • Did you run your code and check the list q? Commented Oct 9, 2014 at 3:21

2 Answers 2

1

Seems new style getargs format but argument is not a tuple is an error that happens when you pass a number or other object when the library expects a tuple. So I'd wager you have a bug elsewhere, unrelated to this struct.

Sign up to request clarification or add additional context in comments.

1 Comment

yeah it was just confusing to debug but it turns out the tuple i needed was nested
0

ok silly answer, and if anyone is looking for this without debugging for another hour without knowing what to look for, the point data are nested inside each array element of q

q = [(0,0)]*4
q[0] = corners[0]
q[0][0] is needed to reference data pulled from here

to create point: ( q[0][0][0] , q[0][0][1] )

EDIT: this is poor form and I find the following is cleaner

q = corners[[idx0, idx1, idx2, ...]] # for q of size 1xN where N = length(corners) 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.