#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <fstream>
#include <opencv2/opencv.hpp>
#define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION)
#ifdef _DEBUG
#define cvLIB(name) "opencv_" name CV_VERSION_ID "d"
#else
#define cvLIB(name) "opencv_" name CV_VERSION_ID
#endif
#pragma comment( lib, cvLIB("core") )
#pragma comment( lib, cvLIB("imgproc") )
#pragma comment( lib, cvLIB("highgui") )
#pragma comment( lib, cvLIB("flann") )
#pragma comment( lib, cvLIB("features2d") )
#pragma comment( lib, cvLIB("calib3d") )
#pragma comment( lib, cvLIB("gpu") )
#pragma comment( lib, cvLIB("legacy") )
#pragma comment( lib, cvLIB("ml") )
#pragma comment( lib, cvLIB("objdetect") )
#pragma comment( lib, cvLIB("ts") )
#pragma comment( lib, cvLIB("video") )
#pragma comment( lib, cvLIB("contrib") )
#pragma comment( lib, cvLIB("nonfree") )
拿走吧,应该能都解决opencv各个版本的问题
cv::是命名空间,如果程序头部添上using namespace cv那么imread和cv::imread就一样了。函数imread用于读取图片文件中的数据。在matlab的命令窗口中输入doc imread或者help imread即可获得该函数的帮助信息。
调用格式
A = imread(filename,fmt)
[X,map] = imread(filename,fmt)
[...] = imread(filename)
[...] = imread(URL,...)
[...] = imread(...,idx) (CUR, GIF, ICO, and TIFF only)
[...] = imread(...,'PixelRegion',{ROWS, COLS}) (TIFF only)
[...] = imread(...,'frames',idx) (GIF only)
[...] = imread(...,ref) (HDF only)
[...] = imread(...,'BackgroundColor',BG) (PNG only)
[A,map,alpha] = imread(...) (ICO, CUR, and PNG only
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)