Android calcHist方法-参数无效

Android calcHist方法-参数无效,android,opencv,android-ndk,Android,Opencv,Android Ndk,我试图在图像中找到直方图,并尝试使用calcHist方法,如下所示 calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate ); 我正在尝试这个 一直以来,我都遇到这个错误,我无法编译代码 "Invalid arguments ' Candidates are: void calcHist(const cv::Mat *, int, cons

我试图在图像中找到直方图,并尝试使用calcHist方法,如下所示

calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate );
我正在尝试这个 一直以来,我都遇到这个错误,我无法编译代码

"Invalid arguments ' Candidates are: void calcHist(const cv::Mat *, int, const int *, const cv::_InputArray &, cv::SparseMat &, int, const int *, const float * *, bool, bool) void calcHist(const cv::Mat *, int, const int *, const cv::_InputArray &, const cv::_OutputArray &, int, const int *, const float * *, bool, bool) void calcHist(const cv::_InputArray &, const std::vector<int,std::allocator<int>> &, const cv::_InputArray &, const cv::_OutputArray &, const std::vector<int,std::allocator<int>> &, const std::vector<float,std::allocator<float>> &, bool) '"
“无效参数”的候选参数是:void calcHist(const cv::Mat*,int,const int*,const cv::_InputArray&,cv::SparseMat&,int,const int*,const float**,bool,bool)void calcHist(const cv::Mat*,int,const int int*,const cv:_InputArray&,const cv:_OutputArray&,int,const int*,const float**,const float**,bool)void calcHist(const cv)(const-cv::_-InputArray&,const-std::vector&,const-cv:_-InputArray&,const-cv:_-OutputArray&,const-std::vector&,const-std::vector&,bool)“”
我已使用所需的includes配置了构建C/C++构建路径

我在32位系统上工作,并为windows 32位系统设置了适当的NDK。在64位系统上运行时,该方法编译时没有任何问题

从早上开始我的头就痛得要命。有人来帮帮忙

Mat imagMat=cvLoadImageM("/sdcard/ImageProcessing/TestImage.png");
LOGD("Number Of Rows = %d",imagMat.rows);

/// Separate the image in 3 places ( B, G and R )
vector<Mat> bgr_planes;
split( imagMat, bgr_planes );

/// Establish the number of bins
int histSize = 256;

/// Set the ranges ( for B,G,R) )
float range[] = { 0, 256 } ;
const float* histRange = { range };

bool uniform = true;

bool accumulate = false;

Mat b_hist, g_hist, r_hist;

const int* channel=0;

calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate );
Mat imagMat=cvLoadImageM(“/sdcard/ImageProcessing/TestImage.png”);
LOGD(“行数=%d”,imagMat.Rows);
///将图像分为三个位置(B、G和R)
矢量bgr_平面;
分割(imagMat、bgr_平面);
///确定垃圾箱的数量
int histSize=256;
///设置范围(对于B、G、R))
浮动范围[]={0,256};
常量浮点*histRange={range};
布尔一致=真;
布尔累积=假;
Mat b_hist、g_hist、r_hist;
常量int*通道=0;
calcHist(&bgr_平面[0],1,0,Mat(),b_hist,1,&histSize,&histRange,均匀,累积);
提前谢谢


NSM

我只能建议尝试将histSize作为int数组,而不是int数组。我知道您只有一个平面,但我认为该调用实际上需要一个数组-每个平面一个数组。尝试创建一个长度为1、唯一元素为256的数组