Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV + Swift 2 + CvVideoCameraDelegate

Hello guys,

I've been studying OpenCV for the last couple of weeks.

I'm developing a project using OpenCV 3, Swift 2, iOS 9. It needs real time camera image acquisition.

I've followed several tutorials in internet (even in japanese, using translator!). But I couldn't use the CvVideoCameraDelegate in the project :/

My Objective C++ wrapper header (called Camera.h) must implement the CvVideoCameraDelegate. But, to be able to know it, I need to include the file opencv2/videoio/cap_ios.h. The image below shows my project and this header file:

image description

My bridge file it only contains this wrapper header (called Camera.h).

image description

But, when I try to build, some errors occurs: Core.hpp/Base.hpp header must be compiled as C++; climits not found.

image description

This happens because the cap_ios.h is inside the .h header. If I don't use the delegate, and include the cap_ios.h only in the .mm, there is no problem.

Well, does anybody knows how to handle this?

Thanks for your support. If there is questions about the problem, please ask.