开发者

OpenCV RGB Value Detection?

So im basically either looking for code, or even a sample to detect RGB values (maybe even with hue) to be used with OpenCV

Ideally you would开发者_运维知识库 be able to show an object in front of your webcam, then click on it with it outputting the RGB values.

Im trying to do this because im trying to find a decent color threshold to work with my OpenCV color tracking program, right now im getting wayyy to many false positives using a Red Color....so im trying to find something more distinct, if anyone has any ideas please let me know.

Thanks


Here's an article that explains the tracking process:

http://aishack.in/tutorials/tracking-colored-objects-in-opencv/


you may want to use histogram back projection as shown in the camshift.py sample program (assuming python) (mark a section with the hue you need. then hit 'b' to see result) This will help you filter based on hue histogram.


For the camshift e.g. mentioned by Neon22, you can see a scaled down sample: here.

Their method is a simplified version of what is used in the camshift e.g. as they only consider the hue channel instead of both hue and saturation channel which would give better results. You can easily adapt it to suit the color you wish to track by creating the histogram using sample of the color you wish to track rather than the skin pixels in the e.g.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜