在iPhone上检测图像中三角形的角落 [英] Detect Corners of Triangle in Image on iPhone

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

问题描述

嘿伙计们,
我在最终确定我的应用时遇到了一些问题;实际上,到目前为止,在某些时候,用户必须选择具有一些可拖动对象的三角形的三个顶点。现在,即使这不是一个问题,我认为接近零用户交互可能很有趣,并让我的应用程序挑选图像中三角形的顶点,并自动将标记放在正确的位置。



在做了一些研究,并考虑了lile OpenCV,ImageMagick等等之后,我真的不确定如何识别和找到它的位置图像中三角形的顶点。有什么想法吗?



提前致谢!



编辑:如果有人有一个不涉及amy的解决方案外部库,我仍然很高兴听到它!

解决方案

可以检测图像中的形状然后检测这些形状的角落使用各种不同的图像处理技术。例如,参见。




Hey guys, I'm having a slight problem when finalizing my app; indeed, up until now, at some point, the user had to select the three vertices of a triangle with some draggable objects. Now, even though this isn't a problem, I thought it could be interesting to have close to zero user-interaction, and have my app pick out the vertices of the triangle in an image, and automatically place the markers on the correct spots.

After doing some research, and thinking about stuff lile OpenCV, ImageMagick, etc, I'm not really certain as to how one would recognize and find the location of the vertices of a triangle in an image. Any ideas?

Thanks in advance!

EDIT: If someone has a solution that doesn't involve amy external libraries, I'd still be quite glad to hear it!

解决方案

It is possible to detect shapes in images and then detect the corners of those shapes using a variety of different image processing techniques. See for example this SO question about detecting corners of polygons and my answer there.

Whether this will actually be a simple or difficult task depends greatly on how much information you can safely assume about the image of your triangle.

For example, if your images are computer generated and have only a triangle in them and nothing else and if the triangle contrasts sharply with the background, as below, than you could write something in a few lines of code using OpenCV that would find your vertices.

In that case, you would convert your image to a grayscale image, apply a threshold to to create a binary image, use a built in function find the boundary of the image, and then use any of the methods in the SO question to find the corners.

If on the other hand you are dealing with a photograph of a triangle, your problem becomes much more difficult, because it will not be as simple to acquire a binary image of your triangle. You will have to deal with unknown lighting and background conditions. You may not be able to use a simple threshold, and you won't know what value threshold to use. You will likely need to do some kind of edge detection on your image, and you will be looking at a time consuming project. For a start, see the O'Reilly book, Learning OpenCV.

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

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