#include<opencv2/opencv.hpp>
#include<opencv2/highgui/highgui.hpp>
#include <opencv2/highgui.hpp>
//#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
#define cvQueryHistValue_1D( hist, idx0 ) \
((float)cvGetReal1D( (hist)->bins, (idx0)))
int main(int argc, char** argv)
{
Mat src = imread("D:/test.jpeg"); //读取图像
if (src.empty())
{
cout << "could not load image…" << endl;
return 0;
}
namedWindow("input", WINDOW_NORMAL);
imshow("input", src);
// 图像灰度画部分 /
Mat dst;
namedWindow("output", WINDOW_NORMAL);
cvtColor(src, dst, COLOR_BGR2GRAY); //图像灰度化
imshow("output", dst);
waitKey(0);
return 0;
}
是我今天的作业之一,怕忘记就先记录一下。