使用 OpenCV 进行模式识别 [英] Pattern Recognition using OpenCV

查看:39
本文介绍了使用 OpenCV 进行模式识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试检测绿色场地上物体上的图案,该图案由三种颜色(两侧为粉红色标记,中间为蓝色标记)组成,排列得像个交通信号灯.

I am trying to detect a pattern on an object on a green field, made up of three colors (two pink markers to the sides and a blue one in the middle) arranged like a traffic light.

起初,我尝试将网络摄像头中的图像转换为 hsv 颜色空间,并使用 cvInRangeS 隔离颜色,但由于白天房间内光线的变化,这变得有问题,我要么误报,要么失去对物体的追踪.

At first I tried converting the images from the webcam to hsv color space and isolate the color using cvInRangeS but that became problematic as the light changes in the room during the day I either get false positives or lose track of objects.

然后我通过修改 find_obj.cpp 尝试了 SURF,问题是 opencv 只能在我的标记上检测到 2 个冲浪点,这不足以从代码中找到它,看来我至少需要 4 个,我尝试使用冲浪参数,但这并没有改变任何东西.

Then I tried SURF by modifying find_obj.cpp, the problem with that was opencv can only detect 2 surf points on my marker which is not enough to locate it from the code it seems I need at least 4, I tried playing with surf params but that did not change anything.

我在谷歌搜索时也遇到了这个,

Also while googling I came across this,

http://wiki.elphel.com/index.php?title=OpenCV_Tennis_balls_recognizing_tutorial&redirect=no

这表示我也可以使用机器学习来选择我感兴趣的颜色范围,但我找不到任何关于如何做到这一点的信息.

which says I can also use machine learning to pick the color range I am interested in but I could not find any info on how to do that.

我的问题是,OpenCV 中有什么东西可以让我检测到标记吗?

My question is, is there anything in OpenCV that would allow me to detect the marker?

关于尝试 haar 训练的另一个问题,我的背景将始终是相同颜色的相同表面,使用相同的对象标记,我可以用 20 个正面 20 个负面图像训练分类器,还是我仍然需要数千张图像让它识别?

Another question about trying haar training, my background will always be same color same surface using the same marker for the object, can I train a classifier with say 20 positive 20 negative images or do I still need thousands of images to get it to recognize?

推荐答案

我建议你看看 Shervin 的关于斑点检测的教程,使用颜色
http://www.shervinemami.info/blobs.html

I'd suggest you check out Shervin's tutorial on blob detection, using colors
http://www.shervinemami.info/blobs.html

编辑

你晚上试试 retinex 来帮助改善结果

You night try retinex to help improve results

http://www.ipol.im/pub/algo/lmps_retinex_poisson_equation/

这篇关于使用 OpenCV 进行模式识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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