0

我想在 iOS 中拼接几张图片。所以我使用了openCV框架。这是我的代码。但我有错误..

/Volumes/WORK/Panogram/Panogram/Frameworks/OpenCV.framework/Headers/opencv2/stitching/warpers.hpp:46:10: 'detail/warpers.hpp' 文件未找到

我希望有人帮助我如何在 iOS 中使用 openCV 进行图像拼接。我认为我的框架有问题。如果有人和我做过类似的工作,请帮助我。

#import <OpenCV/opencv2/opencv.hpp>
#import "UIImage+OpenCV.h"
#import <OpenCV/opencv2/stitching/stitcher.hpp>

@interface TakePhotoViewController ()

@end

@implementation TakePhotoViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    UIImage* testImg1 = [UIImage imageNamed:@"002.jpg"];
    UIImage* testImg2 = [UIImage imageNamed:@"003.jpg"];

    cv::vector<cv::Mat> images;

    images.push_back([testImg1 CVMat]);
    images.push_back([testImg2 CVMat]);

    Stitcher stitcher = Stitcher::createDefault(YES);

    Stitcher::Status st1 = stitcher.stitch(images, imgResult);
    /////////add image to uiimageview
    UIImage *image=  [self UIImageFromCVMat:imgResult];
    imgView.image=image;

}
4

1 回答 1

0

我过去也有同样的问题。我只是在目录中创建了一个名为“detail”的文件夹,并将 warpers.hpp 复制到该文件夹​​中。您的系统可能在目录中没有“detail”文件夹,或者当它需要在文件夹中时,warpers.hpp 与 detail 文件夹位于同一目录中。

于 2012-12-16T21:45:24.540 回答