【问题标题】:Stitch two images using openCV in iOS在 iOS 中使用 openCV 拼接两个图像
【发布时间】:2012-12-01 03:38:24
【问题描述】:

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

}

【问题讨论】:

    标签: iphone ios image opencv


    【解决方案1】:

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

    【讨论】:

    • 但我认为我的opencv框架不正确。如果你和我做过类似的工作,请给我正确的 opencv 框架和对你有用的示例代码。
    • 嘿,我需要一些帮助,你能给出解决方案吗?
    猜你喜欢
    • 2012-01-02
    • 1970-01-01
    • 2020-07-23
    • 2011-08-26
    • 2020-03-10
    • 2023-03-17
    • 2011-12-26
    • 2013-03-07
    • 2019-01-01
    相关资源
    最近更新 更多