数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

数字图像处理锐化的原理

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

Image sharpening might just be the most underutilized digital photography trick this side of studying the histogram. Read on as we explain what image sharpening is, why we need it, what it does, and why you should be liberally applying it to your own images to banish fuzzy edges and make your images pop.

在研究直方图的这一方面,图像锐化可能只是利用最多的数码摄影技巧。 在我们解释什么是图像锐化,为什么需要它,它做什么以及为什么应该将它*地应用到自己的图像上以消除模糊边缘并使图像弹出时,请继续阅读。

为什么图像恰恰是模糊的? (Why Exactly Are Images Fuzzy in the First Place?)

Before we dig into how to sharpen your images it is important to understand exactly why digital images even require sharpening in the first place. Digital images, both those created in a digital camera and by scanning images to create digital copies of analog works, suffer from limitations imposed by the digital device’s sensor.

在我们研究如何锐化图像之前,重要的是要准确地理解为什么数字图像甚至首先需要锐化。 数字图像,无论是在数码相机中创建的图像还是通过扫描图像以创建模拟作品的数字副本的数字图像,都受到数字设备传感器施加的限制。

While the limitations of the sensors in comparison with the human eye are numerous there is one particular limitation that creates overly soft or fuzzy images. The human eye is able to distinguish lines of contrast with incredible clarity and sharpness. The sensor of a digital camera, however, is limited by the number of pixels, or points of data, it can collect.

尽管与人眼相比,传感器的局限性很多,但存在一种特别的局限性,即会产生过于柔和或模糊的图像。 人眼能够以令人难以置信的清晰度和清晰度区分对比线。 但是,数码相机的传感器受到它可以收集的像素数或数据点的限制。

When the scene before it is higher resolution than it can capture (which it always is) it is forced to capture the average of what the individual pixels on the sensor see. The result is a fuzzing of images as the camera (or scanner) is forced to do the best it can with the limited amount of data it can capture.

当其之前的场景的分辨率高于其可以捕获的分辨率(通常是这样)时,它将*捕获传感器上各个像素所见的平均值。 结果是图像模糊不清,因为相机(或扫描仪)*在有限的可捕获数据量下尽其所能。

Let’s look at some digital mockups of this phenomenon to demonstrate the effect before moving on to working with actual photos. In the image below we’ve divided the space into two triangles, one black and one white.

在继续处理实际照片之前,让我们看一下这种现象的一些数字模型,以证明这种效果。 在下图中,我们将空间分为两个三角形,一个黑色和一个白色。

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

When viewed at a distance on your typical screen it looks like one crisp and continuous line between the black and white sections. Let’s pretend for the sake of demonstration that the image above is not a digital picture presented to you on a digital screen but the intersection of two spaces in the real world. Say two halves of a canvas that have been painted with extreme precision such that, even when viewed at a very close distance with a magnifying glass in hand, the line remains crisp and distinct. This line, then, is resolved by our eyes to its maximum resolution and we perceive it as very sharp and crisp.

在典型屏幕上远距离观看时,黑色和白色部分之间看起来像一条清晰而连续的线。 为了演示起见,我们假装上面的图像不是在数字屏幕上呈现给您的数字图片,而是现实世界中两个空间的交集。 说出两等分的油画,它们以极高的精确度进行了绘制,因此,即使使用放大镜在很近的距离处观看,线条仍保持清晰鲜明。 然后,这条线被我们的眼睛分辨为最大分辨率,我们认为它非常清晰锐利。

Let’s view the same mockup of two triangles as if it were captured by a very low-resolution image sensor. While the image above contains nearly 200,000 pixels, the image below is a representation of black and white space as if the degree of resolution was barely over 200 pixels.

让我们查看两个三角形的相同模型,就好像它们是由非常低分辨率的图像传感器捕获的一样。 尽管上面的图像包含近200,000像素,但是下面的图像代表了黑白空间,好像分辨率只有不到200像素。

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

We know if the delineating line between the white and black area is razor sharp to the human eye then it should be razor sharp in the camera, right? The problem is when that razor sharp delineation is so fine it passes through a given pixel on the camera’s sensor the individual pixel cannot say, “OK, half of me is white, half of me is black.”

我们知道,如果白色和黑色区域之间的轮廓线对人眼来说很锋利,那么在相机中应该也很锋利,对吗? 问题是,当剃刀的锐利轮廓非常精细时,它会穿过相机传感器上的给定像素,而单个像素不能说:“好,我一半是白人,一半是黑色。”

It can only record a single value for the entire pixel. As such it is forced to say, “OK, the average of the light hitting me is gray” because it cannot record part black and part white but merely the average of the photons hitting the individual pixel.

它只能记录整个像素的单个值。 因此,不得不说:“好的,打到我身上的光的平均值是灰色的”,因为它不能记录部分黑色和白色,而只能记录到单个像素的光子的平均值。

The more pixels you pack into a sensor the more detail you can resolve, but ultimately there comes a point in every digital image creation where the incoming data (the light bouncing off the subject being photographed or the photo being scanned) exceeds the capability of the sensor, the individual pixels are resigned to selecting a best-estimate-shade, and the contrast between the edges is blurred.

装在传感器中的像素越多,您可以解决的细节就越多,但是最终在每个数字图像创建中都会出现一点,即传入的数据(从被摄物体或正在扫描的照片反射回来的光)超出了图像处理能力。传感器,将各个像素指定为选择最佳估计阴影,并且边缘之间的对比度模糊。

使用不清晰的蒙版修复模糊照片 (Fixing Fuzzy Photos with the Unsharp Mask)

Now that we know what causes fuzzy photos, let’s look at what you can do to fix the issue and give your images a sharpness that really helps them pop (whether you’re framing them or uploading them to Facebook).

现在我们知道了导致照片模糊的原因,让我们看看如何解决此问题并为图像提供清晰的清晰度,可以真正帮助它们弹出(无论是构图还是将其上传到Facebook)。

Fortunately for us the concept we just outlined in the previous section is well known and understood in the photographic community and there are multiple ways to approach correcting it. The most common way, and the way we’ll focus on today, is applying what is known as an “unsharp mask.”

对我们来说幸运的是,我们在上一节中概述的概念在摄影界已广为人知和理解,并且有多种方法可以对其进行校正。 最常见的方式以及我们今天将重点关注的方式是应用所谓的“不清晰蒙版”。

The counterintuitively named unsharp mask becomes a little more intuitively named if you understand how the process works. When you apply the unsharp mask to an image the editing application creates a temporary mask used to compare which areas of of the image are sharp (with high contrast) and unsharp (with low contrast). It then sharpens the unsharp areas (using that mask as a guide) until it difference between the high contrast and low contrast areas have equalized per the specification of the user. Thus, the unsharp mask isn’t an unsharpening tool, as the name might imply at first glance, but a tool that tells you which parts of the image are unsharp and corrects them.

如果您了解该过程的工作原理,则反直觉命名的锐化蒙版会更直观地命名。 当您将不清晰的蒙版应用于图像时,编辑应用程序会创建一个临时蒙版,用于比较图像的哪些区域清晰(具有高对比度)和不清晰(具有低对比度)。 然后,它会锐化不清晰的区域(以该蒙版为指导),直到高对比度区域和低对比度区域之间的差值已根据用户的要求进行了补偿。 因此,反锐化蒙版并不是一个锐化工具,顾名思义,它并不是一个锐化工具,而是一个告诉您图像的哪些部分不锐化并进行校正的工具。

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

Let’s enlist the help of our friendly office dog Cricket, seen above, to demonstrate exactly how the unsharp mask works and the adjustments we can make to it. Although we’ll be using Adobe Photoshop for the demonstration today the unsharp mask tool is found in a wide variety of image editing applications as it is something of an industry standard. The terms and methods you’ll see here apply just as readily to free editing solutions like GIMP as they do to Photoshop.

让我们征集上面所见的友好的办公室狗cket的帮助,以准确演示不清晰的蒙版如何工作以及我们可以对其进行的调整。 尽管今天我们将使用Adobe Photoshop进行演示,但是在各种图像编辑应用程序中都发现了锐化蒙版工具,因为它是行业标准。 您将在此处看到的术语和方法就像适用于GIMP的免费编辑解决方案一样,也适用于Photoshop。

First, let’s study the photo. The image above, straight from the camera without any editing, is simply reduced in size for insertion into this article. Nothing wrong with the photo at all. The subject is centered, the face of the subject is in focus, there’s nothing particularly objectionable about it (unless, you know, you don’t care for small dogs). But let’s zoom in and take a look at the image in closer detail.

首先,让我们研究照片。 上面的图像直接来自相机,没有任何编辑,只是将尺寸减小了,可以插入本文。 照片完全没错。 主题居中,主题面部清晰,没有什么特别令人讨厌的(除非您知道,您不在乎小狗)。 但是,让我们放大并更仔细地查看图像。

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

When we get in really close, it becomes obvious that the image is very soft looking. That’s not the fault of the lens (we shot this image with a very sharp prime lens) but a side effect of the way the image is processed in camera, as we previously discussed.

当我们真正靠近时,很明显图像看起来很柔和。 如前所述,这不是镜头的问题(我们使用非常锋利的定焦镜头拍摄了此图像),而是在相机中处理图像的方式的副作用。

To sharpen the image, let’s fire up the unsharp mask. First, prepare for the unsharp mask by adjusting your image to either 100 percent or 50 percent zoom; anti-aliasing algorithms in use by both the editor and your operating system can distort the effects of the sharpening process at other zoom levels.

要锐化图像,让我们启动不清晰的蒙版。 首先,通过将图像调整为100%或50%缩放来准备不清晰的蒙版; 编辑器和操作系统同时使用的抗锯齿算法可以使锐化过程在其他缩放级别上的效果失真。

In Photoshop you’ll find it under Filters ->Sharpen -> Unsharp Mask.

在Photoshop中,可以在“滤镜”->“锐化”->“锐化蒙版”下找到它。

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

As we mentioned above, the appearance of the unsharp mask tool is fairly universal and you’ll find the three settings, Amount, Radius, and Threshold, regardless of the image editing tool you’re using. The easiest way to understand what they do is to simply play around with them, but we’ll highlight the key points here.

如上所述,不清晰的蒙版工具的外观相当通用,无论使用哪种图像编辑工具,您都可以找到三个设置:数量,半径和阈值。 了解他们的工作的最简单方法是简单地与他们一起玩耍,但是我们将在此处重点介绍要点。

Amount: Always listed as a percentage, the amount indicates the degree of adjustment (how much light the lighter edges get and how dark the darker edges get). At the low end of the adjustment it’s difficult to notice but when you max it out the contrast becomes very extreme. 50-100 percent is a safe place to start.

数量:始终以百分比形式列出,该数量表示调整的程度(较浅边缘得到多少光,较暗边缘得到多少暗)。 在调整的低端,很难注意到,但是当您将其最大化时,对比度变得非常极端。 50-100%是一个安全的起点。

Radius: Specifies how large an area around each corrected point the effect is applied. The radius and the amount are intertwined; if you reduce your Amount value you can increase your Radius value (and vice versa). Increasing both to high levels will lead to significant color and contrast distortion (which may be a desirable artistic effect but will not make for a natural looking image).

半径:指定要应用效果的每个校正点周围的面积。 半径和数量交织在一起; 如果减少金额值,则可以增加半径值(反之亦然)。 将两者都增加到高水平将导致明显的色彩和对比度失真(这可能是理想的艺术效果,但不会使图像看起来自然)。

Threshold: The threshold function determines where the sharpening algorithm will be applied based on a minimum brightness/contrast level. This particular setting is very useful for selectively increasing contrast in high contrast areas (such as around the eyes) but not over-sharpening areas you want to leave smooth (such as skin on the face). The lower the value the more the image will be uniformly sharpened. The higher the value the more areas will be excluded. Thus, if you wanted the whole image to have the sharpening effect applied as uniformly as possibly you would set it to zero and if you wanted to sharpen the details on a subject’s face (like the pattern of their iris and eye lashes) without making their pores and wrinkles stand out, you would increase the value until you achieved the desired balance.

阈值:阈值功能基于最小亮度/对比度级别确定将在哪里应用锐化算法。 此特定设置对于在高对比度区域(例如,眼睛周围)有选择地增加对比度非常有用,但对于想要保持平滑的过度锐化的区域(例如,脸上的皮肤)而言,则不是非常有用。 值越低,图像将越清晰均匀。 值越高,将排除的区域越多。 因此,如果您希望整个图像尽可能均匀地应用锐化效果,则可以将其设置为零,并且如果要锐化主体面部的细节(例如虹膜和睫毛的图案)而又不使其毛Kong和皱纹脱颖而出,您可以增加其价值,直到达到所需的平衡。

You’ll also notice that we have the little preview window also set to 50 percent (the same anti-aliasing issues apply both to previewing the whole image and to previewing the image in the Unsharp Mask box.

您还将注意到,我们的小预览窗口也设置为50%(相同的抗锯齿问题适用于预览整个图像和“不清晰蒙版”框中的图像预览。

Applying the settings we have above (100/4/3 for this particular image) significantly sharpens the image; let’s take a look at the exact same crop we did above to see the difference.

应用上面的设置(此特定图像为100/4/3)可以使图像锐化; 让我们来看看上面所做的完全相同的作物,以了解差异。

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

Seen close up, the changes are readily apparent. There is a much higher contrast around the eyes, the highlights in the eyes are sharper, and the fur of the muzzle and face is more distinct.

看起来很近,这些变化显而易见。 眼睛周围的对比度更高,眼睛的高光更清晰,枪口和脸部的毛发更加明显。

When viewed with the same crop as the original retouched image the changes are less dramatic (as they are not seen in such a close up manner) but they make the details in the image, like the fur around the muzzle, stand out.

当以与原始润饰图像相同的裁剪查看时,变化不太明显(因为无法以近距离的方式看到它们),但是它们使图像中的细节(如枪口周围的毛皮)突出。

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

That’s the real goal of sharpening an image. You want to recreate the sharpness of the actual subject as seen with the human eye but not create such intense and noticeable contrast that the viewer wonders what kind of manipulation was performed on the photo.

那是锐化图像的真正目的。 您想要重现人眼所见的实际主体的清晰度,但又不想产生如此强烈和明显的对比度,以至于观看者不知道对照片进行了哪种操作。

While we’re looking at the photo, it’s important to point out what the unsharp mask cannot do. It makes the focused area of a photo look better focused by sharpening up the edges and giving it a crisp look but it cannot add in detail that doesn’t exist. You’ll notice that in the above photo the eyes, muzzle, and nose became sharper (as well as the fur of the surrounding face) but the leash, concrete, moss, and leaves did not. Those objects were so far out of focus in the original photograph that no amount of sharpening could create even the illusion of them being in the focal plane.

在查看照片时,务必指出不清晰的蒙版无法完成的工作。 通过锐化边缘并赋予其清晰的外观,可以使照片的聚焦区域看起来更好地聚焦,但是无法添加不存在的细节。 您会注意到,在上一张照片中,眼睛,枪口和鼻子变得更加锋利(以及周围脸部的毛皮),但皮带,混凝土,苔藓和树叶却没有。 这些物体在原始照片中的焦点太远了,以至于锐化都不会产生任何幻觉,即使它们在焦平面中也是如此。

锐化蒙版技巧和窍门 (Unsharp Mask Tips and Tricks)

Although people and animals benefit from application of the unsharp mask (especially around the eyes which look much better when crisp and bright instead of soft focused) the unsharp mask really helps just about every image pop.

尽管人和动物都受益于使用不清晰蒙版(特别是在眼睛周围,当眼睛明亮而明亮时看起来更好,而不是柔焦),但不清晰蒙版确实可以帮助几乎所有弹出的图像。

数字图像处理锐化的原理_数字图像锐化的工作原理以及为什么要使用它

In the comparison above, for example, there’s nothing wrong with the image on the left but once the softness is corrected for with the unsharp mask the increased contrast in the right image really helps the image stand out and gives it a nice crisp appearance.

例如,在上面的比较中,左侧图像没有任何问题,但是一旦使用了不鲜明的蒙版校正了柔软度,右侧图像中增强的对比度确实有助于图像突出并提供清晰的外观。

To get the most from your unsharp mask application, regardless of the subject, let’s run through some tips and tricks that ensure the sharpening process is a smooth one.

为了从不清晰的蒙版应用程序中获得最大收益,而不论主题如何,让我们来看一些技巧和窍门,以确保锐化过程是一个平滑的过程。

Disable in-camera sharpening. Above all else you want to disable in-camera sharpening. Point and shoot cameras almost always have onboard sharpening whereas high-end DSLR cameras rarely do (the presumption on the the part of the manufacturer is that the point and shoot user will not be doing any post-processing work whereas the owner of the DSLR most likely will). Photos double processed with an unsharp mask tend to look pretty awful so it’s best if you disable in-camera and fine tune the sharpening on your computer.

禁用相机内锐化。 首先,您要禁用相机内锐化。 傻瓜相机几乎总是在板上锐化,而高端数码单反相机很少这样做(制造商方面的假设是傻瓜用户将不进行任何后期处理工作,而数码单反相机的所有者则是大多数可能会)。 使用不清晰的蒙版进行双重处理的照片看起来非常糟糕,因此最好禁用相机内的摄像头并对其进行微调。

Focus is king. A crisp physical focus in the camera is worth more than any unsharp mask can give you. Perfect your focus skills (and ditch your lens if its loose and soft in focus). As we mentioned above there’s no magical way to use the unsharp mask to expand or fix the focal plane of a photo; you can only sharpen what is already in focus.

焦点为王。 相机中清晰的物理焦点比任何不清晰的蒙版都能给您带来更多的价值。 完善您的对焦技巧(如果镜头松散而柔和,则不使用它)。 正如我们上面提到的,没有任何一种神奇的方法可以使用模糊蒙版来扩展或固定照片的焦平面。 您只能锐化已经聚焦的内容。

Less is more. Use the unsharp mask just enough to give the image a little pop. Think of the difference between looking at a 1080p display and a 4K display. The 1080p image is beautiful and very much high definition (compared to old standard definition televisions) but the 4K has this sharpness that just bursts right off the screen. When you’re adjusting and comparing your photos you want to capture just-right sharpness increase that moves the image from “Yeah, that’s nice.” to “Wow, that’s crisp.” It’s a fine line, though; once you hit that sweet spot further increasing the sharpening often yields an uncanny to outright unnatural looking image.

少即是多。 刚好使用不清晰的蒙版以使图像有点弹出。 考虑一下观看1080p显示器和4K显示器之间的区别。 1080p图像很漂亮,并且具有很高的清晰度(与旧的标清电视相比),但是4K的清晰度却恰到好处地在屏幕上突然破裂。 在调整和比较照片时,您想要捕获恰到好处的清晰度,从而将图像从“是的,很好。” 改为“哇,真好吃。” 不过,这是一条好线; 一旦达到最佳效果,锐化效果通常会进一步提高,从而使图像看起来异常自然。

Sharpen last. If you’re doing any other image editing, color adjustment, fixing dust, or stuck pixels, or otherwise editing the image, you always save the sharpening process for last. Think of sharpening an image as polishing a piece of jewelry after you’ve finished working on it. It’s the last step after every piece is placed, every bit of metal bent and soldered, and the it’s ready for the gallery.

最后锐化。 如果您要进行其他图像编辑,颜色调整,固定灰尘或残留的像素,或以其他方式编辑图像,则始终保留最后的锐化过程。 在完成处理后,将锐化图像视为抛光珠宝。 这是摆放每件作品,弯曲并焊接每块金属之后的最后一步,并且已准备就绪供画廊使用。

Armed with an understanding of the sharpening process and how to best take advantage of it, you’re ready to apply it to your own photos to turn good (albeit soft) photos into eye catching ones that really pop off the screen, living room wall, or wherever they should find themselves.

了解了锐化过程以及如何最好地利用它之后,您就可以将其应用于自己的照片,以将优质(尽管柔和)的照片变成引人注目的照片,这些照片确实会从屏幕,客厅墙壁上弹出,或者他们应该找到自己的地方。



Have a pressing question about image editing, photography, or getting the most from your digital camera? Shoot us an email as [email protected] and we’ll do our best to answer it.

对于图像编辑,摄影或从数码相机中获得最大收益,有一个紧迫的问题吗? 向我们发送电子邮件,电子邮件为[email protected],我们将尽最大努力予以答复。

翻译自: https://www.howtogeek.com/215920/htg-explains-what-digital-image-sharpening-is-and-why-you-should-be-doing-it/

数字图像处理锐化的原理