Ask Your Question

avemprala's profile - activity

2012-11-02 02:00:36 -0600 received badge  Self-Learner (source)
2012-11-01 21:51:01 -0600 answered a question Problem with Stitching on iOS 6

More trial and error has led me to a solution. It seems to be a problem with OpenCV 2.4.2, however, it seems resolved in OpenCV 2.4.3-rc.

My steps, in a nutshell,

  1. The problem does seem to be related to the binary incompatibility flags for the virtual destructor methods.
  2. I had to download 2.4.3 release candidate from Github and compile per the Readme instructions in the ios/ folder. (If you're on Mac OSX, make sure you're running the right version of CMake)
  3. Modify the build_framework.py script to consume the output of step 2 to build opencv2.framework (the original script was expecting the library binaries and headers to be in different paths). Specifically, I just used put_framework_together(src,dest) and hardcoded the paths to the binaries and headers.
  4. Followed the library linking steps in the iOS instructions to add the framework to my Xcode project.
2012-10-26 09:12:19 -0600 commented question Problem with Stitching on iOS 6

Yes, I'm trying to get it to work for the iOS simulator.

2012-10-26 03:13:34 -0600 received badge  Student (source)
2012-10-25 19:17:22 -0600 answered a question iOS build and example

I've been able to make some progress by using the pre-built libraries (available on the OpenCV download page) for iOS. There's also an example code here: http://docs.opencv.org/doc/tutorials/ios/table_of_content_ios/table_of_content_ios.html

2012-10-24 18:16:04 -0600 received badge  Editor (source)
2012-10-24 18:14:58 -0600 asked a question Problem with Stitching on iOS 6

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);

}

I'm pretty new to OpenCV so I'm not sure if I'm using the APIs incorrectly or if there's something else at play. I should note that commenting out the call to stitcher.stitch() removes the linker error, so it has something to do with that method. I noticed that the destructors its complaining about have these macro settings (in core.hpp). Not sure what those mean, but could they be a factor?

#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
    virtual ~_InputArray();
#endif

#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
    virtual ~_OutputArray();
#endif

Appreciate any and all the help!

Thanks, Ani

UPDATE: I'm still having trouble with this. I've tried changing the target to iOS device, but I still get the same error for armv7 architecture. Any ideas?

Ld /Users/aniv/Library/Developer/Xcode/DerivedData/HelloOpenCV-fgbktrcekkodywhgrueujeajztog/Build/Intermediates/HelloOpenCV.build/Debug-iphoneos/HelloOpenCV.build/Objects-normal/armv7/HelloOpenCV normal armv7
    cd /Users/aniv/Dev/HelloOpenCV
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -L/Users/aniv/Library/Developer/Xcode/DerivedData/HelloOpenCV-fgbktrcekkodywhgrueujeajztog/Build/Products/Debug-iphoneos -F/Users/aniv/Library/Developer/Xcode/DerivedData/HelloOpenCV-fgbktrcekkodywhgrueujeajztog/Build/Products/Debug-iphoneos -F/Users/aniv/Dev/HelloOpenCV/../opencv/ios -F/Users/aniv/Dev/HelloOpenCV/HelloOpenCV -filelist /Users/aniv/Library/Developer/Xcode/DerivedData/HelloOpenCV-fgbktrcekkodywhgrueujeajztog/Build/Intermediates/HelloOpenCV.build/Debug-iphoneos/HelloOpenCV.build/Objects-normal/armv7/HelloOpenCV.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -stdlib=libstdc++ -miphoneos-version-min=6.0 -framework opencv2 -framework AVFoundation -framework ImageIO -lz -framework CoreMedia -framework CoreVideo -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/aniv/Library/Developer/Xcode/DerivedData/HelloOpenCV-fgbktrcekkodywhgrueujeajztog/Build/Intermediates/HelloOpenCV.build/Debug-iphoneos/HelloOpenCV.build/Objects-normal/armv7/HelloOpenCV

Undefined symbols for architecture armv7:
  "cv::_OutputArray::~_OutputArray()", referenced from:
      -[ViewController viewDidLoad] in ViewController.o
  "cv::_InputArray::~_InputArray()", referenced from:
      -[ViewController viewDidLoad] in ViewController.o
ld: symbol(s) not ...
(more)