Swift iOS 的实时摄像头馈送的直边检测

Swift Straight Edge Detection of Live Camera Feed for iOS

我需要检测图像中的直线。我知道直线会在我的图像某处形成十字,我需要找到它们。

我想实时检测这个十字并在用户将相机对准它时在屏幕上圈出它。所以基本上,我需要知道它在屏幕上的位置。

我的问题是关于 Core Image 或任何其他有助于解决此问题的框架。我查看了 ARKit(我不需要在虚拟环境中四处移动)和 Core Image 检测(我看到我可以找到一个矩形、人脸或条形码。矩形会起作用吗?如果它是一条直线是一个非常瘦的矩形)。

我是使用这些框架的新手,我想知道您会推荐什么工具作为检测会形成十字的直线的工具。可以在 Core Image 中完成吗?

vision API can detect all sorts of features, but what you are asking for is a custom symbol. For that you are going to have to train your own ML model (as in Whosebug thread). You can then run your model over your image with CoreML.