1
我对两幅图像拼接做,并且有这个错误在调试(编译成功,但运行时它打破):OpenCV的断言错误的拼接
断言失败== 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
等
可能是功能'stitcher.stitch (imgs,result);'输入** 8位,3个通道**的输入图像。尝试将图像加载为彩色。 – sgarizvi 2013-02-22 06:43:41
我不确定,但输入到针迹的灰度应该是正确的吗?通常它更容易针迹灰度图像,并且代码在Ubuntu上完美运行,在Windows和Visual studio 2010中我遇到了问题。 – 2013-02-22 18:06:24