Bossgaming099 / ctypes-opencv

Automatically exported from code.google.com/p/ctypes-opencv
0 stars 0 forks source link

Iteration over CvMat raises TypeError #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Attempt to iterate over a CvMat, e.g.:

list(cvCreateMat(3, 3, CV_32FC3))

What is the expected output? What do you see instead?

I expect a list of the rows in the structure. Instead, TypeError is raised:

Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python26\lib\site-packages\opencv\cxcore.py", line 827, in __iter__
    yield cvGetRows(self, i, i+1)
TypeError: cvGetRows() takes at least 4 arguments (3 given)

What version of the product are you using? On what operating system?

ctypes-opencv 0.7.3
OpenCV 1.1.0
Python 2.6

Windows XP Professional SP3

Please provide any additional information below.

It seems to work as I expect if in cxcore.py line 827, I add "None" as the
second argument. This causes the second argument submat to be internally
created by cvGetRows. 

The same thing affects CvMat.colrange and possibly other places as well?

Original issue reported on code.google.com by ChrisM6794@gmail.com on 4 Jun 2009 at 6:19

GoogleCodeExporter commented 8 years ago
I have fixed the bug. Thanks, Chris.

Minh-Tri

Original comment by pmtri80@gmail.com on 17 Jun 2009 at 3:17