Advertisement

C++ 直方图的计算

阅读量:
复制代码
    //快速排序
    #include <iostream> 
    #include <vector>
    #include <opencv2/opencv.hpp>
    #include <stdio.h>
    #include <direct.h>
    
    using namespace cv;
    using namespace std;
    
    Mat calcGrayHist(Mat img);
    int main() {
    	// 直方图
    	char *buf;
    	Mat img = imread("D:\ Users\ 4399-5080\ Desktop\ w.png");
    	//imshow("H", img);
    	calcGrayHist(img);
    	//waitKey(0);
    };
    
    
    Mat calcGrayHist(Mat img) {
    	Mat histogram = Mat::zeros(Size(256, 1), CV_32SC1);
    	int rows = img.rows;
    	int cols = img.cols;
    
    	for (int r = 0; r < row

全部评论 (0)

还没有任何评论哟~