如何找到ROI并检测内部的标记? [英] How can I find ROI and detect markers inside?

查看:127
本文介绍了如何找到ROI并检测内部的标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是计算机视觉的初学者.我有一个有关检测和跟踪的问题.我要检测下图中的白色矩形,以确定有趣的区域并检测红色标记的轮廓.

I'm a beginner in computer vision. I have a question about detection and tracking. I want to detect the white rectangle in the image below, to determine the interesting area and to detect the contour of the red markers.

但是我不想利用颜色信息来检测标记.

But I don't want to make use of color information to detect the markers.

有人可以给我一些建议吗?

Can anyone give me suggestions on how to do this?

推荐答案

您可以使用CvFindContours查找轮廓,并使用CvApproxPoly()查找矩形.您可以在此处找到如何使用此函数查找矩形的好例子. 并使其适应您的情况.要找到圆,我建议对arcLength和轮廓线的面积之间的比例进行一些处理,对于圆来说,此比例非​​常具体.要找到arcLength,请使用cvArcLength(CvSeq* c)来查找区域,同时在for循环中浏览轮廓时请使用cvContourArea(CvSeq* c).

You can find the contours with CvFindContours and use CvApproxPoly() to find the rectangle. You can find a good example of how to use this function to find rectangles here and adapt it to your situation. To find the circles I would advise to do something with the ratio between the arcLength and the area of the contours you find as for circles this ratio is very specific. To find the arcLength use cvArcLength(CvSeq* c) to find the area use cvContourArea(CvSeq* c) while going through the contours in a for loop.

这篇关于如何找到ROI并检测内部的标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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