图像中的红色检测 [英] red color detection in image

查看:202
本文介绍了图像中的红色检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

推荐答案

AForge.Net框架 [ ^ ]可能是您想要的看.
AForge.Net Framework[^] might be something you want to have a look at.


好,图像是由像素组成的(最基本的),如果将其加载到位图中,则可以使用GetPixel方法获得像素数据.
这将为您提供像素值的Color结构,该结构具有"R"属性,即Red信息.
Well the image is made of pixels (at it''s most basic) and you can get at the pixel data using the GetPixel method if you load it into a Bitmap.
That would give you a Color structure of the pixel value, which has an "R" property, which is the Red info.
Bitmap b = (Bitmap) Image.FromFile(@"D:\Temp\myPic.jpg");
Color c = b.GetPixel(0, 0);
Console.WriteLine(c.R);




但是请注意,许多带有红色成分的颜色看起来都不是红色!




But be aware that many colours that have a Red component do not look red!


1.从图像中读取像素RGB颜色值.您未指明是要读取显示的图像还是要从文件中读取图像,这取决于您.
2.确定您认为红色"的RGB值范围.例如粉红色的红色足以满足您的需求吗?
3.过滤红色" RGB值范围内的所有像素.

提示:您为解决这个问题付出了很少的努力.因此,很难知道您遇到了什么问题.付出更多的努力可能会得到更好的答案.
1. Read pixel RGB colour values from your image. You don''t indicate whether you are reading a displayed image or image from file so that''s up to you.
2. Decide what range of RGB values you consider to be ''red''. e.g. is pink ''red'' enough for you?
3. Filter all pixels for your range of ''red'' RGB values.

Hint: you''ve put very little effort into framing this question. Consequently it''s difficult to know what you''re having trouble with. More effort might yield better answers.


这篇关于图像中的红色检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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