open CV对图像的各类操作
本文章用于记录自己使用open CV过程中的要点,便于遗忘时查看。 首先使用 using namespace std; using namespace cv; 避免每次都需要敲 ::cv及::std; 图像的读写显示存取 图像定义: Mat image; 图像读取: imread(const String & filename,int flags = IMREAD_COLOR); 支持格式有: Windows bitmaps - *.bmp, *.dib (always supported) JPEG files - *.jpeg, *.jpg, *.jpe (see the Notes section) JPEG 2000 files - *.jp2 (see the Notes section) Portable Network Graphics - *.png (see the Notes section) WebP - *.webp (see the Notes section) Portable image format - *.pbm, *.pgm, *.ppm *.pxm, *.pnm (always supported) Sun rasters - *.sr, *.ras (always supported) TIFF files - *.tiff, *.tif