- /* 8bit, color or not */
- #define CV_LOAD_IMAGE_UNCHANGED -1
- /* 8bit, gray */
- #define CV_LOAD_IMAGE_GRAYSCALE 0
- /* ?, color */
- #define CV_LOAD_IMAGE_COLOR 1
- /* any depth, ? */
- #define CV_LOAD_IMAGE_ANYDEPTH 2
- /* ?, any color */
- #define CV_LOAD_IMAGE_ANYCOLOR 4
- IplImage *lpImage = cvLoadImage("e://airplane.jpg", int flag);
- //flag主要是读入图像颜色和深度
- //当 flag为 上面的定义时,打开的图像就为单筒单、3通道图像
- 当要进行图像边缘检测时打开的应该是灰度图像flag = CV_LOAD_IMAGE_CRAYSCALE = 0,或者打开图像后进行灰度转换。