Closed GoogleCodeExporter closed 9 years ago
Which version of OpenCV are you using? PyOpenCV is not compatible with the
current version in WG's svn repository. It is only compatible with OpenCV 2.1
released in April.
Cheers,
Minh-Tri
Original comment by pmtri80@gmail.com
on 9 Aug 2010 at 7:25
Thanks for your response. I am using the opencv installation from macports
which is 2.0.0. I will soon try the 2.1 april release and report back.
Original comment by aaron.ba...@gmail.com
on 9 Aug 2010 at 8:38
Alright everything compiles just fine now, using opencv 2.1. However I am
getting a seg fault when importing pyopencv, similar to the other issue on this
board trying to us pyopencv on mac. Here is a stack trace, any thoughts?
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 ??? 0000000000 0 + 0
1 pyopencvext.so 0x02032f43
__static_initialization_and_destruction_0(int, int) + 131 (ndarray.cpp:791)
2 dyld 0x8fe0ed6d
ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 235
3 dyld 0x8fe0d31e
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned
int) + 246
4 dyld 0x8fe0d3d1
ImageLoader::runInitializers(ImageLoader::LinkContext const&) + 61
5 dyld 0x8fe0200b
dyld::runInitializers(ImageLoader*) + 34
6 dyld 0x8fe0b299 dlopen + 558
7 libSystem.B.dylib 0x94957068 dlopen + 66
8 org.python.python 0x000adca8 _PyImport_GetDynLoadFunc + 462
9 org.python.python 0x0009d9d3 _PyImport_LoadDynamicModule + 118
10 org.python.python 0x00099402 PyImport_GetImporter + 535
11 org.python.python 0x0008b372 PyEval_EvalFrameEx + 16375
12 org.python.python 0x0008b4d5 PyEval_EvalFrameEx + 16730
13 org.python.python 0x0008cf64 PyEval_EvalCodeEx + 1720
14 org.python.python 0x0008d009 PyEval_EvalCode + 87
15 org.python.python 0x0009a532 PyImport_ExecCodeModuleEx + 240
16 org.python.python 0x000c6582 initzipimport + 6643
17 org.python.python 0x0000c700 PyObject_Call + 101
18 org.python.python 0x0000cc8f PyObject_CallMethodObjArgs + 257
19 org.python.python 0x0000effa PyObject_CallMethod + 203
20 org.python.python 0x0009c1b8 _PyImport_FindModule + 1120
21 org.python.python 0x0009c87f PyImport_ReloadModule + 1392
22 org.python.python 0x0009ccd7 PyImport_ReloadModule + 2504
23 org.python.python 0x0009d285 PyImport_ImportModuleLevel + 1167
24 org.python.python 0x0008577f _PyBuiltin_Init + 14665
25 org.python.python 0x0000c700 PyObject_Call + 101
26 org.python.python 0x0008677a PyEval_CallObjectWithKeywords +
171
27 org.python.python 0x0008a748 PyEval_EvalFrameEx + 13261
28 org.python.python 0x0008cf64 PyEval_EvalCodeEx + 1720
29 org.python.python 0x0008d009 PyEval_EvalCode + 87
30 org.python.python 0x0009a532 PyImport_ExecCodeModuleEx + 240
31 org.python.python 0x000c6582 initzipimport + 6643
32 org.python.python 0x0000c700 PyObject_Call + 101
33 org.python.python 0x0000cc8f PyObject_CallMethodObjArgs + 257
34 org.python.python 0x0000effa PyObject_CallMethod + 203
35 org.python.python 0x0009c1b8 _PyImport_FindModule + 1120
36 org.python.python 0x0009c87f PyImport_ReloadModule + 1392
37 org.python.python 0x0009ccd7 PyImport_ReloadModule + 2504
38 org.python.python 0x0009d285 PyImport_ImportModuleLevel + 1167
39 org.python.python 0x0008577f _PyBuiltin_Init + 14665
40 org.python.python 0x0000c700 PyObject_Call + 101
41 org.python.python 0x0008677a PyEval_CallObjectWithKeywords +
171
42 org.python.python 0x0008a748 PyEval_EvalFrameEx + 13261
43 org.python.python 0x0008cf64 PyEval_EvalCodeEx + 1720
44 org.python.python 0x0008d009 PyEval_EvalCode + 87
45 org.python.python 0x0009a532 PyImport_ExecCodeModuleEx + 240
46 org.python.python 0x000c6582 initzipimport + 6643
47 org.python.python 0x0000c700 PyObject_Call + 101
48 org.python.python 0x0000cc8f PyObject_CallMethodObjArgs + 257
49 org.python.python 0x0000effa PyObject_CallMethod + 203
50 org.python.python 0x0009c1b8 _PyImport_FindModule + 1120
51 org.python.python 0x0009c87f PyImport_ReloadModule + 1392
52 org.python.python 0x0009ccd7 PyImport_ReloadModule + 2504
53 org.python.python 0x0009d285 PyImport_ImportModuleLevel + 1167
54 org.python.python 0x0008577f _PyBuiltin_Init + 14665
55 org.python.python 0x0000c700 PyObject_Call + 101
56 org.python.python 0x0008677a PyEval_CallObjectWithKeywords +
171
57 org.python.python 0x0008a748 PyEval_EvalFrameEx + 13261
58 org.python.python 0x0008cf64 PyEval_EvalCodeEx + 1720
59 org.python.python 0x0008d009 PyEval_EvalCode + 87
60 org.python.python 0x000a40bb Py_CompileString + 111
61 org.python.python 0x000a6140 PyRun_InteractiveOneFlags + 483
62 org.python.python 0x000a628e PyRun_InteractiveLoopFlags + 216
63 org.python.python 0x000a6317 PyRun_AnyFileExFlags + 85
64 org.python.python 0x000b3168 Py_Main + 3074
65 org.python.python.app 0x00001eb5 start + 53
Original comment by aaron.ba...@gmail.com
on 11 Aug 2010 at 5:00
Now it's getting complicated because I don't have a Mac OS platform to test
with. By the way, have you checked out this page:
http://code.google.com/p/pyopencv/wiki/Installation_OpenCV
to see if your OpenCV library is usable by PyOpenCV?
Cheers,
Minh-Tri
Original comment by pmtri80@gmail.com
on 11 Aug 2010 at 8:13
I used gdb to track down the line of code where the segfault occurs.
pyopencv-2.1.0.wr1.1.0/pyopencv/pyopencvext/numpy_include/__multiarray_api.h
line: 1004
st = PyArray_GetEndianness();
which seems to be a numpy function. As far as I can tell numpy is installed
correctly, I can do an import numpy inside of python.
What do you think? Any chance you could write a sample program that uses
PyArray_GetEndianness(), I am unsure how to build and and link against numpy.
It would be cool to get pyopencv working on the mac platform.
Original comment by aaron.ba...@gmail.com
on 12 Aug 2010 at 2:51
Alright, I simply removed the offending line
st = PyArray_GetEndianness();
and replaced it with
st = NPY_CPU_LITTLE;
for my intel macbook. I am now able to run this demo code just fine.
from pyopencv import *
img = imread('people.jpg')
hog = HOGDescriptor()
hog.setSVMDetector(HOGDescriptor.getDefaultPeopleDetector())
for r in hog.detectMultiScale(img, 0, Size(8,8), Size(24,16), 1.05, 2):
r.x += round(r.width*0.1)
r.y += round(r.height*0.1)
r.width = round(r.width*0.8)
r.height = round(r.height*0.8)
rectangle(img, r.tl(), r.br(), Scalar(0,255,0), 1)
namedWindow("people detector", 1)
imshow("people detector", img)
waitKey(0)
Original comment by aaron.ba...@gmail.com
on 12 Aug 2010 at 5:39
Original comment by pmtri80@gmail.com
on 13 Aug 2010 at 12:11
I'd like to close this issue. Please don't hesitate to open a new issue if the
problem persists.
Cheers,
Minh-Tri
Original comment by pmtri80@gmail.com
on 27 Aug 2010 at 7:22
Original issue reported on code.google.com by
aaron.ba...@gmail.com
on 9 Aug 2010 at 6:44