Function compute_k_percentile

Function Documentation

float compute_k_percentile(const cv::Mat &img, float perc, float gscale, size_t nbins, size_t ksize_x, size_t ksize_y)

This function computes a good empirical value for the k contrast factor given an input image, the percentile (0-1), the gradient scale and the number of bins in the histogram.

Parameters
  • img – Input image

  • perc – Percentile of the image gradient histogram (0-1)

  • gscale – Scale for computing the image gradient histogram

  • nbins – Number of histogram bins

  • ksize_x – Kernel size in X-direction (horizontal) for the Gaussian smoothing kernel

  • ksize_y – Kernel size in Y-direction (vertical) for the Gaussian smoothing kernel

Returns

k contrast factor