Compile with OpenCV 4.0
alyssaq opened this issue · 1 comments
alyssaq commented
docker run --name py3 --rm -it jjanzic/docker-python3-opencv bash
Must include -I/usr/local/include/opencv4
Eg gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.7m -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/include/opencv4 src/hat.cpp -o build/temp.linux-x86_64-3.7/src/hat.o
Current error:
In file included from src/stasm.h:58:0,
from src/hat.cpp:8:
src/misc.h:420:1: error: ‘CvScalar’ does not name a type
CvScalar ToCvColor(unsigned color);
^~~~~~~~
alyssaq commented
Nope. Couldnt import with OpenCV 4.0.1:
>>> import stasm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/alyssa/.virtualenvs/facemorpher3.7/lib/python3.7/site-packages/stasm/__init__.py", line 3, in <module>
from _stasm import __doc__
ImportError: dlopen(/Users/alyssa/.virtualenvs/facemorpher3.7/lib/python3.7/site-packages/_stasm.cpython-37m-darwin.so, 2): Symbol not found: __ZN2cv17CascadeClassifier4loadERKNS_6StringE
Referenced from: /Users/alyssa/.virtualenvs/facemorpher3.7/lib/python3.7/site-packages/_stasm.cpython-37m-darwin.so
Expected in: flat namespace
in /Users/alyssa/.virtualenvs/facemorpher3.7/lib/python3.7/site-packages/_stasm.cpython-37m-darwin.so
Python 3.7 with OpenCV 3.4.1 was OK.