OpenCv:克服亮度对颜色直方图的影响
我正在使用 OpenCv。为了进行比较,我必须获取有关图像颜色直方图的数据。
具体来说,我有大量图像,我将它们组织成许多子集,每个子集由一组相似的图像组成。我的目标是能够获取新图像并根据颜色相似性确定其所属的子集。
现在,我知道如何构建图像的直方图,但我的问题是如何尽可能减少图像亮度对颜色直方图的影响。在计算直方图之前,我考虑过使用 cvEqualizeHist() ,但由于我对 OpenCv 还很陌生,所以我不确定最好的方法是什么。
非常感谢任何建议,
I'm using OpenCv. For the purpose of comparison, I have to fetch data about the color histogram of an image.
In detail, I have a large amount of images which I organize into many sub sets, each sub sets consists of a group of similar images. My destination is to be able to get a new image and determine the sub set it belongs to, based on color similarity.
Now, I know how to build the histogram of an image, but my problem is how to decrease as much as possible the affect of the image's lightness on the color histogram. I have thought about using cvEqualizeHist() before calculating the histogram, but since I'm pretty new in OpenCv I'm not sure what the best way is.
Any advise is very appreciated,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
cvtColor() 将图像从 RGB 颜色空间转换为 HSV 颜色空间
带有CV_BGR2HSV
或CV_RGB2HSV
选项。 H、S 和 V 分别代表色相 (Hue)、饱和度 (Saturation) 和强度 (Intensity)。在此 HSV 空间中使用颜色直方图,并且仅对 V 通道使用几个 bin。Transform your image from RGB to HSV color space using
cvtColor()
withCV_BGR2HSV
orCV_RGB2HSV
option. H, S and V stands for Hue, Saturation and Intensity respectively. Use color histograms in this HSV space and use only a couple of bins for V channel.