Bossgaming099 / ctypes-opencv

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

RuntimeError in cvFindNextContour #39

Closed GoogleCodeExporter closed 8 years ago

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

Run the following code:

from opencv import cx as cv

im = cv.LoadImage("test.bmp") # simple test image, attached
bw = cv.CreateImage(cv.GetSize(im), cv.IPL_DEPTH_8U, 1)
cv.CvtColor(im, bw, cv.RGB2GRAY) # convert to 8-bit 1 channel for scanner
storage = cv.CreateMemStorage()
scanner = cv.StartFindContours(bw, storage)
cv.FindNextContour(scanner) # throws RuntimeError :(

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

FindNextContour should return null or the next contour. Instead, the
following exception occurs:

Traceback (most recent call last):
  File "C:\Documents and Settings\ckmacleod\Desktop\test.py", line 8, in
<module
>
    cv.FindNextContour(scanner)
  File "C:\Python26\lib\site-packages\opencv\cv.py", line 1200, in
cvFindNextCon
tour
    return pointee(_cvFindNextContour(scanner))
RuntimeError: ffi_prep_cif failed

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.

Original issue reported on code.google.com by ChrisM6794@gmail.com on 20 May 2009 at 7:40

Attachments:

GoogleCodeExporter commented 8 years ago
I can reproduce the error even with OpenCV 1.0.0. Thanks for having raised the 
issue.
I will investigate it asap. I'm a bit busy at the moment.

Minh-Tri

Original comment by pmtri80@gmail.com on 21 May 2009 at 12:43

GoogleCodeExporter commented 8 years ago
After fruitlessly attempting to patch this, I realized that as a workaround I 
could
use cvFindContours() instead, which does work. Interesting.

Original comment by ChrisM6794@gmail.com on 27 May 2009 at 3:51

GoogleCodeExporter commented 8 years ago
Thanks, ChrisM6794. Anyway, I will still try to fix the bug once I have 
finished my
current in-house project.

Minh-Tri

Original comment by pmtri80@gmail.com on 27 May 2009 at 4:16

GoogleCodeExporter commented 8 years ago
I have fixed the bug in the main trunk. Structure CvContourScanner was not 
wrapped
properly. Please let me know if it works on your end. Sorry for the delay.

Minh-Tri

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

GoogleCodeExporter commented 8 years ago
It is working here, thank you :)

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