如何放大图片以使其达到300 DPI? [英] How do I enlarge a picture so that it is 300 DPI?

查看:439
本文介绍了如何放大图片以使其达到300 DPI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C ++ Library for the question的公认答案图像识别:包含字符串的图像建议您:


  1. 升级/缩小输入图像为300 DPI。

我将如何做到这一点......我的印象是DPI用于显示器,而不是图像格式。

How would I do this... I was under the impression that DPI was for monitors, not image formats.

推荐答案

我认为这里更准确的术语是 重新取样 。您希望像素分辨率足够高以支持准确的OCR。字体大小(例如,在)通常以长度为单位进行测量,而不是像素。由于72点= 1英寸,我们需要300/72像素每点,分辨率为300 dpi(每英寸像素数)。这意味着典型的12点字体的高度(或更准确地说,单行间距文本中的基线到基线距离)为50像素。

I think the more accurate term here is resampling. You want a pixel resolution high enough to support accurate OCR. Font size (e.g. in points) is typically measured in units of length, not pixels. Since 72 points = 1 inch, we need 300/72 pixels-per-point for a resolution of 300 dpi ("pixels-per-inch"). That means a typical 12-point font has a height (or more accurately, base-line to base-line distance in single-spaced text) of 50 pixels.

理想情况下,您的源文档应以适当的分辨率扫描给定的字体大小,以使图像中的字体高约50像素。如果分辨率太高/太低,您可以使用图形程序轻松重新采样图像(例如 GIMP ) 。您也可以通过图形库以编程方式执行此操作,例如 ImageMagick ,其中包含以下接口:许多编程语言。

Ideally, your source documents should be scanned at an appropriate resolution for the given font size, so that the font in the image is about 50 pixels high. If the resolution is too high/low, you can easily resample the image using a graphics program (e.g. GIMP). You can also do this programmatically through a graphics library, such as ImageMagick which has interfaces for many programming languages.

这篇关于如何放大图片以使其达到300 DPI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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