簡體   English   中英

OpenCV拼接,C ++-未處理的異常

[英]OpenCV Stitching, C++ - Unhandled exception

我試圖將三個圖像縫合在一起。 為此,我選擇了OpenCV 2.4.10和Microsoft Visual C ++ 2010 Express。
讀取時圖片的大小為1500x1500px,位於CV_8UC3中。
我正在為32bit進行構建,並且已經在OpenCV中進行了其他一些操作,因此我猜項目是使用路徑等正確設置的。

奇怪的是,我得到這個錯誤只是偶爾 ,且僅當我試圖縫合兩個以上的圖像

這里的錯誤信息:

Unhandled exception at 0x5841dcaa in Stitching Test.exe: 0xC0000005: Access violation reading location 0x00000004.

之后,我自動進入“ Chores.cpp”的第99行或“ TaskCollection.cpp”的第189行,所以我認為這就是錯誤的根源。 (路徑C:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ VC \\ crt \\ src)

這里的代碼:

#include <iostream>

//OPENCV
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
//OPENCV STITCHING
#include <opencv2\stitching\stitcher.hpp>

using namespace std;
using namespace cv;

int main(){
    Mat panoramaImage;
    vector<Mat> inputImages;

    inputImages.push_back(imread("../../V1.bmp"));
    inputImages.push_back(imread("../../V2.bmp"));
    inputImages.push_back(imread("../../V3.bmp"));

    Stitcher stitcher = Stitcher::createDefault();
    Stitcher::Status stitcherStatus = stitcher.stitch(inputImages, panoramaImage);

    imshow("Stitching Result", panoramaImage); 
    waitKey(0);

    return 0;
}

有人有建議嗎?

問題已解決-我發現自己有“ _DEBUG;” 在發行版上運行時在我的預處理程序定義中。 仍然很奇怪,錯誤有時只發生...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM