问题描述
我需要构建一个包含图像的应用程序。在图像上,用户可以点击很多点,并且取决于点击的位置,我们需要接受输入。点击位置是固定的。
I need to build an app in which there is an image. On image there are many points where user can tap and depend upon that location of tap we need to take input. Tap locations are fixed.
用户可以缩放图像。检测多个水龙头。 (单击,双击等)。
User can zoom image. Detect multiple taps. (Single tap, double tap, etc.)
我们面临的最大问题是彼此之间的点太多。因此,如果我们点击一个点,就会获得其他点的点击。
Biggest problem we are facing is there are too many points near to each other. So if we tap on one point we are getting other points clicked.
下面是我需要处理的图像。
Following is the image according which I need to work on.
我需要检测所有红点上的轻击,并据此做出决定。红点将对用户不可见。
I need to detect tap on all red dots and take decision based upon that. That red dots will not be visible to user.
我尝试过的操作如下。
在图片如图所示。但是问题是,当用户点击按钮时,按钮的点击事件没有调用,或者没有点击用户似乎在点击的右键。
Placed buttons on image as shown image. But problem is when user tap on button either button's tap event is not calling or it's not tapping right button which user seems to tap.
我现在想做的是。
在滚动视图中拍摄图像,然后检测滚动视图的拍击,然后基于坐标检测拍击。
Taken image in scroll view then detect tap of scroll view and then based upon co-ordinates detect tap.
有没有更简单的方法来检测点击?
Is there any easier way to detect tap?
推荐答案
您的要求非常复杂。
在这里您必须借助Core映像。您需要处理该图像并获取该图像的核心细节。另外,形态学操作将帮助您从图像中检测物体。看一下链接:
Here you have to take a help of Core image. You need to process that image and get the core details of that image. Also "Morphological Operations" will help you to detect object from image. Take a look on links:
这篇关于如何检测iOS中最近的小按钮的点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!