title: OpenCV project crashes when applying histogram to black image
body: <p>I am trying to troubleshoot a project that uses openCV. Somewhere, there is a histogram equalization - that crashes when the input image is pure black (or pure white or pure something).<br>I have been trying to troubleshoot the debug assertion failure that I get - "Expression: vector subscript out of range" - unsuccessfully. Note: the method does not use EqualizeHistogram, it creates the histogram manually, counts pixels per level, does an average - like in the textbook.<br>
  <strike>If I can isolate the case when I have a discrete color distribution - only one spike of color - I can just not do this optimization, and prevent the crash.</strike> So far the only situation the program is crashing is when the image histogram has only one value in one color, and 0 everywhere else.<br><br>
  <strike>How can I see how many colors are in my image ? </strike>
  <br>
  Please help ! Thank you.<br>
  Edit: All I have to do is replace the method that doesn't work with the OpenCV method, cvEqualizeHistogram. </p>