简体   繁体   English

iOS / iPhone / iPad:确定名片上放置的对象的大小

[英]iOS/iPhone/iPad: Determine the size of an object lying on a business card

I have a standard business card of known size and I want to open a video stream and snap a hi-res picture of the business card when the appropriate size is reached. 我有一张已知大小的标准名片,我想打开视频流,并在达到适当大小时捕捉名片的高分辨率图片。 For example, if I hover over a business card, the picture is snapped when the scale is correct and I hover over the same card and the picture is snapped again when the scale is correct. 例如,如果我将鼠标悬停在名片上,则在缩放比例正确时将捕捉照片,而当我将鼠标悬停在同一张名片上且将比例正确时,将再次捕捉照片。 If I looked at both images, I want to the business card to be the same size. 如果我看了两个图像,我希望名片的大小相同。

A standard business card is 88.9 × 50.8mm or 3.5 × 2" 1.75 ratio. 标准名片为88.9×50.8mm或3.5×2“ 1.75。

When the video represents the business card in this scale, I want to immediately snap a hi res photo. 当视频代表这种规模的名片时,我想立即拍摄高分辨率照片。

Does anyone have any recommendations on how to do this? 是否有人对此有任何建议? What library would be useful for this if there is one? 如果有一个库,哪个库将对此有用?

I guess the way I'd approach it would be to measure the box in the video and when the box meets the measurements above, the picture gets snapped, but I have clue on how I could achieve this. 我猜想我会采用的方法是测量视频中的盒子,当盒子达到上面的尺寸时,图片会被拍张,但是我对如何实现这一点有所了解。

If I were you, I would start looking for some kind of library related to the computer vision. 如果您是我,我将开始寻找某种与计算机视觉有关的库。 One well known example is OpenCV. 一个众所周知的例子是OpenCV。 I've never used OpenCVpersonally, but I know for sure that there are a lot of documentation out there. 我从未使用过OpenCVpersonally,但我可以肯定知道那里有很多文档。 OpenCV link OpenCV链接

I hope it helps. 希望对您有所帮助。 Good luck! 祝好运!

Paolo 保罗

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM