Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV : calHist method Inavlid 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 image description

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 :(:)

Thanks in Advance

NSM

click to hide/show revision 2
retagged

updated 2014-02-26 07:20:55 -0600

berak gravatar image

OpenCV : calHist method Inavlid 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 image description

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 :(:)

Thanks in Advance

NSM

click to hide/show revision 3
@berak Edited with the vars involved in the code

OpenCV : calHist method Inavlid 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 image description

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

click to hide/show revision 4
No.4 Revision

OpenCV : calHist calcHist method Inavlid ArgumentsInavalid 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 image description

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