概述
直方图,简单通俗的理解,是对图像上像素的统计!统计像素在整个图像上的出现频率!
OpenCv提供的API中有三个计算直方图的函数:
/** @brief Calculates a histogram of a set of arrays.
The functions calcHist calculate the histogram of one or more arrays. The elements of a tuple used
to increment a histogram bin are taken from the corresponding input arrays at the same location. The
sample below shows how to compute a 2D Hue-Saturation histogram for a color image.
**/
CV_EXPORTS 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, bool accumulate = false );
/** @overloadthis variant uses cv::SparseMat for output*/
CV_EXPORTS 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, bool accumulate = false );
/** @overload */
CV_EXPORTS_W void calcHist( InputArrayOfArrays images,
const std::vector& channels, InputArray mask,
OutputArray hist, const std::vector& histSize,
const std::vector& ranges, bool accumulate = false );
参考文献:
[1] OpenCV深入学习(5)--直方图之calcHist使用
[2] OpenCV深入学习(6)--直方图之calcHist使用(补)
最后
以上就是调皮哈密瓜为你收集整理的OpenCv计算直方图cv::calcHist的全部内容,希望文章能够帮你解决OpenCv计算直方图cv::calcHist所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复