简体   繁体   中英

Calling cv::cuda::HOG from python

I need to access the cuda modules of opencv in C++ from python. I tried wrapping the c++ functions using Boost however I get the following error.

ImportError: ../build/lib.linux-x86_64-2.7/pyBoostHOG.so: undefined symbol: _ZN2cv4cuda6Stream4NullEv.

Is there any way by which I can access the opencv cuda modules from python? Thanks in advance..

I had the same error.

I figured out that I must include opencv2/core/cuda.hpp file (symbol _ZN2cv4cuda6Stream4NullEv reffers to: cv::cuda::Stream::Null()

But this doesn't solve the problem, because when I tried to make wrap thought swig and include these file, new error:

.../include/opencv2/core/cuda.hpp:317: Error: Syntax error in input(1).

is displayed. Compiling another program using cv::cuda::Stream::Null() cause not error.

I was facing the same error. And this is how I was compiling the .so file:

g++ `pkg-config opencv4 --cflags --libs` -fPIC -c flow.cpp
g++ -Wall -O3 -shared -o flow.so flow.o `pkg-config opencv4 --cflags --libs`

The error was resolved when I changed my make file to the following:

g++ `pkg-config opencv4 --cflags --libs` -fPIC -c flow.cpp
g++ -Wall -O3 -shared flow.o -o flow.so `pkg-config opencv4 --cflags --libs`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM