9/09/2013

OpenCV, To create Histogram and Draw example source code

Example source code to make histogram and drawing.
Show the 'mareHistogram' function.
Input is Mat. The property is CV_8U and binary image.
Output is also Mat. The output Mat is image of histogram.
If you want to get histogram value array, you should get mhist Mat instead of histo in the function.

Thank you.









histogram, countNonZero, vertical, horizontal



3 comments:

  1. Anonymous25/3/14 13:26

    So much THanks :) if i want to count black pixel, then what should i change ??

    ReplyDelete
    Replies
    1. You can use bitwise_not() function so that inverse the black and white pixel,i think so

      Delete
  2. Anonymous28/6/16 07:14

    These are horizontal and vertical projection histograms right ??

    ReplyDelete