如何突出显示Camera视图拍摄的图像上的一大块文本 [英] How can I highlight a chunk of text on an image taken by Camera view

查看:155
本文介绍了如何突出显示Camera视图拍摄的图像上的一大块文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个OCR项目。我的第一个任务是从iPhone相机拍摄图像,然后在图像上找到一个特定的单词。

I am working on an OCR project. My first task is to take an image from iPhone camera and then locate a specific word on the image.

下面是我的设备拍摄的示例图像,现在我想要找到单词STATIONERY的位置,并在图像上用黄色矩形突出显示。

Below is a sample image taken by my device, now I want to find the position of word "STATIONERY" and highlight it with a yellow rectangle on image.

我该怎么做?我是否需要首先使用OCR SDK(如ABBYY),否则我可以这样做吗?

How can I do that? Do I need to first use an OCR SDK for that (like ABBYY) or can I do this otherwise?

推荐答案

如果您需要获取特定单词的坐标,当然您需要先执行OCR。请记住,由于它的底部部分,您可能会因为附加的那个小图像而遇到一些困难。 OCR在类似的背景下做得很好。

If you need to get the coordinates of a specific word, of course you need to perform OCR first. Keep in mind you'll probable have some difficulties with that paticullar image you've attached because of its bottom part. OCR will do a good job with a plain similar background.

关于OCR SDK - 试试 ABBYY Cloud OCR SDK ,它是ABBYY最近推出的基于云的OCR SDK。它处于测试阶段,所以现在它完全免费使用,它有一个随时可用的 iOS代码示例

Concerning OCR SDK - try ABBYY Cloud OCR SDK, it's a cloud-based OCR SDK recently launched by ABBYY. It's in beta, so for now it's totally free to use and it has a ready-to-go iOS code samples.

它具有xml格式的内置坐标提取功能,我已经裁剪了图像的底部为了让背景变得简单并将其发送到SDK,这是我得到的回复:

It has a built-in coordinates extraction feature in xml format, i've cropped the bottom part of your image for the background to be plain and sent it to SDK, here's the response i got:

<charParams l="35" t="39" r="73" b="83" charConfidence="100">S</charParams>
<charParams l="77" t="39" r="117" b="83" charConfidence="100">T</charParams>
<charParams l="120" t="40" r="164" b="83" charConfidence="100">A</charParams>
<charParams l="165" t="40" r="204" b="83" charConfidence="100">T</charParams>
<charParams l="211" t="40" r="225" b="83" charConfidence="100">I</charParams>
<charParams l="231" t="40" r="276" b="84" charConfidence="100">O</charParams>
<charParams l="285" t="41" r="325" b="84" charConfidence="100">N</charParams>
<charParams l="334" t="42" r="370" b="84" charConfidence="100">E</charParams>
<charParams l="377" t="42" r="419" b="85" charConfidence="100">R</charParams>
<charParams l="428" t="42" r="469" b="84" charConfidence="100">Y</charParams>

那些l,t,r,b参数代表左边,在顶部,右侧和底部,它们描述了每个角色的矩形,左上角和右下角。我很满意你正在寻找的东西。

Those "l", "t", "r", "b" params stand for left, top, right and bottom, they describe a rectangle of each character with top-left and bottom-right corner. I beleive that's exatly what you are looking for.

这篇关于如何突出显示Camera视图拍摄的图像上的一大块文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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