[英]displaying image in opencv
I am writing a simple program for displaying image in a window, but when running it is not loading the image. 我正在编写一个用于在窗口中显示图像的简单程序,但是运行时不会加载图像。 I am not getting why this is happening?
我不明白为什么会这样吗?
#include<opencv/cvaux.h>
#include<opencv/highgui.h>
#include<opencv/cxcore.h>
#include<opencv/cv.h>
#include<stdio.h>
#include<stdlib.h>
int main(int argc, CHAR* argv[])
{
IplImage* img = cvLoadImage("C:\Users\jai guru umesh\Desktop\6.jpg");
if (!img)
{
printf("Image can NOT Load!!!\n");
return 1;
}
cvNamedWindow("myfirstwindow");
cvShowImage("myfirstwindow", img);
cvWaitKey(0);
cvReleaseImage(&img);
return 0;
}
\\
is an escape character. \\
是转义字符。
Change 更改
IplImage* img = cvLoadImage("C:\Users\jai guru umesh\Desktop\6.jpg");
to 至
IplImage* img = cvLoadImage("C:\\Users\\jai guru umesh\\Desktop\\6.jpg");
or 要么
IplImage* img = cvLoadImage("C:/Users/jai guru umesh/Desktop/6.jpg");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.