Ask Your Question

ramg8x's profile - activity

2019-03-01 01:47:38 -0600 asked a question IMRead in ios vs Android vs Mac

IMRead in ios vs Android vs Mac I am using IMRead to form Mat from an image in iOS, Android and Mac OS as well. Running

2019-02-27 02:49:41 -0600 received badge  Enthusiast
2019-02-21 07:49:36 -0600 commented answer calcHist invalid Mat when dims = 3 (n-dimensional histogram)

Thanks a lot; LBerger and @berak. I am new to OpenCV, my assumptions where wrong, thanks for correcting.

2019-02-21 07:46:07 -0600 marked best answer calcHist invalid Mat when dims = 3 (n-dimensional histogram)

Hi all, I would like to generate a 3-dimensional HSV Histogram. It works for 2-D HS Histogram but fails to generate Histogram for 3-dimension. Can someone help me understand what I am doing wrong?

  cv::cvtColor(matImage, matImageHSV, CV_BGR2HSV);

  // Quanta Ratio
  int scale = 10;

  // Quantize the hue to 36 levels
  // and the saturation to 25 levels
  int hbins = 36, sbins = 25,  vbins = 25;
  int histSize[] = {hbins, sbins, vbins};

  // hue varies from 0 to 179, see cvtColor
  float hranges[] = { 0, 180 };

  // saturation varies from 0 (black-gray-white) to
  // 255 (pure spectrum color)
  float sranges[] = { 0, 256 };
  float vranges[] = { 0, 256 };

  const float* ranges[] = { hranges, sranges, vranges };

  // we compute the histogram from the 0-th and 1-st channels
  int channels[] = {0, 1, 2};

  int dims = 3;

  int nImages = 1;

  // Calculate histogram
  cv::MatND hist;

  cv::calcHist(&matImageHSV, nImages, channels, cv::Mat(), // do not use mask
           hist, dims, histSize, ranges,
           true, // the histogram is uniform
           false );

There is no exception or error is thrown.

But the output hist matrix is invalid with values (rows, cols) as (-1, -1).

2019-02-21 07:46:07 -0600 received badge  Scholar (source)
2019-02-20 10:08:21 -0600 commented question calcHist invalid Mat when dims = 3 (n-dimensional histogram)

I have edited the question, Exception is thrown by a statement below calcHist() call. calcHist just generates an invalid

2019-02-20 10:07:37 -0600 commented question calcHist invalid Mat when dims = 3 (n-dimensional histogram)

I have edited the question, Exception is thrown by a statement below calcHist() call. It just generates an invalid hist

2019-02-20 10:07:13 -0600 edited question calcHist invalid Mat when dims = 3 (n-dimensional histogram)

calcHist invalid Mat when dims = 3 (n-dimensional histogram) Hi all, I would like to generate a 3-dimensional HSV Histog

2019-02-20 10:05:43 -0600 received badge  Editor (source)
2019-02-20 10:05:43 -0600 edited question calcHist invalid Mat when dims = 3 (n-dimensional histogram)

calcHist Exception, CvtHelper:Invalid number of channels , when dims = 3 (n-dimensional histogram) Hi all, I would like

2019-02-20 09:35:54 -0600 commented question calcHist invalid Mat when dims = 3 (n-dimensional histogram)

Berak, Not sure about it is failing in line#1. Since it is working perfectly for 2-dimension. It fails in the calcHist f

2019-02-20 08:46:28 -0600 commented question calcHist returns invalid Mat (n-dimensional histogram, n>=3)

sure. please see the new question with code and exception here. http://answers.opencv.org/question/209121/calchist-exce

2019-02-20 08:46:28 -0600 asked a question calcHist invalid Mat when dims = 3 (n-dimensional histogram)

calcHist Exception, CvtHelper:Invalid number of channels , when dims = 3 (n-dimensional histogram) Hi all, I would like

2019-02-20 08:16:20 -0600 commented question calcHist returns invalid Mat (n-dimensional histogram, n>=3)

Any resolution on this, I am facing the same problem with 3.4.5