Image resizing is a common operation in digital image/video processing. An interpolation process is often involved in resizing. Filters such as box (e.g., nearest-neighbor interpolation), tent (e.g., bilinear interpolation), cubic spline (e.g., bicubic interpolation) and a variety of kernels approximating the sinc function have been popular solutions for image interpolation. Among these approaches, the Lanczos filter, a windowed form of the sinc filter, may provide a sharper output than common bilinear or bicubic interpolation. Moreover, the Lanczos filter may be considered to be an effective compromise in terms of aliasing, ringing, and sharpness compared to other approaches.
For an N-lobed Lanczos-windowed sinc function, its oscillation nature can induce a ringing effect and the negative values in the resulting kernel can produce undershoot (i.e., the output is lower than the input). The ringing effect often appears as artificial rings near edges.
A preferred embodiment is now described with reference to the figures, where like reference numbers indicate identical or functionally similar elements. Also in the figures, the leftmost digit of each reference number corresponds to the figure in which the reference number is first used. While specific configurations and arrangements are discussed, it should be understood that this is done for illustrative purposes only. A person skilled in the relevant art will recognize that other configurations and arrangements can be used without departing from the spirit and scope of the description. It will be apparent to a person skilled in the relevant art that this can also be employed in a variety of other systems and applications other than what is described herein.
Disclosed herein are methods and systems to blend the interpolation results from a Lanczos filter and the interpolation results from a bilinear filter. The blending may be done adaptively, according to the local transitions of the input content. Undershoot may occur, which accentuates transitions in images and can be beneficial for generating sharper scaled images. However, it may produce artifacts in certain patterns as well. Detection and correction of this kind of artifact may be performed.
A system that may perform this process is shown in
Bilinear filtering module 220 and Lanczos filtering module 225 may each provide respective resized images to blending module 240. In order to perform blending of these inputs, blending module 240 may also require local content information provided by local content analysis module 245. Local content analysis module 245 may generate the local content information on the basis of pixels identified by a sampling window module 210. These pixels may be viewed as the window of pixels surrounding the pixel coordinate identified by sample point locator module 215.
The blending module 240 may provide filtering results to output module 255. The output module 255 may generate a scaled image composed of pixels 260. In order to generate this scaled image, output module 255 may rely on information provided by detection and correction module 250. This latter module may identify and correct artifacts that are found in the blended output of module 240. In the illustrated embodiment, detection and correction module 250 may also take advantage of local content information produced by local content analysis module 245. The scaled image composed of pixels 260 may then be sent to a display device for viewing, or may be sent to a memory device for storage and/or additional subsequent processing.
Note that, in general, an interpolator includes two components, a horizontal interpolator and a vertical interpolator. In
In the case of horizontal interpolation, as in the case of vertical interpolation, the sample point locator module first determines the two pixels between which the center pixel is located. In the example of
yiB=xi0*(1−iphase)+xi1*iphase.
Here, both iphase and 1−iphase are between 0 and 1. yiB may therefore be viewed as a weighted sum of xi0 and xi1.
The realization of yi using an 8-tap Lanczos filter may be calculated as
yiL=Σxikhkiphase where k=−3,−2, . . . , 4.
Here, hkiphase is the sample from the 4-lobed Lanczos-windowed function
hkiphase=(sin π[(k−iphase)*sf]/π[(k−iphase)*sf])(sin π[((k−iphase)/4)*sf]/π[((k−iphase)/4)*sf]) when |k−iphase)*sf|<4, and
hkiphase=0 when |(k−iphase)*sf|>=4.
In the above expressions, sf represents the scaling factor.
Blending yiB and yiL may maintain the sharpness that comes from Lanczos filtering while reducing the ringing effect. Such blending may result in the realization of yi as
yiBL=αi*yiL+(1−αi)*yiB,
where αi=f(xi−3, xi−2, xi−1, xi0, xi1, xi2, xi3, xi4) and α may be a function of local content. In an embodiment, αi may be defined as follows:
αi=max(D′,D″),
where
D″=max(|ik−ik+1|), where kε−2, −1, 0, . . . 4,
D′=min(D1, D2),
D1=min[max(|Xi1−Xi2|,|Xi0−Xi1|), max(|Xi1−Xi2|,|Xi2−Xi3|)], and
D2=[Xi1+Xi1−2Xi0]+[2Xi2−Xi1−Xi3].
Once blending is complete, the determination may be made as to whether a pixel yiBL represents an artifact. If the pixel is determined to be an artifact, then the pixel may be replaced by the pixel, for the same location, that had resulted from application of the bilinear filtering, yiB. In an implementation, detection of an artifact at yiBL may result in the setting of a flag. For any pixel where such a flag is set, the pixel may be replaced by the pixel yiB that resulted from application of the bilinear filtering. Stated more formally, for the output pixel yiout,
yiout=yiB if flag(yi)=1, and
yiout=yiBL if flag(yi)=0
In an embodiment, a pixel may be determined to be an artifact by applying the test illustrated in
At 410, a determination may be made as to whether the following is true:
|yiL−yiB|>f1(Xi−3,Xi−2, . . . , Xi3,Xi4).
If not, then flag(yi) may be given a value 0 at 470, and the process concludes at 480. If this expression is true, the process may continue at 420.
At 420, a determination may be made as to whether the following is true:
|Xi0−Xi1|<f2(Xi−3,Xi−2, . . . , Xi3,Xi4).
If not, then flag(yi) may be given a value 0 at 470, and the process may conclude at 480. If this expression is true, the process may continues at 430.
At 430, a determination may be made as to whether the following is true:
|Xi0−Xi−1|>f3(Xi−3,Xi−2, . . . , Xi3,Xi4).
If not, then flag(yi) may be given a value 0 at 470, and the process may conclude at 480. If this expression is true, the process may continue at 440.
At 440, a determination may be made as to whether the following is true:
sign[(Xi0−Xi−1)*h−1iphase]<0.
If not, then flag(yi) may be given a value 0 at 470, and the process may conclude at 480. If this expression is true, the process may continue at 450.
At 450, a determination may be made as to whether the following expression is true:
!{[|Xik−1−Xk|>f4(Xi−3,Xi−2, . . . , Xi3,Xi4)] & [∥Xik−1−Xik|−|Xi0−Xi−1∥>f5(Xi−3,Xi−2, . . . , Xi3,Xi4)]}
The functions f1 through f6 may be defined as functions of (Xi−3, Xi−2, . . . , Xi3, Xi4) as indicated above. Alternatively, f1 through f6 may be given predefined constant values. In an embodiment,
f1=64,
f2=16,
f3=20,
f4=20,
f5=10, and
f6=1.
Note that the application of 410-440 may capture interpolated pixels with large undershoot values in certain image patterns, such as smooth regions with some regular thin strips. The application of 450 may, for other image patterns, perform protection of undershoot values to maintain sharpness.
One or more features disclosed herein may be implemented in hardware, software, firmware, and combinations thereof, including discrete and integrated circuit logic, application specific integrated circuit (ASIC) logic, and microcontrollers, and may be implemented as part of a domain-specific integrated circuit package, or a combination of integrated circuit packages. The term software, as used herein, refers to a computer program product including a computer readable medium having computer program logic stored therein to cause a computer system to perform one or more features and/or combinations of features disclosed herein.
A software embodiment is illustrated in the context of a computing system 500 in
Computer program logic may include modules 550 and 560, according to an embodiment. Blending logic 550 may be responsible for blending the outputs of an interpolation process that uses bilinear filtering, and an interpolation process that uses 8-tap Lanczos filtering. The blending process is described above, according to an embodiment. Artifact detection and correction logic 560 may be responsible for evaluating pixels that are output from blending logic 550. In this evaluation, a determination may be made for each pixel as to whether the pixel represents an artifact. Details of this determination are described above with respect to
In an embodiment, the resulting image, with artifacts corrected, may be sent to I/O 530, which may include a display on which the image may be displayed. Alternatively, the image may be sent to a memory device for storage.
Methods and systems are disclosed herein with the aid of functional building blocks that illustrate the functions, features, and relationships thereof. At least some of the boundaries of these functional building blocks have been arbitrarily defined herein for the convenience of the description. Alternate boundaries may be defined so long as the specified functions and relationships thereof are appropriately performed.
While various embodiments are disclosed herein, it should be understood that they have been presented by way of example only, and not limitation. It will be apparent to persons skilled in the relevant art that various changes in form and detail may be made therein without departing from the spirit and scope of the methods and systems disclosed herein. Thus, the breadth and scope of the claims should not be limited by any of the exemplary embodiments disclosed herein.
Number | Name | Date | Kind |
---|---|---|---|
6456339 | Surati et al. | Sep 2002 | B1 |
6593925 | Hakura et al. | Jul 2003 | B1 |
7187811 | Lin et al. | Mar 2007 | B2 |
7502505 | Malvar et al. | Mar 2009 | B2 |
7519235 | Georgiev | Apr 2009 | B1 |
7545957 | Cornog et al. | Jun 2009 | B2 |
7693350 | Shimizu | Apr 2010 | B2 |
7876979 | Lee et al. | Jan 2011 | B2 |
20050078883 | Yi | Apr 2005 | A1 |
20090123089 | Karlov et al. | May 2009 | A1 |
20100254630 | Ali et al. | Oct 2010 | A1 |
20110150354 | Huang | Jun 2011 | A1 |
20120082396 | Crandall et al. | Apr 2012 | A1 |
Number | Date | Country |
---|---|---|
1041511 | Sep 2001 | EP |
1041511 | Sep 2001 | EP |
Number | Date | Country | |
---|---|---|---|
20110216985 A1 | Sep 2011 | US |