Hello folks!
I'm trying to get a small app going that stitches images together using OpenCV on iOS. I've started by including the pre-built OpenCV 2 framework in my iOS project and setting up appropriate references. However, when I try and initiate a stitch operation, I get these linker errors:
Undefined symbols for architecture i386: "cv::_InputArray::~_InputArray()", referenced from: -[ViewController viewDidLoad] in ViewController.o "cv::_OutputArray::~_OutputArray()", referenced from: -[ViewController viewDidLoad] in ViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here's what my view controller code looks like:
- (void)viewDidLoad
{
[super viewDidLoad];
UIImage* leftImage = [UIImage imageNamed:@"ridge-left.jpg"];
UIImage* rightImage = [UIImage imageNamed:@"ridge-right.jpg"];
UIImageView* testImageView = [[UIImageView alloc] initWithImage:leftImage];
[self.view addSubview:testImageView];
vector<Mat> images;
Mat leftMat = [leftImage toCVMat];
Mat rightMat = [rightImage toCVMat];
Mat panoramic;
images.push_back(leftMat); images.push_back(rightMat);
Stitcher stitcher = Stitcher::createDefault(false);
// stitcher.setWarper(new CylindricalWarper());
Stitcher::Status st = stitcher.stitch(images, panoramic);
}
Not quite sure what the issue is. I do notice that the destructors its complaining about have these macro settings (in core.hpp). Could that be a factor?
#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
virtual ~_InputArray();
#endif
#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
virtual ~_OutputArray();
#endif
Appreciate all the help!
Thanks, Ani