如何创建某些(R,G,B)色OPENCV图像并获得该颜色的名字吗? [英] How to create openCV image of certain (R, G, B) color and get that color name?

查看:119
本文介绍了如何创建某些(R,G,B)色OPENCV图像并获得该颜色的名字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建填充有一些(R,G,B)的彩色图像。并获得该颜色的名字像一些(R,G,B)=黑色或红色等。我们可以做这样的事跟OpenCV的,怎么办呢?

I need to create an image filled with some (R,G,B) color. And get that color name like some (R,G,B) = black or red and so on. Can we do such thing with openCV, and how to do it?

推荐答案

OpenCV的不带颜色创建图像,最简单的办法是要么填充或只是绘制选定的颜色填充的矩形。结果
请参见 http://opencv.willowgarage.com/documentation/drawing_functions.html

opencv doesn't create images with a color, easiest way is either a fill or just draw a filled rectangle with the chosen color.
See http://opencv.willowgarage.com/documentation/drawing_functions.html

http://opencv.willowgarage.com/documentation/drawing_functions.html#rectangle

有没有(据我所知)一个返回颜色名称的功能,最简单的办法是从什么地方得到的颜色列表并检查RGB值对像素。如果你需要一个最接近的,而不是精确匹配(rememebr有名字并非所有244bit的颜色!)看HSV空间

There isn't (AFAIK) a function to return the color name, easiest way is to get a list of colors from somewhere and check the RGB values against the pixel. If you need a closest rather than exact match (rememebr there aren't names for all 244bit colors!) look at HSV color space

这篇关于如何创建某些(R,G,B)色OPENCV图像并获得该颜色的名字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆