本文章系基于 @浅墨_毛星云 【OpenCV入门教程】整合精简并翻译而成。
整理+翻译:zihao WANG本系列文章由@浅墨_毛星云 出品,转载请注明出处。
文章链接:http://blog.csdn.net/poem_qianmo/article/details/20537737
作者:毛星云(浅墨) 邮箱: happylifemxy@163.com
写作当前博文时配套使用的OpenCV版本: 2.4.8
Name Space
#include <opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
using namespace cv;
MAT Data Structure
Mat myMat= imread("dota.jpg");
read an image in to myMat which is an Mat struture.
Parameters:
filename – Name of file to be loaded.
flags –
Flags specifying the color type of a loaded image:
CV_LOAD_IMAGE_ANYDEPTH - If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.
CV_LOAD_IMAGE_COLOR - If set, always convert image to the color one
CV_LOAD_IMAGE_GRAYSCALE - If set, always convert image to the grayscale one
>0 Return a 3-channel color image.
Note In the current implementation the alpha channel, if any, is stripped from the output image. Use negative value if you need the alpha channel.
=0 Return a grayscale image.
<0 Return the loaded image as is (with alpha channel).