Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up a Cinder project with the OpenCV Block

Tags:

c++

opencv

cinder

I'm trying to use the new OpenCV Block with Cinder 0.8.2. I used TinderBox to setup the project somewhere in my user directory and have just been trying to setup a basic video capture routine. I added the OpenCv Block as a group to the project.

cv::Mat input( toOcv( capture.getSurface() ) )

When I added this code I got the following errors

Undefined symbols:
  "cv::fastFree(void*)", referenced from:
      cv::Mat::release()    in ColourDanceApp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

I broke down the above code into

Surface frame; 
frame = mCap.getSurface(); 
cv::Mat matrix; 
matrix = toOcv( frame ); 
cv::Mat input( matrix );

And found I got this error at:

cv::Mat matrix; (and a whole bunch of errors)

Its been awhile since I've done any C++ but I'm concluding from this that its a project setup problem as the code it mostly taken from the OpenCV examples. The fact that it gets that far tells me that the Cinder path is good. Theres no help in under

like image 222
CpILL Avatar asked Oct 25 '22 22:10

CpILL


1 Answers

This is an old question but here is the solution

http://forum.libcinder.org/topic/how-to-use-cinderblocks-in-xcode

1) Set User Header Search Paths to:

"$(CINDER_PATH)/blocks/opencv/include"

2) Set Other Linker Flags to include the .a files you want to use. For example:

"$(CINDER_PATH)/blocks/opencv/lib/macosx/libopencv_core.a"

It works with latest version of Cinder downloaded from Github.

like image 55
Pier Avatar answered Nov 15 '22 05:11

Pier