我想在 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;
}