OpenCV中的calcHist函数解释

calcHist

Calculates a histogram of a set of arrays.

计算阵列的直方图。

C++: void calcHist(const Mat*images, int nimages, const int* channels, InputArray mask, OutputArray hist, int dims, const int* histSize, const float** ranges, bool uniform=true, boolaccu-

mulate=false)

C++: void calcHist(const Mat*images, int nimages, const int* channels, InputArray mask, SparseMat&hist, int dims, const int* histSize, const float** ranges, bool uniform=true, boolaccu-

mulate=false)

C: void cvCalcHist(IplImage** image, CvHistogram* hist, int accumulate=0, const CvArr*mask=NULL)

以上是函数原型。

Parameters

images – Source arrays. They all should have the same depth,CV_8U or CV_32F, and the same size. Each of them can have an arbitrary number of channels.

原阵列(因为是指针,可以是一系列图像),应该有相同的深度,8位或32位,但是通道个数可以不同。

nimages– Number of source images.

原图像的个数。

channels – List of the dims channels used to compute the histogram. The first array channels are numerated from 0 to images[0].channels()-1 , the second array channels are counted from images[0].channels() to images[0].channels() + images[1].channels()-1, and so on.

用来计算直方图的通道。

mask– Optional mask. If the matrix is not empty, it must be an 8-bit array of the same

size as images[i]. The non-zero mask elements mark the array elements counted in the

Histogram.

掩膜板,可选的。如果不为空,它必须是与image同大小的8位的阵列。不为零的mask决定哪些元素参与直方图计算。

hist– Output histogram, which is a dense or sparse dims-dimensional array.

输出的直方图。

Dims - Histogram dimensionality that must be positive and not greater than CV_MAX_DIMS(equal to 32 in the current OpenCV version).

直方图的维数。必须为正,并且不能超过CV_MAX_DIMS(现在是32)。

histSize– Array of histogram sizes in each dimension.

直方图的划分个数。一般取16就可以。

ranges– Array of the dims arrays of the histogram bin boundaries in each dimension.

Reference手册上的解释过于繁琐,个人理解就是竖坐标的显示范围。

uniform– Flag indicating whether the histogram is uniform or not (see above).

一般是缺省的。

accumulate– Accumulation flag. If it is set, the histogram is not cleared in the beginning

when it is allocated. This feature enables you to compute a single histogram from several

sets of arrays, or to update the histogram in time.

一般缺省。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值