Re: [問題] opencv利用roi選定位置放圖片?
我改成
int main(int argc, char ** argv)
{
IplImage *img = cvLoadImage( "1.jpg", 1 );
IplImage *result2 = cvLoadImage( "lena.jpg", 1 );;
IplImage *result3;
CvSize Size1=cvGetSize(img);
CvSize Size2=cvGetSize(result2);
CvRect roi2;
result3=cvCreateImage(Size2,IPL_DEPTH_8U,3);
cvZero(result3);
roi2 = cvRect(5,5,Size1.width,Size1.height);
cvSetImageROI(result3,roi2);
cvCopy(result2, result3, 0);
cvResetImageROI(result2);
cvResetImageROI(result3);
cvShowImage("1234",result3);
cvWaitKey(-1);
system("PAUSE");
return 0;
}
我試了之後會一直印出像下面的error
OpenCV Error :Assertion failed(src.depth() == des.depth() && src.size() == size()) in cvCopy
,file C:\user\UP\opencv\src\cxcore\cxcopy.cpp , line 466
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
請大大幫幫我或是可以提供類似的code給我參考嗎??
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.117.166.104
※ 編輯: milk62240 來自: 59.117.166.104 (06/22 00:21)
推
06/22 00:38, , 1F
06/22 00:38, 1F
→
06/22 01:02, , 2F
06/22 01:02, 2F
推
06/22 08:52, , 3F
06/22 08:52, 3F
→
06/22 08:53, , 4F
06/22 08:53, 4F
→
06/22 08:54, , 5F
06/22 08:54, 5F
→
06/22 18:20, , 6F
06/22 18:20, 6F
討論串 (同標題文章)