<< cv_brief ComputerVision cv_cannyedge >>

ComputerVision >> ComputerVision > cv_calchist

cv_calchist

Calculate histogram of Image

Calling Sequence

hist= cv_calchist(image,channels,mask,histsize,ranges)

Arguments

image

Input Image for which histogram is needed

channels

It is given in square brackets. It the index of channel for which we calculate histogram. For example, if input is grayscale image, its value is [0]. For color image, you can pass [0],[1] or [2] to calculate histogram of blue,green or red channel respectively.

mask

Mask image. To find histogram of full image, it is given as “None”. But if you want to find histogram of particular region of image, you have to create a mask image for that and give it as mask

HistSize

It takes argument as list. This represents our BIN count. Need to be given in square brackets. For full scale, we pass [256].

ranges

It takes argument as list This is our RANGE. Normally, it is [0,256].

Hist

hist is a 256x1 array, each value corresponds to number of pixels in that image with its corresponding pixel value.

Description

Finding Histogram

For details in Histgram see : http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_imgproc/py_histograms/py_histogram_begins/py_histogram_begins.html

Examples

hist = cv_calchist(img,[0],'None',[256],[0,256])

See Also


Report an issue
<< cv_brief ComputerVision cv_cannyedge >>