C++ open cv calcHist没有匹配函数
我在iOS应用程序中使用OpenCV。我试图计算直方图,但一旦我将所有参数放入函数中,它就不会给出匹配函数错误 以下是我的代码:C++ open cv calcHist没有匹配函数,c++,opencv,C++,Opencv,我在iOS应用程序中使用OpenCV。我试图计算直方图,但一旦我将所有参数放入函数中,它就不会给出匹配函数错误 以下是我的代码: cv::Mat temp2; cv::MatND output_his; const int channels[] = { 1 }; const int histSize[] = { 256 }; const float hranges[] = { 0, 256 }; // cv::calcHist(<#const Mat *ima
cv::Mat temp2;
cv::MatND output_his;
const int channels[] = { 1 };
const int histSize[] = { 256 };
const float hranges[] = { 0, 256 };
// cv::calcHist(<#const Mat *images#>, <#int nimages#>, <#const int *channels#>, <#InputArray mask#>, <#OutputArray hist#>, <#int dims#>, <#const int *histSize#>, <#const float **ranges#>)
cv::calcHist(temp2, 1, channels, cv::Mat(), output_his, 2, histSize, hranges);
cv::Mat temp2;
cv::材料输出;
常量int通道[]={1};
常量int histSize[]={256};
常量float hranges[]={0,256};
//cv::calcHist(,,,,)
cv::calcHist(temp2,1,channels,cv::Mat(),output_his,2,histSize,hranges);
你能帮我吗
谢谢我在我的项目中使用它。也许这段代码会有帮助:)
inline cv::Mat calcHist(cv::Mat grayscaleImage)
{
const int bins = 256;
const int histSize[] = { bins };
const float range[] = { 0.f, 256.f };
const float* ranges[] = { range };
const int channels[] = { 0 };
cv::Mat hist;
cv::calcHist(&grayscaleImage, 1, channels, cv::Mat(), hist, 1, histSize, ranges);
return hist;
}