cvLoadImage function

 

Code:
  1. /* 8bit, color or not */  
  2. #define CV_LOAD_IMAGE_UNCHANGED  -1   
  3. /* 8bit, gray */  
  4. #define CV_LOAD_IMAGE_GRAYSCALE   0   
  5. /* ?, color */  
  6. #define CV_LOAD_IMAGE_COLOR       1   
  7. /* any depth, ? */    
  8. #define CV_LOAD_IMAGE_ANYDEPTH    2   
  9. /* ?, any color */  
  10. #define CV_LOAD_IMAGE_ANYCOLOR    4   
  11.   
  12. IplImage *lpImage = cvLoadImage("e://airplane.jpg",  int flag);   
  13.   
  14. //flag主要是读入图像颜色和深度   
  15. //当 flag为 上面的定义时,打开的图像就为单筒单、3通道图像   
  16.   
  17. 当要进行图像边缘检测时打开的应该是灰度图像flag = CV_LOAD_IMAGE_CRAYSCALE = 0,或者打开图像后进行灰度转换。  
test1.cpp: In function ‘int main(int, char**)’: test1.cpp:7:2: error: ‘CvPoint’ was not declared in this scope 7 | CvPoint center; | ^~~~~~~ test1.cpp:10:2: error: ‘IplImage’ was not declared in this scope 10 | IplImage* image = cvLoadImage("luhan.png"); | ^~~~~~~~ test1.cpp:10:12: error: ‘image’ was not declared in this scope 10 | IplImage* image = cvLoadImage("luhan.png"); | ^~~~~ test1.cpp:10:20: error: ‘cvLoadImage’ was not declared in this scope 10 | IplImage* image = cvLoadImage("luhan.png"); | ^~~~~~~~~~~ test1.cpp:13:2: error: ‘cvShowImage’ was not declared in this scope 13 | cvShowImage("Image", image); | ^~~~~~~~~~~ test1.cpp:15:26: error: ‘center’ was not declared in this scope 15 | if (!image) return -1; center = cvPoint(image->width / 2, image->height / 2); | ^~~~~~ test1.cpp:15:35: error: ‘cvPoint’ was not declared in this scope 15 | if (!image) return -1; center = cvPoint(image->width / 2, image->height / 2); | ^~~~~~~ test1.cpp:21:44: error: expected primary-expression before ‘,’ token 21 | uchar* ptr = &CV_IMAGE_ELEM(image, uchar, i, j * 3); | ^ test1.cpp:21:18: error: ‘CV_IMAGE_ELEM’ was not declared in this scope 21 | uchar* ptr = &CV_IMAGE_ELEM(image, uchar, i, j * 3); | ^~~~~~~~~~~~~ test1.cpp:28:8: error: ‘cvarrToMat’ was not declared in this scope 28 | src = cvarrToMat(image); | ^~~~~~~~~~ test1.cpp:31:5: error: ‘cvNamedWindow’ was not declared in this scope 31 | cvNamedWindow("test",1); imshow("test", src); | ^~~~~~~~~~~~~ test1.cpp:32:3: error: ‘cvWaitKey’ was not declared in this scope 32 | cvWaitKey(); | ^~~~~~~~~
最新发布
07-17
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值