我在我的项目中使用工作演示中的 OpenCV 框架缺少一些小东西。
重现步骤:
从http://aptogo.co.uk/2011/09/opencv-framework-for-ios/下载示例应用程序
使用 Titan create --platform=iphone --type=module --dir= 创建一个新的 Titainum iOS 模块。--name=opencv --id=opencv
打开 XCode 项目,从 FaceTracker 应用程序和其他所需的框架中拖入 OpenCV 框架。
将 OTHER_LDFLAGS=$(inherited) -framework OpenCV 添加到 module.xcconfig
创建名为 OpencvView 和 OpencvViewProxy 的新 TiUIView 和 TiUIViewProxy 类。
在新的 OpencvView 类中,实例化一个使用 OpenCV 的 UIViewController。
该构建将构建 Titanium 模块,但是当我尝试运行模块测试工具时,我收到 OpenCV 对象的以下错误:
架构 i386 的未定义符号:“_CMSampleBufferGetImageBuffer”,引用自:-[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection:] in libopencv.a(VideoCaptureViewController.o) “_CMSampleBufferGetOutputPresentationTimeStamp”,引用自:-[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection:] libopencv.a(VideoCaptureViewController.o) "_CMTimeMake",引用自:-[VideoCaptureViewController createCaptureSessionForCamera:qualityPreset:grayscale:] in libopencv.a(VideoCaptureViewController.o) "_CVPixelBufferGetBaseAddress",引用自:-[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection: ] 在 libopencv.a(VideoCaptureViewController.o) "_CVPixelBufferGetBaseAddressOfPlane",引用自:-[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection:] in libopencv.a(VideoCaptureViewController.o) "_CVPixelBufferGetHeight",引用自:-[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection:] in libopencv.a(VideoCaptureViewController.o ) "_CVPixelBufferGetPixelFormatType",引用自:-[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection:] in libopencv.a(VideoCaptureViewController.o) "_CVPixelBufferGetWidth",引用自:-[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection:] in libopencv.a(VideoCaptureViewController .o) “_CVPixelBufferLockBaseAddress”,引用自:-[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection:] in libopencv.a(VideoCaptureViewController.o) "_CVPixelBufferUnlockBaseAddress",引用自: -[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection:] in libopencv.a(VideoCaptureViewController.o) "cv::_InputArray ::_InputArray(cv::Mat const&)",引用自:-[DemoVideoCaptureViewController processFrame:videoRect:videoOrientation:] in libopencv.a(DemoVideoCaptureViewController.o) "cv::_OutputArray::_OutputArray(cv::Mat&)",引用自:-[DemoVideoCaptureViewController processFrame:videoRect:videoOrientation:] in libopencv.a(DemoVideoCaptureViewController.o) "cv::CascadeClassifier::load(std::string const&)",引用自:-[DemoVideoCaptureViewController viewDidLoad] in libopencv.a(DemoVideoCaptureViewController.o) "cv::CascadeClassifier::CascadeClassifier()",引用自: -[DemoVideoCaptureViewController .cxx_construct] in libopencv.a(DemoVideoCaptureViewController.o) "cv::CascadeClassifier: :~CascadeClassifier()",引用自:-[DemoVideoCaptureViewController .cxx_destruct] in libopencv.a(DemoVideoCaptureViewController.o) "cv::Mat::deallocate()",引用自:-[VideoCaptureViewController captureOutput:didOutputSampleBuffer:fromConnection:]在 libopencv.a(VideoCaptureViewController.o) -[UIImage(UIImage_OpenCV) CVMat] 在 libopencv.a(UIImage+OpenCV.o) -[UIImage(UIImage_OpenCV) CVGrayscaleMat] 在 libopencv.a(UIImage+OpenCV.o) "cv: :Mat::create(int, int const*, int)",引用自:-[UIImage(UIImage_OpenCV) CVMat] in libopencv.a(UIImage+OpenCV.o) -[UIImage(UIImage_OpenCV) CVGrayscaleMat] in libopencv.a(UIImage+OpenCV.o) "cv::flip(cv:: _InputArray const&, cv::_OutputArray const&, int)",引用自:-[DemoVideoCaptureViewController processFrame:videoRect:videoOrientation:] in libopencv.a(DemoVideoCaptureViewController.o) "cv::resize(cv::_InputArray const&, cv::cv::resize(cv::_InputArray const&, cv::cv::resize(cv::_InputArray const&, cv::输出数组 const&, cv::Size, double, double, int)",引用自:-[DemoVideoCaptureViewController processFrame:videoRect:videoOrientation:] in libopencv.a(DemoVideoCaptureViewController.o) "cv::fastFree(void*)",引用自:-[VideoCaptureViewController captureOutput: didOutputSampleBuffer:fromConnection:] 在 libopencv.a(VideoCaptureViewController.o) -[UIImage(UIImage_OpenCV) CVMat] 在 libopencv.a(UIImage+OpenCV.o) -[UIImage(UIImage_OpenCV) CVGrayscaleMat] 在 libopencv.a(UIImage+OpenCV. o) "cv::transpose(cv::_InputArray const&, cv::_OutputArray const&)",引用自:-[DemoVideoCaptureViewController processFrame:videoRect:videoOrientation:] in libopencv.a(DemoVideoCaptureViewController.o) "_kCVPixelBufferPixelFormatTypeKey",引用自:-[VideoCaptureViewController createCaptureSessionForCamera:qualityPreset:grayscale:] in libopencv.a(VideoCaptureViewController.o) ld: 未找到架构 i386 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)