从 TIFF 中提取或裁剪图像

发布于 2025-01-06 03:41:24 字数 262 浏览 2 评论 0原文

我需要从 TIFF 文件中提取/裁剪中间的标识 (BEAVER),如下所示: http: //i41.tinypic.com/2i7rbie.jpg

然后我需要自动化该过程,以便可以重复大约 900 万次...

我的猜测是我必须使用一些 OCR 软件。但是这样的软件是否有可能“裁剪从该点以下开始并在该点以上结束的任何内容”?

想法?

I need to extract/crop the logotype (BEAVER) in the middle from a TIFF file that looks like this: http://i41.tinypic.com/2i7rbie.jpg

And then I need to automate the process so it can be repeated about 9 million times...

My guess is that I would have to use some OCR software. But is it possible for such a software to "crop anything that starts below this point and ends above this point"?

Thoughts?

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

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

发布评论

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

评论(1

你不是我要的菜∠ 2025-01-13 03:41:24

通常 OCR 软件仅从图像中提取文本并将其转换为某种特定于文本的格式。它不做作物。但是,您可以使用 OCR 技术来完成您的任务。我建议如下:

  • OCR 整个页面
  • 获取已识别文本的坐标
  • 将您的魔法规则应用于已识别的文本以定位要裁剪的区域:例如“应用程序填充”和“声明”句子之间的所有内容。
  • 从图像中剪切该区域并将其导出到您想要的位置。

真正的挑战在于您想要处理的文本量。在定义“智能规则”时,您必须非常小心,以确保它们不会提供误报,并始终将可疑图像发送到单独的队列,您稍后将手动检查和更新您的规则。

一般来说,它可能看起来像这样:

  • 获取前 10 个图像,定义徽标检测规则,测试并查看是否一切正常
  • 然后运行下 10 个图像,查看哪些处理错误,哪些未处理,更新规则,重新处理这些10 确保现在一切正常
  • 在相同大小的新批次上重新运行它,直到它开始正常工作。
  • 然后将批量大小从 10 增加到 100,并继续处理这些批量,直到一切再次开始顺利进行。
  • 然后继续以这种方式完善您的规则并增加批量大小。在某个时间点,您将达到生产速度。

您很可能会遇到一些奇怪的图像,这些图像要么与现有规则相矛盾,要么就是错误的。您并不总是需要更新规则来适应它。可能你的 900 万张收藏中只有几十张这样的图像。最好将它们留在异常队列中以进行手动处理,并且不要冒着魔法规则稳定性的风险。

Typically OCR software does only extraction of text from images and conversion of it into some text-specific format. It does not do crop. However, you can use OCR technologies to achieve your task. I would recommend following:

  • OCR whole page
  • Get coordinates of recognized text
  • Apply your magic rules to recognized text to locate area to crop: such as averything in between "application filled" and "STATEMENT" sentences.
  • Cut from image that area and export it where you want it.

Real challenge is in the amount of text you would like to process. You have to be very carefull when defining your "smart rules" to make sure they don't provide false positives and always send suspicious images to separate queue that you will later manually review and update your rules.

In general it may look like this:

  • Take first 10 of images, define logo detection rules, test and see if everything works well
  • Then run on next 10, see what was prcessed wrong, what was not processed, update rules, re-process those 10 to make sure everything works well now
  • Re-run it on new batches of same size until it will start working well.
  • Then increase batch size from 10 to 100, and go with those batches until again everything start working smoothly
  • Then continue this way perfecting your rules and increasing batch size. At some point of time you will go to production speed.

Most likely you will encounter some strange images that either contradict existing rules, or just wrong. Not always you have to update your rules to accomodate it. It may happen that there it only dozen of images like that in whole your 9 million collection. It might be better to leave them in exceptions queue for manual processing, and don't risk stability of your magic rules.

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