openCV中为颜色赋值(255,0,0),却显示蓝色;赋值红色却显示蓝色。
比如下面的代码,画出的圆是蓝色的。intmain(intargc,char*argv[]){IplImage*img=cvCreateImage(cvSize(500,5...
比如下面的代码,画出的圆是蓝色的。
int main(int argc, char* argv[])
{
IplImage* img = cvCreateImage(cvSize(500,500),IPL_DEPTH_8U,3) ;
cvZero(img);
cvCircle(img,cvPoint(250,250),100,cvScalar(255,0,0));
cvNamedWindow("hello openCV",CV_WINDOW_AUTOSIZE);
cvShowImage("hello openCV",img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("hello openCV");
return 0;
} 展开
int main(int argc, char* argv[])
{
IplImage* img = cvCreateImage(cvSize(500,500),IPL_DEPTH_8U,3) ;
cvZero(img);
cvCircle(img,cvPoint(250,250),100,cvScalar(255,0,0));
cvNamedWindow("hello openCV",CV_WINDOW_AUTOSIZE);
cvShowImage("hello openCV",img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("hello openCV");
return 0;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询