How to use calcHist
I am sorry to ask 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?
apart from the syntax problems, you probably should calculate a seperate histogram per (single channel) image for whatever you're doing later.
@berak I know how to calculate one image,but I want to calculate two or more images such as my question.
to achieve what ? (if may ask)
@berak To learning how to use calcHist.Because the second parameter show it can calculate two or more images
ok, ok. still, your use-case looks like a silly idea.