EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM …liris.cnrs.fr/Documents/Liris-5953.pdf ·...

6
EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM LOW DEPTH OF FIELD IMAGES Hubert Konik and Natalia Neverova Laboratoire Hubert Curien – UMR CNRS 5516, University Jean Monnet, Saint-Étienne, France Email: [email protected] ABSTRACT This paper presents a method for extracting blur/sharp regions of interest (ROI) that benefits of using a combination of edge and region based approaches. It can be considered as a pre- liminary step for many vision applications tending to focus only on the most salient areas in low depth-of-field images. To localize focused regions, we first classify each edge as either sharp or blurred based on gradient profile width esti- mation. Then a mean shift oversegmentation allows to la- bel each region using the density of marked edge pixels in- side. Finally, the proposed algorithm is tested on a dataset of high resolution images and the results are compared with the manually established ground truth. It is shown that the given method outperforms known state-of-the-art techniques in terms of F-measure. The robustness of the method is con- firmed by means of additional experiments on images with different values of defocus degree. Index TermsSaliency, segmentation, edge detection, blur/sharp estimation 1. INTRODUCTION Visual attention aspects play an important role in many com- puter vision applications. The initial objective of saliency es- timation is to locate regions of interest (ROI) in images in order to increase efficiency of content-based image retrieval, compression, auto-cropping or object recognition. The idea is based on a commonly used assumption that the most amount of information about an image content is concentrated in the most salient areas of the image. Consequently, a large num- ber of methods in the field of visual communications and image processing could be improved if the location of such specific regions is known a priori. Generally speaking, the most classical models define saliency based on color, texture and orientation. However, aside from the fact that the gen- erated saliency maps usually have a lower resolution com- pared with input images, these models do not take into ac- count some important visual effects. For instance, in the case of so-called low depth-of-field (DOF) images, objects in fo- cus appear to be sharp and visually attractive, while blurred Fig. 1. (a) Blurred and (b) sharp regions with corresponding shapes of (c) blurred and (d) sharp edge intensity profiles. background does not immediately draw the conscious atten- tion of the viewer. In that context, [1] have recently experimentally shown this precise influence of the sharp/blur aspect of an image part on its saliency. These results indicate that blur information might be integrated in attention models to efficiently improve the extraction of salient regions. In fact, sharp objects tend to capture attention irrespective of intensity, color or contrast. There have been a number of methods proposed for salient region extraction, some of which are in the context of low depth of field images. All of them, to varying degrees, ex- ploit an assumption that focused regions contain more high- frequency components than the defocused background. For example, [2] propose a computational Markov random field formulation for generating a defocus map, where each im- age pixel is then considered independently and claimed to be either salient or not based on a preliminary set value of threshold. Unfortunately, there is no detailed information on

Transcript of EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM …liris.cnrs.fr/Documents/Liris-5953.pdf ·...

Page 1: EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM …liris.cnrs.fr/Documents/Liris-5953.pdf · EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM LOW DEPTH OF FIELD IMAGES Hubert

EDGE-BASED METHOD FOR SHARP REGION EXTRACTIONFROM LOW DEPTH OF FIELD IMAGES

Hubert Konik and Natalia Neverova

Laboratoire Hubert Curien – UMR CNRS 5516, University Jean Monnet, Saint-Étienne, FranceEmail: [email protected]

ABSTRACT

This paper presents a method for extracting blur/sharp regionsof interest (ROI) that benefits of using a combination of edgeand region based approaches. It can be considered as a pre-liminary step for many vision applications tending to focusonly on the most salient areas in low depth-of-field images.To localize focused regions, we first classify each edge aseither sharp or blurred based on gradient profile width esti-mation. Then a mean shift oversegmentation allows to la-bel each region using the density of marked edge pixels in-side. Finally, the proposed algorithm is tested on a datasetof high resolution images and the results are compared withthe manually established ground truth. It is shown that thegiven method outperforms known state-of-the-art techniquesin terms of F-measure. The robustness of the method is con-firmed by means of additional experiments on images withdifferent values of defocus degree.

Index Terms— Saliency, segmentation, edge detection,blur/sharp estimation

1. INTRODUCTION

Visual attention aspects play an important role in many com-puter vision applications. The initial objective of saliency es-timation is to locate regions of interest (ROI) in images inorder to increase efficiency of content-based image retrieval,compression, auto-cropping or object recognition. The idea isbased on a commonly used assumption that the most amountof information about an image content is concentrated in themost salient areas of the image. Consequently, a large num-ber of methods in the field of visual communications andimage processing could be improved if the location of suchspecific regions is known a priori. Generally speaking, themost classical models define saliency based on color, textureand orientation. However, aside from the fact that the gen-erated saliency maps usually have a lower resolution com-pared with input images, these models do not take into ac-count some important visual effects. For instance, in the caseof so-called low depth-of-field (DOF) images, objects in fo-cus appear to be sharp and visually attractive, while blurred

Fig. 1. (a) Blurred and (b) sharp regions with correspondingshapes of (c) blurred and (d) sharp edge intensity profiles.

background does not immediately draw the conscious atten-tion of the viewer.In that context, [1] have recently experimentally shown thisprecise influence of the sharp/blur aspect of an image parton its saliency. These results indicate that blur informationmight be integrated in attention models to efficiently improvethe extraction of salient regions. In fact, sharp objects tend tocapture attention irrespective of intensity, color or contrast.There have been a number of methods proposed for salientregion extraction, some of which are in the context of lowdepth of field images. All of them, to varying degrees, ex-ploit an assumption that focused regions contain more high-frequency components than the defocused background. Forexample, [2] propose a computational Markov random fieldformulation for generating a defocus map, where each im-age pixel is then considered independently and claimed tobe either salient or not based on a preliminary set value ofthreshold. Unfortunately, there is no detailed information on

Page 2: EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM …liris.cnrs.fr/Documents/Liris-5953.pdf · EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM LOW DEPTH OF FIELD IMAGES Hubert

Fig. 2. Block diagram of our algorithm.

the method performance or comparison with alternative tech-niques. In [3], the authors introduce the orientation angleof the gradient map to model the focus energy and evalu-ate the boundary and region saliencies respectively. Finally,some post-treatments are proposed to isolate sharp objects us-ing a boundary linking method (at cost of processing time).In [4], the authors present a machine learning based approachto identify focused objects using multiple segmentations andvisual descriptors computation. However, all these methodsdo not explicitly involve edge processing, while, accordingto [5], the edge information may appear to be especially im-portant for the precise saliency-based segmentation.In this paper, we present a simple and effective bottom-upprecise segmentation of low depth-of-field images. First, weuse the shape of the edge gradient profile at each particularedge point to classify edge sharpness. After that, an imagemean shift oversegmentation in texture space coupled with aset of classification rules allows to precisely localize the fo-cused objects on the blurry background.The remainder of this paper is organized as follows: section 2describes the proposed framework. Then, section 3 providessome experimental results and illustrates the method perfor-mance in comparison with several alternative state-of-the-arttechniques over an established ground truth of images. Fi-nally, conclusions and future work are provided in section 4.

2. OUR METHOD

The proposed approach is based on the idea that the edgewidth (and the corresponding shape of the edge gradientprofile) at each particular edge point can be considered as afunction of the degree of blur in a given image region. In ourcase, by the term ”gradient profile” we mean a distribution ofimage gradient magnitude in the vicinity of a local maximum(”edge pixel”) taken in the direction of the maximum rate ofchange at this point.According to [6], the shape of the gradient magnitude distri-bution around edges in natural images is reasonably stableand generally obeys the generalized Gaussian distribution

(a) Original image (b) ”Sharp” edges (c) ”Blurred” edges

(d) Segmentation (e) Mask (f) Final result

Fig. 3. Example of intermediate results.

with parameter λ ≈ 1.6 regardless of the image resolution.The sharper the edge, the smaller is the variance of the edgegradient profile distribution (Fig. 1).In this work, we estimate the edge sharpness at each edgepoint (x0, y0) calculating the standard deviation of the edgegradient profile p(x0, y0) [6].

σ(p(x0, y0)) =

√√√√∑(x,y)∈p(x0,y0)||G(x, y)|| · l2(x, y)∑

(x,y)∈p(x0,y0)||G(x, y)|| , (1)

where ||G(x, y)|| is the gradient magnitude and l(x, y) is thedistance between each point (x, y) and the edge point.An overview of our method is sketched in Fig. 2. Some in-termediate results obtained in each step of the process for oneimage from our database are provided in Fig. 3. All steps willbe discussed in more detail in the following sections.

2.1. Edge detection

Since the quality of the edge extraction and localization iscrucial for our method, we have adapted the Canny detectorto be capable of using color information.The Canny detector requires computing the convolution of animage with a Gaussian Kσ0 , then with its first derivative alongeach spatial direction {x, y} [7]. It can easily be done for eachcolor plane in the straightforward way, using RMS to combinethe obtained results for three color components. Let us denotethe result of double convolution as Fc,d, where c stands for thecolor component and d for the spatial direction:

F{r,g,b},x = [({R,G,B} ∗Kσ0(x)) ∗Kσ0(y)] ∗∂

∂xKσ0(x);

F{r,g,b},y = [({R,G,B} ∗Kσ0(x)) ∗Kσ0(y)] ∗∂

∂yKσ0(y).

Letting r, g and b be unit vectors along the R, G and B axesof RGB color space, we define the following quantities [8]:

f{x,y} = Fr,{x,y}r+ Fg,{x,y}g + Fb,{x,y}b,

Page 3: EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM …liris.cnrs.fr/Documents/Liris-5953.pdf · EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM LOW DEPTH OF FIELD IMAGES Hubert

p(x,y)

g�’’

g xx’

g yy’

�’

lx

ly

l�

x

y

�’

Fig. 4. Edge gradient calculation.

g{xx,yy} = ||f{x,y}|| =√F 2r,{x,y} + F 2

g,{x,y} + F 2b,{x,y},

gxy =√fx · fy =

√Fr,xFr,y + Fg,xFg,y + Fb,xFb,y .

In this case, considering the result of convolution to be ap-proximately corresponding to the image gradient, the direc-tion of maximum rate of change is calculated by [8]

θ(x, y) =1

2arctan

(2g2xy

g2xx − g2yy

), (2)

The magnitude of the rate of change (”edge strength”) in thegiven direction can be calculated by

gθ =

√(g2xx+ g2yy) + (g2xx− g2yy)cos 2θ+ 2g2xysin2θ

2. (3)

The final steps of edge extraction are performed in standardway following the procedure of the original Canny algorithm.

2.2. Gradient profile analysis

To estimate the edge width at each edge point, it is neces-sary to analyze an undistorted gradient distribution, wherethe original shape of the gradient profile around edges is pre-served (consequently, the smooth gradient map obtained inthe previous step cannot be used). Here we calculate a simpleimage gradient and denote it as g ′

θ′ [8].In the next step the proposed algorithm requires sampling thegradient magnitude g ′

θ′ along the direction of maximum rateof change θ′. To avoid additional computations, [9] proposedto analyze the gradient magnitude profile in the horizontal andvertical directions and then, if needed, use their properties onthe specified maximum gradient direction. Given the gradientdistributions along the horizontal and vertical axis (g ′

xx andg′yy respectively) and edge width in the corresponding direc-tions (lx and ly respectively), the actual edge width lθ′ can becalculated by (see Fig. 4)

lθ′ =g′xxg′θ′

· lx =g′yyg′θ′

· ly. (4)

The same relation holds for the standard deviation σθ′ repre-

Fig. 5. Width estimation of the edge gradient profile.

senting edge ”sharpness” (the standard deviation in this caseis defined by (1)):

σθ′ =g′xxg′θ′

· σx(px(x0)) =g′yyg′θ′

· σy(py(y0)), (5)

where σx(px(x0)) and σy(py(y0)) correspond to the standarddeviation of gradient profiles along the horizontal and verticaldirections respectively, which are calculated by (see [9])

σx(px(x0)) =

√(∑

x∈p(x0)

g′xxl2x)/(

∑x∈p(x0)

g′xx),

σy(py(y0)) =

√(∑

y∈p(y0)

g′yyl2y)/(

∑y∈p(y0)

g′yy).

Since for our purposes we localize edges using the Canny de-tector, obtained edge points do not necessarily correspondto pixels with maximum values of the gradient magnitude(Fig. 5). For this reason, before performing the gradient pro-file analysis, we find a local maximum in the chosen gradientdirection. If this maximum point cannot be reached withinthe specified distance from a ”canny” pixel, the latter one istaken out of consideration as an edge detector error.As soon as the local maximum is reached, the gradient profilecan be analyzed by exploring magnitude values on both sideof this point along the given direction. Fig. 5 illustrates theidea how to do it using two stopping criteria.First, we consider only pixels with intensities not smaller thanthe selected minimum level (as a fraction of the maximumvalue). Second, it is necessary to ”cut” the profile if thereis another edge nearby setting a maximum positive deviationthreshold. In our implementation we set these two parametersequal to 10% and 0.05 respectively.Due to presence of noise, influence of nearby edges, errors ofthe Canny detector, etc., the σθ′ values even for neighboringedge pixels can vary greatly. To get a more reliable classifi-cation and compensate for these negative effects, for furtherprocessing we replace the actual values of σθ′ with an averagevalue along each edge.

Page 4: EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM …liris.cnrs.fr/Documents/Liris-5953.pdf · EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM LOW DEPTH OF FIELD IMAGES Hubert

Fig. 6. Comparison of the results obtained with differentmethods on the given dataset

2.3. Segmentation

Since after the segmentation step it will be necessary to assigna label to each region (either ”sharp” or ”blurred”) consider-ing it as a single entity, the undersegmentation and combiningdifferent objects into one region are unacceptable. To avoidthis problem, we oversegment the image using a mean shift al-gorithm [10], which provides accurate boundaries between re-gions. The segmentation is performed in texture space, whereeach feature plane is obtained with one of Laws’ texture en-ergy filters applied to each of RGB color planes.

2.4. Classification

In the final stage of the algorithm we classify all previouslyobtained regions into 2 classes (”sharp” or ”blurred”) basedon the presence of ”sharp” and ”blurred” edges inside eachsegment. For each region we calculate a set of the follow-ing features: center of mass coordinates, region area, averageRGB values, average values for each Laws’ textures compo-nent for intensity channel.The further classification is based on the following logic:

• If there is only one kind of edge pixels inside the region,the region area is greater than 64 pixels and the densityof edge pixels is greater than the minimum value be-tween 0.015 and 90% of the average edge pixel density,this region is labeled in accordance with edge labels.

• If one kind of edge pixels is in absolute majority (theratio between the number of pixels belonging to twocategories is greater than 10), the region area is greaterthan 64 pixels and the edge pixel density is greater thanthe maximum value between 0.015 and 90% of the av-erage edge pixel density, region label will correspondto the label of the majority of edge pixels.

• Else (small or sparse regions, containing different kindsof edge pixels), the label is assigned based on labels ofk nearest neighbors already having labels (the classifi-cation is based on the set of features defined above).

3. EXPERIMENTAL RESULTS

The proposed algorithm has been tested on a dataset of 112high resolution images having a great variety in content, col-ors, textures, numbers of sharp and blurred regions, their areaand location1. All parameters were optimized in advance andthe experiments were conducted automatically, with no man-ual tuning from image to image. To illustrate the performanceof the proposed algorithm in comparison with known state-of-the-art techniques, we used the same dataset to test 6 alter-native methods: Achanta et al. [11], Achanta and Susstrunk[12], Graf et al. [13], Zhang et al. [14], Kim [15], Li andNgan [16]. We refer these methods as EP, FL, MU, FZ, MRan VD, respectively.The performance of all algorithms was estimated in terms ofrecall, precision and F-measure (with β = 1). Fig. 6 containsthe summarized diagram, which demonstrates that our algo-rithm outperforms the alternative techniques mentioned aboveon the given dataset and in terms of the given quality mea-sures. The main advantage of our method is a possibility toreach great values of recall and precision simultaneously andin the absolute majority of cases. Examples of images fromthe dataset together with the manually created ground truthbinary masks and masks obtained with our and state-of-the-art methods are shown in Fig. 8. Subjectively, our approachyields the most visually plausible results regardless of imagesize, content and complexity.To evaluate the robustness of our method, we have conductedsome additional experiments on images with different valuesof defocus degree. We used several image sequences withmanually blurred background (using Gaussian filters with dif-ferent parameters), as well as images of several scenes takenwith a camera with differing aperture settings. Defocus de-gree for each image of each sequence was calculated by

D =meansharp(g

′θ′)

meanblurred(g′θ′).

A typical graph of F-measure vs. defocus degree for one im-age sequence is shown in Fig. 7. It illustrates the fact thatstarting from a certain relative degree of blur between ”sharp”and ”blurred” objects present within the scene, our methodprovides confident segmentation with an asymptotically in-creasing F-measure. The observed general behavior holds forall tested image sequencies, either synthetic or natural.

4. CONCLUSION

In this paper, we presented an efficient unsupervised methodfor salient object extraction in low depth-of-field images. Ourapproach is based on edge analysis and the assumption thatblurred edges are generally wider than the sharp ones. Itwas experimentally shown that in comparison with alternative

1http://dossier.univ-st-etienne.fr/konikhub/public/Database/blur-sharp.zip

Page 5: EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM …liris.cnrs.fr/Documents/Liris-5953.pdf · EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM LOW DEPTH OF FIELD IMAGES Hubert

1.5 2.0 2.5 3.53.0 4.0 4.5 5.0 5.51.0

Fig. 7. Illustration of our algorithm performance on a se-quence of images with different defocus degrees.

frameworks, this method achieves higher recall and precisionrates simultaneously and in the absolute majority of cases.In future work, we first aim to explore the effect of restrictingsome image processing techniques to selected image regions,which is necessary in such applications as saliency-aware im-age and video coding and retrieval. Moreover, encouraged bythe high performance of the proposed method, we plan to in-troduce its results to improve visual attention models with ageneral framework taking this blur/sharp aspect into account.

5. REFERENCES

[1] Hubert Konik, Rizwan Ahmed Khan, and Eric Dinet,“Visual attention: effects of blur,” IEEE InternationalConference On Image Processing (ICIP), pp. 3350–3353, 2011.

[2] Yu-Wing Tai and Michael S. Brown, “Single image de-focus map estimation using local contrast prior,” IEEEInternational Conference On Image Processing (ICIP),pp. 1797–1800, 2009.

[3] Zhi Liu, Weiwei Li, Liquan Shen, Zhongmin Han, andZhaoyang Zhang, “Automatic segmentation of focusedobjects from images with low depth of field,” PatternRecognition Letters, vol. 31, no. 7, pp. 572–581, 2010.

[4] Hongliang Li and King N. Ngan, “Learning to ExtractFocused Objects from Low DOF Images,” IEEE Trans-actions on Circuits and Systems for Video Technology,vol. 21, no. 11, pp. 1571–1580, 2011.

[5] Cairong Zhao, ChuanCai Liu, Zhihui Lai, and JingyuYang, “Sparse Embedding Visual Attention SystemsCombined with Edge Information,” IEEE InternationalConference on Pattern Recognition (ICPR), pp. 3432–3435, 2010.

[6] Jian Sun, Zongben Xu, and Heung-Yeung Shum, “Im-age super-resolution using gradient profile prior,” IEEEConference on Computer Vision and Pattern Recogni-tion (CVPR), pp. 1–8, 2008.

[7] John Canny, “A Computational Approach to Edge De-tection,” IEEE Transactions on Pattern Analysis andMachine Intelligence, vol. PAMI-8, no. 6, pp. 679–698,Nov. 1986.

[8] Silvano Di Zenzo, “A note on the gradient of a multi-image,” Computer Vision, Graphics, and Image Pro-cessing, vol. 33, no. 1, pp. 116–125, May 1986.

[9] Luhong Liang, Jianhua Chen, Siwei Ma, Debin Zhao,and Wen Gao, “A no-reference perceptual blur metricusing histogram of gradient profile sharpness,” IEEEInternational Conference On Image Processing (ICIP),pp. 4369–4372, 2009.

[10] Christopher M. Christoudias, Bogdan Georgescu, andPeter Meer, “Synergism in low level vision,” IEEE In-ternational Conference on Pattern Recognition (ICPR),pp. 150–155, 2002.

[11] Radhakrishna Achanta, Sheila Hemami, FranciscoEstrada, and Sabine Süsstrunk, “Frequency-tunedsalient region detection,” IEEE Conference on Com-puter Vision and Pattern Recognition (CVPR), pp.1597–1604, 2009.

[12] Radhakrishna Achanta and Sabine Süsstrunk, “Saliencydetection using maximum symmetric surround,” IEEEInternational Conference On Image Processing (ICIP),pp. 2653–2656, 2010.

[13] Franz Graf, Hans-Peter Kriegel, and Michael Weiler,“Robust segmentation of relevant regions in low depthof field images,” IEEE International Conference on Im-age Processing (ICIP), pp. 2861–2864, 2011.

[14] KeDai Zhang, HanQing Lu, ZhenYu Wang, Qi Zhao,and MiYi Duan, “A fuzzy segmentation of salient re-gion of interest in low depth of field image,” Proceed-ings of the 13th international conference on MultimediaModeling - Volume Part I, pp. 782–791, 2006.

[15] Changick Kim, “Segmenting a low-depth-of-field imageusing morphological filters and region merging,” IEEETransactions on Image Processing, vol. 14, no. 10, pp.1503–1511, Oct. 2005.

[16] Hongliang Li and King N. Ngan, “Unsupervized videosegmentation with low depth of field,” IEEE Transac-tions on Circuits and Systems for Video Technology, vol.17, no. 12, pp. 1742–1751, 2007.

Page 6: EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM …liris.cnrs.fr/Documents/Liris-5953.pdf · EDGE-BASED METHOD FOR SHARP REGION EXTRACTION FROM LOW DEPTH OF FIELD IMAGES Hubert

Image Ground truth EP FL MU FZ MR VD Our method

Fig. 8. Examples of the results given by different methods together with the established ground truth.