Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to use calcHist

I am sorry to ask so question here,but the documentation fool me.I want to use the calcHist to deal with 2 images.This is my code

#include <opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;

int main(){
    Mat fruits=imread("fruits.jpg",IMREAD_GRAYSCALE), lena= imread("lena.jpg", IMREAD_GRAYSCALE);
    Mat inputs[] = { fruits,lena }, hist;
    float range[] = { 0,256 };
    float * histRange = {range};
    int histSize = 255, channels = 0;

calcHist(*inputs, 2, &channels, Mat(), hist, 1, &histSize, *histRange);
    return 0;
}

But it cannot be compile by my vs2015.Anybody can help to tunning?

How to use calcHist

I am sorry to ask so such simple question here,but the documentation fool me.I want to use the calcHist to deal with 2 images.This is my code

#include <opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;

int main(){
    Mat fruits=imread("fruits.jpg",IMREAD_GRAYSCALE), lena= imread("lena.jpg", IMREAD_GRAYSCALE);
    Mat inputs[] = { fruits,lena }, hist;
    float range[] = { 0,256 };
    float * histRange = {range};
    int histSize = 255, channels = 0;

calcHist(*inputs, 2, &channels, Mat(), hist, 1, &histSize, *histRange);
    return 0;
}

But it cannot be compile by my vs2015.Anybody can help to tunning?