我正在对两个图像进行拼接,并在调试时出现此错误(编译成功但运行时中断):
断言失败 ==CV_8Uc3> 在未知函数中。
这是代码:
int main(int argc, char ** argv)
{
    Mat im1=imread("panorama_image1.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    Mat im2=imread("panorama_image2.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    Mat result;
    vector<Mat> imgs;
    imgs.push_back(im1);
    imgs.push_back(im2);
    cv::Stitcher stitcher=cv::Stitcher::createDefault(false);
    stitcher.stitch(imgs,result);
    namedWindow("Mosaic", CV_WINDOW_AUTOSIZE);
    imshow("Mosaic",result);
    waitKey(0);
    return 0;
}
我无法在此代码中找到错误。并且链接器库是正确的(使用 D 版本,例如opencv_core244d.lib,opencv_stitching244d.lib等