我在 Mac OS X 10.8.5 和 IOs 设备 Iphone5 IOs 是 IOs7.1 上运行 OpenCV 2.4.3 我正在尝试使用 cv::Mat 缝合(矢量和图像)来获取全景图像。
这是我用来进行检测和绘制边界框的代码。
cv::Mat stitch (vector<Mat>& images){
imgs = images;
Mat pano;
Stitcher stitcher = Stitcher::createDefault(try_use_gpu);
stitcher.setRegistrationResol(1); /// 0.6
stitcher.setSeamEstimationResol(1); /// 0.1
stitcher.setCompositingResol(1); //1
stitcher.setPanoConfidenceThresh(1); //1
stitcher.setWaveCorrection(true);
stitcher.setWaveCorrectKind(detail::WAVE_CORRECT_HORIZ);
Stitcher::Status status = stitcher.stitch(imgs, pano);
Stitcher::Status status1= stitcher.estimateTransform(imgs);
if (status != Stitcher::OK)
{
cout << "Can't stitch images, error code = " << int(status)<<"Estimate Transform :"<<int(status1) << endl;
}
return pano;
}
但是,当执行到达该行时。
Stitcher::Status status = stitcher.stitch(imgs, pano);
我收到错误消息,整个应用程序崩溃
OpenCV Error: Assertion failed (dsize.area() || (inv_scale_x > 0 && inv_scale_y > 0))in resize, file /Volumes/minijHome/Documents/xcode_mini/hillegass/advancedIOS/postCourse/openCV/clean-downloads/openCVgitClone/opencv/modules/imgproc/src/imgwarp.cpp, line 1726
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Volumes/minijHome/Documents/xcode_mini/hillegass/advancedIOS/postCourse/openCV/clean-downloads/openCVgitClone/opencv/modules/imgproc/src/imgwarp.cpp:1726: error: (-215) dsize.area() || (inv_scale_x > 0 && inv_scale_y > 0) in function resize
出了什么问题?我似乎无法从 gdb 或 lldb 输出中获得任何新信息。我正在用 Xcode5.1 和 IOs7.1 构建的代码编译,请给我建议。怎么了。。
谢谢