calcHist method Inavalid Arguments.
Dear Folks,
I am trying to find histogram in the image and I am trying to use calcHist method like below
calcHist( &bgr_planes[0], 1, 0, Mat(), b_hist, 1, &histSize, &histRange, uniform, accumulate );
I am trying this example from the link http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.html
All the time I am getting this error and I am not able to compile the code
"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) '"
I have configured my build c/c++ build path with the required includes
I am working on 32 bit system and have set up appropriate NDK for windows 32 bit system. Same code when I run on 64 bit system where the method compiles without any issue!
Really Banging my head since morning . Some one pleeeeaaase help :(:)
Edited:
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 );
Thanks in Advance
NSM
please edit and show he definition of the vars involved as well
@berak . I have edited my post! Please see! Thanks
weird. vs2008 is quite happy with the 2nd overload here.
@berak if I run the same code in 64 bit machine , it compiles without error! I am wondering what I may be missing!
it's the compiler, that complains. i don't see any connection to 64 bit (that's only relevant to the linker)
sorry, no idea atm.
@berak I agree. But compiler for 32 bit and compiler for 64 bit would be different right . So you mean to say the 32 bit compiler only throwing this error ? Do I need to check with different compiler combination for 32 bit ? Am I missing any configuration changes ? Please guide me!
A little off the grid,but I guess you should use imread instead of cvLoadImageM.May be this could help.