heaviside image edge sharpening - ualberta.cavzhao/temp/papers/mmsp15_127.pdf · (d) photoshopcs5...

5
Heaviside Image Edge Sharpening Liang-Jian Deng #1 , Weihong Guo *2 , Ting-Zhu Huang #3 , Xi-Le Zhao #4 # School of Mathematical Sciences, University of Electronic Science and Technology of China Chengdu, Sichuan, 611731, China. 1 [email protected] 3 [email protected] 4 [email protected] * Department of Mathematics, Case Western Reserve University Cleveland, OH, 44106, USA. 2 [email protected] Abstract—In this paper, we propose an automatic and efficient method to enhance edge sharpness of images. Starting from an image with blur edges, we improve the edges using transformed Heaviside functions for better visualization. In addition, we provide an efficient method to directly compute the scaling and shifting factors of the transformed Heaviside functions, so that blur edges can be improved accurately. Experimental results show that the proposed method is fast and can get sharper image edges than some recent state-of-the-art edge enhancement methods. We also apply the edge sharpening method to image super-resolution and obtained promising results. I. I NTRODUCTION Edge enhancement is a fundamental problem in image processing, computer graphics and computer vision. It tends to make the edges salient so that people can get better visualization for images/videos. Recently, many works about edge enhancement have been proposed. In [1], it develops many image filters to operate pixel intensities in space domain or pixel frequency in frequency do- main. The unsharp filter in MATLAB is to boost high-contrast region for edge sharpening, but it depends on the accuracy of parameter setting by users. Adobe Photoshop is a very popular commercial software for image processing. It also provides an edge sharpening filter for users and gets relatively good edge sharpening results. In [2], Xie et al. propose a gradient-domain edge sharpening filter to enhance the sharpness characteristics of an image effectively. The approach includes three gradient- domain operations, i.e., sharpness saliency representation, affinity-based gradient transformation and gradient-domain reconstruction. It can deal with noisy images. In [3], [4], He et al. propose a guided filter to deal with different image applications, including image enhancement, image feathering, image flash and image smoothing. The method is derived from a local linear model and theoretically connected with the matting Laplacian matrix [5]. In addition, other image filters for image edge enhancement also can be found from [6], [7], [8], [9], [10], [11], [12]. Cartoon images are mainly consisted of edges and piecewise constant intensities. It is thus effective to test the proposed MMSP’15, Oct. 19 - Oct. 21, 2015, Xiamen, China. (a) True (b) 08’TOG (c) Unsharp filter (d) PhotoshopCS5 (e) 13’TPAMI (f) Proposed Fig. 1. Compare results of the proposed method (f) with three other edge enhancement methods: Unsharp filter in MATLAB (c), PhotoshopCS5’s sharpen filter (d) and the guided filter “13’TPAMI” [4] (e). (a) is the ground- truth sharp image, (b) is the test image that has blur edges. Note that the proposed method preserves sharp image edges best. Readers are recommended to zoom in all figures for better visualization. method on cartoon images. Given a cartoon image with blur edges, the blur edges of this image are first detected and then improved using some transformed Heaviside functions. Starting from the Heaviside function, we analyze the rela- tion between the blur edges and the desired sharp edges to automatically compute the scaling and shifting factors of the Heaviside function to get the transformed Heaviside functions. The scaling and shifting factors describe the amplitude and the location of jumps respectively. The main contributions of the paper include three aspects: 1) To the best of our knowledge, this is the first work to utilize transformed Heaviside functions to sharpen blur image edges directly; 2) The proposed framework is simple and fast; 3) The method can get sharp cartoon image edges and it outperforms some recent state-of-the-art methods, e.g., “13’TPAMI” [4]. II. THE PROPOSED METHOD A. Heaviside function Heaviside function (also called Heaviside step function) is defined as: ϕ(x)=0 when x< 0 and ϕ(x)=1 when x 0. In particular, it has a singular point at x = 0. 978-1-4673-7478-1/15/$31.00 (c) 2015 IEEE

Upload: others

Post on 13-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Heaviside Image Edge Sharpening - ualberta.cavzhao/temp/Papers/MMSP15_127.pdf · (d) PhotoshopCS5 (e) 13’TPAMI (f) Proposed Fig. 1. Compare results of the proposed method (f) with

Heaviside Image Edge SharpeningLiang-Jian Deng #1, Weihong Guo ∗2, Ting-Zhu Huang #3, Xi-Le Zhao #4

# School of Mathematical Sciences, University of Electronic Science and Technology of ChinaChengdu, Sichuan, 611731, China.1 [email protected]

3 [email protected] [email protected]

∗ Department of Mathematics, Case Western Reserve UniversityCleveland, OH, 44106, USA.

2 [email protected]

Abstract—In this paper, we propose an automatic and efficientmethod to enhance edge sharpness of images. Starting from animage with blur edges, we improve the edges using transformedHeaviside functions for better visualization. In addition, weprovide an efficient method to directly compute the scaling andshifting factors of the transformed Heaviside functions, so thatblur edges can be improved accurately. Experimental resultsshow that the proposed method is fast and can get sharperimage edges than some recent state-of-the-art edge enhancementmethods. We also apply the edge sharpening method to imagesuper-resolution and obtained promising results.

I. INTRODUCTION

Edge enhancement is a fundamental problem in imageprocessing, computer graphics and computer vision. It tendsto make the edges salient so that people can get bettervisualization for images/videos.

Recently, many works about edge enhancement have beenproposed. In [1], it develops many image filters to operate pixelintensities in space domain or pixel frequency in frequency do-main. The unsharp filter in MATLAB is to boost high-contrastregion for edge sharpening, but it depends on the accuracy ofparameter setting by users. Adobe Photoshop is a very popularcommercial software for image processing. It also provides anedge sharpening filter for users and gets relatively good edgesharpening results. In [2], Xie et al. propose a gradient-domainedge sharpening filter to enhance the sharpness characteristicsof an image effectively. The approach includes three gradient-domain operations, i.e., sharpness saliency representation,affinity-based gradient transformation and gradient-domainreconstruction. It can deal with noisy images. In [3], [4], Heet al. propose a guided filter to deal with different imageapplications, including image enhancement, image feathering,image flash and image smoothing. The method is derivedfrom a local linear model and theoretically connected with thematting Laplacian matrix [5]. In addition, other image filtersfor image edge enhancement also can be found from [6], [7],[8], [9], [10], [11], [12].

Cartoon images are mainly consisted of edges and piecewiseconstant intensities. It is thus effective to test the proposed

MMSP’15, Oct. 19 - Oct. 21, 2015, Xiamen, China.

(a) True (b) 08’TOG (c) Unsharp filter

(d) PhotoshopCS5 (e) 13’TPAMI (f) Proposed

Fig. 1. Compare results of the proposed method (f) with three otheredge enhancement methods: Unsharp filter in MATLAB (c), PhotoshopCS5’ssharpen filter (d) and the guided filter “13’TPAMI” [4] (e). (a) is the ground-truth sharp image, (b) is the test image that has blur edges. Note that theproposed method preserves sharp image edges best. Readers are recommendedto zoom in all figures for better visualization.

method on cartoon images. Given a cartoon image with bluredges, the blur edges of this image are first detected andthen improved using some transformed Heaviside functions.Starting from the Heaviside function, we analyze the rela-tion between the blur edges and the desired sharp edges toautomatically compute the scaling and shifting factors of theHeaviside function to get the transformed Heaviside functions.The scaling and shifting factors describe the amplitude and thelocation of jumps respectively.

The main contributions of the paper include three aspects:1) To the best of our knowledge, this is the first work to utilizetransformed Heaviside functions to sharpen blur image edgesdirectly; 2) The proposed framework is simple and fast; 3) Themethod can get sharp cartoon image edges and it outperformssome recent state-of-the-art methods, e.g., “13’TPAMI” [4].

II. THE PROPOSED METHOD

A. Heaviside function

Heaviside function (also called Heaviside step function) isdefined as: ϕ(x) = 0 when x < 0 and ϕ(x) = 1 whenx ≥ 0. In particular, it has a singular point at x = 0.

978-1-4673-7478-1/15/$31.00 (c) 2015 IEEE

Page 2: Heaviside Image Edge Sharpening - ualberta.cavzhao/temp/Papers/MMSP15_127.pdf · (d) PhotoshopCS5 (e) 13’TPAMI (f) Proposed Fig. 1. Compare results of the proposed method (f) with

(a) (b) (c)

Fig. 2. (a) A smooth signal f(x) showing no obvious edge/jump. Forsimplicity, we refer to it as smooth edge; (b) Two kinds of Heaviside functionsare used to substitute the smoothing edge via scaling and shifting. In particular,we may find more details about why using two kinds of Heaviside functionsfrom the “substitution” in Section 2B; (c) The transformed Heaviside functionfnew(x) with a small ξ (see the blue z-shaped dotted line), it will substitutethe smoothing edge.

Fig. 3. The flow chart of our framework. (a) A Heaviside function ψ(x)with the sharp edge; (b) The scaled Heaviside function W (x) with a scalingfactor α; (c) Substituting the smoothing edge (black solid curve) usingthe final transformed Heaviside function g(X) (see more details from the“substitution” in Section 2B).

The Heaviside function perfectly describes a 1D signal withan amplitude 1 jump at location 0. In our work, we use acontinuous version of it to approximate sharp signal jumps.The continuous Heaviside function is defined as

ψ(x) =1

2+

1

πarctan(

x

ξ), (1)

which approximates to ϕ(x) when ξ → 0. The smaller ξthe sharper edge. For simplicity, we still call the continuousversion as Heaviside function. In the work, we employ twofunctions, i.e., ψ1(x) = ψ(x) and ψ2(x) = ψ(−x), tosubstitute the smoothing edge (see Fig. 2(b)).

B. 1D transformed Heaviside functions

To improve blur (or smoothing) edges by Heaviside func-tions, we take into account three points: 1) determining edgepoints; 2) selecting the suitable local domain to determinethe scaling and shifting factors of the transformed Heavisidefunctions; In particular, scaling is related to amplitude of thejump, and shifting is related to the location of the edge; 3)substituting smoothing edges by the transformed Heavisidefunctions.

Edge detection: As an important part of the proposedapproach, edges need to be detected accurately. Otherwise,artifacts will be created. Many edge detectors have beenproposed. Examples include “canny” detector, wavelet detector[13], shearlet detector [14], box spline detector [15], etc. Inour work, we select “canny” detector to explore edge pointsbecause it is simple and quite fast to run. Although “canny” de-tector is not always the most accurate edge detection method,it is good enough for the proposed method.

Scaling and shifting: In our work, we sharpen edges byreplacing it with transformed Heaviside functions. The scalingand shifting determine the amplitude and the location ofjumps. We present an automatic scheme to compute them. Fig.3 is a flow chart of the proposed framework. Starting from ablur signal (shown in Fig. 3(a)), we first take a sharp Heavisidefunction ψ(x) with a small ξ. Then the sharp Heavisidefunction ψ(x) is scaled by a scaling factor α (α ≥ 0) togenerate the following function,

W (x) = αψ(x). (2)

To get the scaling factor α, we search the minimal pointg1 and the maximal point g2 in the local domain Ω1 that isaround the edge point x1 (see Fig. 3(c)). The domain Ω1 isdefined as

Ω1 = [a, b] = [x1 − gap, x1 + gap], (3)

where gap is a predefined positive integer. In our work, weset gap as 3 empirically.

After defining Ω1, g1 and g2 can be found easily byminimizing and maximizing the intensity function f(x) in thedomain Ω1, respectively,

g1 = (x(1), ymin), g2 = (x(2), ymax), (4)

where x(1) = argminf(Ω1) ∈ Ω1, x(2) = argmaxf(Ω1) ∈ Ω1,and ymin = f(x(1)), ymax = f(x(2)). In particular, x(1) andx(2) are two points that close to x1.

We define α easily via ymin and ymax, that is

α = ymax − ymin. (5)

In addition, the shifting β ∈ R on y-direction is determinedby β = ymin. To get the shifting on x-direction, we defineanother domain Ω2 as

Ω2 = [xmin, xmax], (6)

where xmin = min(x(1), x(2)) and xmax = max(x(1), x(2)). Weset X = Ω2, then get the shifting x on x-direction,

x = X − x1. (7)

Substitution: The final transformed Heaviside function isas follows

g(X) =W (x) + β, (8)

where W (x) is given in Eq. (2). Note that if x(1) < x(2) in Eq.(4) (just like the case in Fig. 3), the Heaviside function ψ(x) =ψ1(x). Otherwise, ψ(x) = ψ2(x). Finally, we substitute theoriginal signal by the transformed Heaviside functions, e.g.,substituting the blur black solid signal with g(X) in Fig. 3(c).

Page 3: Heaviside Image Edge Sharpening - ualberta.cavzhao/temp/Papers/MMSP15_127.pdf · (d) PhotoshopCS5 (e) 13’TPAMI (f) Proposed Fig. 1. Compare results of the proposed method (f) with

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Fig. 4. The reason of employing max operator for 2D image extension. (a)Ix generated by applying 1D method to image row by row; (b) Iy generatedby applying 1D method to image column by column; (c) Our result byapplying max operator to Ix and Iy . (d) and (g) represent the intensitiesalong the green line and the yellow line centered at point p0, p1 respectivelyin (a). (e) and (f), (h) and (i) have same meanings with (d) and (g).

C. 2D image extension

In Section 2B, we have presented the proposed Heavisidesubstitution method for 1D signals. For a 2D image, wedirectly apply the proposed 1D method to it row by row toget the image Ix (see Fig. 4(a)) and then column by columnto obtain the other image Iy (see Fig. 4(b)). Ix and Iy maystill have blur edges. For instance, the edge around p1 in Ixand the edge around p0 in Iy show blur significantly. Thusafter getting Ix and Iy , we combine them to generate a betterresult. A simple max operator, that takes the maximal valuesof Ix and Iy , is employed to achieve this goal,

Ifinal = max(Ix, Iy), (9)

where Ifinal is the final resulted image with sharp edges. Inparticular, max operator is better than the straightforwardmethod that applies the proposed 1D method to column bycolumn of image Ix. Here, we also can use min operator thatstill can get similar results as that of max operator.

For the sake of illustration, we take two examples to presentthe reason of using max operator. After applying the maxoperator to the pair Fig. 4(d), (e) and pair Fig. 4(g), (h), weget the results in Fig. 4(f) and Fig. 4(i) respectively. Sharpjumps are observed in the 1D signals. The max operator leadsto sharp edges as shown in the blue and green boxes in Fig.4(c).

III. RESULTS

We compare the proposed method with three state-of-the-artimage edge enhancement methods: the unsharp filter in MAT-LAB, the PhotoshopCS5’s sharpen filter and the guided filter“13’TPAMI” [4]. Especially, we apply the proposed method

to image super-resolution application. Since the process ofgenerating high-resolution images from low-resolution imageswill lead to blur edges generally, we feed the intermediateresult to different edge enhancement methods to improve edgesand compare their performances.

In our numerical experiments, starting from an image werefer to as ground truth, we simulate a low resolution imageusing bicubic interpolation, then upsample the low-resolutionimage using a fast and effective super-resolution method“08’TOG” [16]. The high-resolution image by “08’TOG”generally contains blur edges and is viewed as input ofedge enhancement algorithms. In addition, we empirically setgap = 3, ξ = 5 × 10−3 in our experiments. For the “canny”detector, we could tune its parameters for better edge detection,but we only use the default parameters in MATLAB sinceit already can get relatively good results. For a color imageedge enhancement, we first transform it to YUV color spaceif not already so and then apply the proposed method tothe Y channel, the illuminance channel that is most sensitiveto human vision. Furthermore, all computation is done on alaptop with 3.47GB RAM, Inter(R) Core(TM) i3-2130CPU,@3.40GHz.

In Fig. 1 and Fig. 5, we compare the proposed method withsome competitive edge enhancement methods such as unsharpfilter in MATLAB (with default parameter), PhotoshopCS5’ssharpen filter and “13’TPAMI” (also called guided filter [4],and official code is available1). Note that we get the test imageswith blur edges (see Fig. 1(b) and Fig. 5(b)) by applying thesuper-resolution method “08’TOG” to low-resolution imageswith a upscaling factor of 4. In particular, readers are recom-mended to zoom in all figures for better visualization. In Fig. 1,the proposed method gets the best result while other methodseither sharpen the edges not so well or generate bad imagecontrast. From the first three rows of Fig. 5, the proposedmethod obtains sharper edges significantly than unsharp filterand PhotoshopCS5. For the method “13’TPAMI” (using thedefault parameter setting of the source code), it changes theoverall contrast significantly. For the fourth row of Fig. 5, theproposed method also can work for the natural image thatcontains large-scale edges and relatively piecewise constantintensities on the non-edge region. From the example, onecan see that our method performs better than other methodsfrom the perspective of edge enhancement.

In Fig. 6, we compare our method with three state-of-the-art methods from the perspective of image super-resolution,i.e., a reconstruction method “08’TOG”2 [16], a deep learningmethod “14’ECCV”3 [17] and an interpolation and recon-struction based method “14’TIP”4 [18]. For the proposedmethod, we first get the intermediate high-resolution imagesby “08’TOG” [16]. After the process, we apply our edgesharpening method to the intermediate high-resolution images

1http://research.microsoft.com/en-us/um/people/kahe/eccv10/index.html2executable:http://www.cse.cuhk.edu.hk/∼leojia/projects/upsampling/index.

html3code:http://research.microsoft.com/en-us/um/people/kahe/4code:http://www.escience.cn/people/LingfengWang/publication.html

Page 4: Heaviside Image Edge Sharpening - ualberta.cavzhao/temp/Papers/MMSP15_127.pdf · (d) PhotoshopCS5 (e) 13’TPAMI (f) Proposed Fig. 1. Compare results of the proposed method (f) with

Fig. 5. Results from the perspective of edge enhancement. (a) True images (b) Test images by applying the super-resolution method “08’TOG” to low-resolution images with a factor of 4 (containing blur edges); (c)-(f): Results of unsharp filter in MATLAB, PhotoshopCS5’s sharpen filter, “13’TPAMI” (alsocalled Guided filter [4]) and the proposed method.

to generate the final high-resolution images. Note that allexamples are with the upscaling factor of 4. From the figures,one can see that “08’TOG” and “14’ECCV” cause blur aroundimage edges (see the close-ups in blue and green boxes).“14’TIP” gets sharp image edges but makes the non-edgeregion over-smoothing. In addition, “14’ECCV” shows ringartifacts along the edges, especially for the second example inFig. 6. In general, the proposed method leads to sharper edgesand better intensity variation away from edges.

The proposed method is fast. With the current very pre-liminary non-optimized Matlab code, it takes about 3 secondsto compute the 1280 × 800 result in the third example ofFig. 5 while it takes 1.5 seconds for “13’TPAMI” whoseimplementation is optimized.

IV. CONCLUSIONS

In the paper, we presented a simple but efficient approachfor image edge sharpening. Starting from an image with bluredges, we enhanced image edges using transformed Heavisidefunctions. Automatic selection of parameters such as scalingand shifting factors is discussed as well. Experiments showedthat the proposed method obtained significantly sharper image

edges than three recent state-of-the-art edge enhancementmethods. In addition, we also compared the proposed methodwith some competitive approaches from the perspective ofimage super-resolution, and it performed better than thesesuper-resolution approaches.

ACKNOWLEDGMENT

The first, third and fourth authors thank China 973Program (2013CB329404), NSFC (61370147, 61170311,61402082), Sichuan Province Sci. & Tech. Research Project(2012GZX0080) for funding. The second author thanks USNIH 1R21EB016535-01 for partial support.

REFERENCES

[1] R. C. Gonzalez and R. E. Woods, “Digital Image Processing,” Addison-Wesley (2nd Edn.), Boston, 2001.

[2] Z. F. Xie, R. Lau, Y. Gui, M. G. Chen, and Z. Ma, L, “A gradient-domain-based edge-preserving sharpen filter,” Vis. Comput., vol. 28, pp.1195–1207, 2012.

[3] K. He, J. Sun, and X. Tang, “Guided Image Filtering,” EuropeanConference on Computer vision (ECCV), 2010.

[4] ——, “Guided Image Filtering,” IEEE. Trans. Patt. Anal. MachineIntell., vol. 35, pp. 1397–1409, 2013.

Page 5: Heaviside Image Edge Sharpening - ualberta.cavzhao/temp/Papers/MMSP15_127.pdf · (d) PhotoshopCS5 (e) 13’TPAMI (f) Proposed Fig. 1. Compare results of the proposed method (f) with

(a) LR (b) 08’TOG (c) 14’ECCV

(d) True (e) 14’TIP (f) Proposed

(a) LR (b) 08’TOG (c) 14’ECCV

(d) True (e) 14’TIP (f) Proposed

Fig. 6. Results from the perspective of image super-resolution with theupscaling factor of 4. Compared methods: “08’TOG” [16], “14’ECCV” [17]and “14’TIP” [18]

[5] A. Levin, D. Lischinski, and Y. Weiss, “A closed form solution to naturalimage matting,” CVPR, 2006.

[6] M. Elad, “On the origin of the bilateral filter and ways to improve it,”IEEE Trans. Image Process, vol. 11, pp. 1141–1151, 2002.

[7] Z. Farbman, R. Fattal, D. Lischinski, and R. Szeliski, “Edge-preservingdecompositions for multi-scale tone and detail manipulation,” ACMTrans. Graph. (TOG), 2008.

[8] R. Fattal, “Edge-avoiding wavelets and their applications,” ACM Trans.Graph. (TOG), vol. 28, pp. 1–10, 2009.

[9] C. Tomasi and R. Manduchi, “Bilateral filtering for gray and colorimages,” International Conference on Computer Vision (ICCV), 1998.

[10] S. Paris, S. W. Hasinoff, and J. Kautz, “Local Laplacian filters:edgeaware image processing with a Laplacian pyramid,” ACM Siggraph,2011.

[11] X. Zeng, W. Chen, and Q. Peng, “A novel variational image model:towards a unified approach to image editing,” J. Comput. Sci. Technol.,pp. 224–231, 2006.

[12] P. Bhat, B. Curless, M. Cohen, and C. L. Zitnick, “Fourier analysis of the2d screened Poisson equation for gradient domain problems,” EuropeanConference on Computer Vision (ECCV), 2008.

[13] S. Mallat, “Characterization of signals from multiscale edges,” IEEE.Trans. Patt. Anal. Machine Intell., vol. 14, pp. 710–732, 1992.

[14] S. Yi, D. Labate, R. Easley, and H. Krim, “A shearlet approach to edgeedge analysis and detection,” IEEE Trans. Image Processing, vol. 18,pp. 929–941, 2009.

[15] W. Guo and M. Lai, “Box spline wavelet frames for image edge analysis,” SIAM J. Imaging Science, vol. 6, pp. 1553–1578, 2013.

[16] Q. Shan, Z. Li, J. Jia, and C. Tang, “Fast Image/Video Upsampling,”ACM Transactions on Graphics (TOG), vol. 27, 2008.

[17] C. Dong, C. Loy, K. He, and X. Tang, “Learning a Deep ConvolutionalNetwork for Image Super-Resolution,” European Conference on Com-puter Vision (ECCV), 2014.

[18] L. Wang, H. Wu, and C. Pan, “Fast image upsampling via the displace-ment field,” IEEE Trans. Image Processing, vol. 23, pp. 5123–5135,2014.