Calculates the grayscale histogram of an image. If the input is a color image, its luminance histogram will be calculated.


  • image: Input image.

  • frame: A coordinate frame for the rectangle in the world coordinate system.

  • size: The size of the rectangle in which the histogram is calculated. If size is undefined (either width or height is NAN), the histogram is computed from the whole image. Otherwise the region of interest is determined by size and frame.


  • histogram: Grayscale histogram vector. The length of the vector depends on the dynamic scale of the input image, but is always at least 256.