imhist.q

This file contains routines for computing 1D and 2D histograms of images and performing histogram equalization.

Summary
imhist.qThis file contains routines for computing 1D and 2D histograms of images and performing histogram equalization.
Functions
imhistComputes the histogram of an image
imjointhistComputes the joint histogram of two images
imequalizehistPerforms histogram equalization

Functions

imhist

Computes the histogram of an image

function y = imhist(x, bins=256)

Parameters

xthe input image
binseither 1) the number of bins to be used, or 2) a vector containing the boundaries of the bins.
ythe output histogram (has size C x num_bins), where C is the number of color components of x, i.e. C = size(x,2)

imjointhist

Computes the joint histogram of two images

function h : mat = imjointhist(x, y, bins_x = 256, bins_y = 256)

Parameters

xinput image #1
yinput image #2
bins_xeither 1) the number of bins to be used for x, or 2) a vector containing the boundaries of the bins of x.
bins_yeither 1) the number of bins to be used for y, or 2) a vector containing the boundaries of the bins of y.
ha 2D joint histogram

imequalizehist

Performs histogram equalization

function y = imequalizehist(x, mode = "yuv")

Parameters

xinput image
modethe histogram equalization mode
  • ”rgb” - use histogram equalization in RGB space, where each color component is processed individually.
  • ”grayscale” - histogram equalization of grayscale images.  In case an RGB image is specified, the image is first converted to grayscale.
  • ”yuv” - performs histogram equalization on the Y-channel of the input image.
Close