2014-02-27 53 views
1

我试图找到直方图的图像中,我试图用calcHist方法如下面calcHist方法 - 无效参数

calcHist(&bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate); 

我想这example from this link. 一直以来我得到这个错误,我我无法编译代码

"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) '" 

我已经配置我的生成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); 

在此先感谢。

NSM

回答

0

我只能建议尝试HISTSIZE为int数组不是int。我知道你只有一架飞机,但我认为这次通话真的是期待一个阵列 - 每架飞机都有一架。尝试使用256作为唯一元素创建长度为1的数组。