在图像中搜索指定文本

发布于 2024-10-09 00:04:13 字数 189 浏览 0 评论 0原文

我想我会在这里问一个非常愚蠢的问题。在我当前的项目中,我想提供搜索功能。我有一个大图像教程,其中包含有关某个主题的大量信息,我想搜索图像中的功能。假设使用“Apple”这样的类型,它将显示 Apple 在图像中出现了多少次,单击该图像后,图像滚动并转到出现“Apple”的位置。

感谢您阅读我的愚蠢问题,但如果可能的话请让我知道并提供一些示例代码?

I think I am going to ask very stupid Question here. In my current project i want to give search feature. I have an big image tutorial with lot of information about on a topic and i want to search feature in the image. Suppose use type like "Apple" it will show the Apple occurred how many times in the image and after clicking on of that the image scroll and go to the position where "Apple" is occurred.

Thanks for reading my stupid question but if it is possible let me know and put some sample code??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

紫轩蝶泪 2024-10-16 00:04:13

以下是我将采用的方法的总体概述:

  1. 查找基于 C/C++ 的 OCR 库
  2. 让它在 iPhone 上编译
  3. 创建一个 UI 以将图像提供给 OCR 库 存储
  4. OCR 的输出,包括找到的单词及其在图像。
  5. 创建一个 UI 以允许用户输入搜索。
  6. 在 OCR 输出中搜索匹配项并突出显示图像上匹配项的位置。

我想第 2 步将是最困难的。 Tesseract 可能有效,它是基于 C++ 的,但我不知道它有什么依赖项。

更新:GitHub 上有人发布了一个使用 Tesseract 的 演示 iPhone 应用

Here is a broad overview of the approach I would take:

  1. Find a C/C++ based OCR library
  2. Get it to compile on the iPhone
  3. Create a UI to feed images to the OCR library
  4. Store output of OCR, including words found and their location in the image.
  5. Create a UI to allow users to enter a search.
  6. Search OCR output for matches and highlight the location of matches on the image.

I imagine step 2 is going to be the most difficult. Tesseract may work, it is C++ based but I don't know what dependencies it has.

UPDATE: Someone on GitHub has posted a demo iPhone App that uses Tesseract.

煮酒 2024-10-16 00:04:13

请尝试使用 WebView 或 Core Text 来呈现您的教程,其中搜索功能几乎是免费的。使用 OCR 进行搜索对于您的需求来说并不实际。

Please try to do use WebView or Core Text to render you tutorial, in which search functionality comes pretty much for free. Use OCR for search is just not practical for your need.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文