Using OpenCV library in your own project
The demo application which you can download from my repository is well configured to use these libraries. If you wanted to use OpenCV libraries on your own project, you should need to adding next configurations on it. You can see these settings on the Xcode project of this demo application.
- Add
libopencv_core.a
etc, from OpenCV lib directory for either simulators or devices. Actually Xcode doesn’t care which one is for devices or simulators at this point because it is selected by the library search path. - Add
Accelerate.framework
which is used internally from OpenCV library. - Select your active build target, then open the build tab in the info panel by Get Info menu.
-
- Add
-lstdc++
and -lz
to Other Linker Flags - Add path to OpenCV
include
directory to Header Search Paths for both simulators and devices. - Add path to OpenCV
lib
directory to Library Search Paths for both simulators and devices.
- Add
- (void)test
{
//
//
//
//
//
//
//
//
//
}
下面代码用来把RGBA的图像,转换成CvMat类型,用来进行特征值计算。
const int rows = 100, cols = 100;