Abstract
Image retargeting is devoted to preserve the visual content of images with a proper resizing, removing vertical and/or horizontal paths of pixels which contain low semantic information. In this paper, a method based on the Generalised Gradient Vector Flow (GGVF) is presented. The GGVF formulation allows the balancing of the smoothing term and data term of the flow by proper parameter tuning. The proposed approach has been tested by considering a data set of 1000 images and varying the percentage of resizing from 10% to 50% and for different values of the aim involved parameter K. Results show that our algorithm better preserves the important information compared to GVF and Seam Carving approaches. Preliminary results show an underlying relation between parameter K and the percentage of resizing has been also exploited.
You have full access to this open access chapter, Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
In the last years, with the improvement of technology, many display devices are built with different resolution. This increases the request of image resizing techniques aimed to guarantee the quality of salient visual information. The aim of content-aware image resizing is the reduction of the overall number of pixel of a given image, while preserving the content and aspect ratio of the depicted objects. The problem of image retargeting is defined as follows. Given an image I of size \(H \times W\), the purpose is to map it in a new image \(I'\) of size \(H \times W'\) (\(H' \times W\) in horizontal case), with \(0< W'<W\) (\(0< H'<H\)), where \(W'\) is defined as \(W'=W-N\) (\(H'=H-N\)) and N is the number of paths to be removed. The two simplest techniques to resize an image are cropping and uniform scaling but they introduce deformation or distortion of the subjects. Moreover, these methods do not take into account the content of the image (i.e., the semantic).
In 2007, Avidan et al. [1] proposed the seam carving technique, which consists in finding proper pixel paths (called seams) which are related to background or other parts not related to the semantic of the picture. In the last years, several methods have been proposed. To establish the paths to be considered during the resizing, in [2], a method based on the Gradient Vector Flow (GVF) of the image is presented. The authors also proposed an approach which takes into account the visual saliency properties of the images, to find an optimal path in the resizing space. GVF, introduced in [14], is computed as a diffusion of the gradient vectors of a gray-level or binary edge map computed from the image. Xu et al. [15] proposed a method that generalises the GVF formulation, called Generalised Gradient Vector Flow (GGVF), to improve active contour (snake) convergence to long, thin boundary indentations, while maintaining other desirable properties of GVF. In particular, they add two weighting coefficients which can be dynamically changed in the image region. In [18] and [19] GGVF is improved in term of noise robustness, weak edge preserving and convergence, for the task of medical image segmentation. To solve the high computational cost of GVF, virtual electric field (VEF) [7] and its extension [16] have been proposed. The hypothesis of these methods is that each pixel of an image is an electron and all pixels generate a virtual electric filed.
Many approaches try to combine different techniques to resize images and define new metrics to measure the quality of proposed methods. In [5], an algorithm which iteratively applies seam carving, cropping, warping, and scaling is proposed. Structural Similarity Metric (i.e., SSIM) is adopted to measure the similarity between original and retargeted images. The work in [13] combines several resizing operators and defines a new image similarity measure which is used with a dynamic programming algorithm whereas in [12], the authors present a comprehensive perceptual study and analysis of image retargeting. The authors of [12] propose a metric that can predict human retargeting perception. A measure that simulates the human vision system is also proposed in [10]. In particular, global topological property is the core of the method and image scale space is considered to extract the global geometric structures from retargeted images. In [11], a real-time approach based on axis-aligned deformation space is introduced. It minimizes convex energy under feasible constraints with the aim to guarantee the convergence of the method and the quality of the results. In [6], a metric that measures the geometric distortion of a retargeted image based on the local variance of SIFT flow [9] vector fields of the image is presented. To measure the quality of retargeted image, the work in [8] proposes an objective quality assessment method which takes account the following factor: preservation of saliency regions, symmetry and global structure, influence od introduced artifacts and aesthetics.
In the last years, deep neural network models have been considered for image resizing. The work in [3] proposes a weakly- and self-supervised deep Convolutional Neural Network (CNN) that takes a source image and a target aspect ratio as input. In [17], it is presented a perceptually aware model that reduces the dimension of the original photo/video by deeply encoding human gaze shifting sequences. Even if CNN based methods show encouraging results, the end-to-end approach implemented by such encoder-decoder models creates a new image with a pre-defined aspect ratio, without any knowledge about the process that determined the pixels that have been removed.
In this paper, we present a new method for image retargeting which is based on GGVF. We assess and investigate the importance of one of the main involved parameter (K) of GGVF, which balances the smoothing term and data term. The proposed approach has been compared with respect to a method based on GVF [2] and a seam carving approach [1] for different values of percentage of resizing. Experimental results demonstrate the relation between K and the scale factor of retargeting. They also show that the proposed method is able to overcome some difficulties of method based on GVF.
The paper is organised as follows. In Sect. 2, the comparison between GVF and GGVF is introduced and our algorithm is detailed. Section 3 presents and discuss the results. Finally, conclusions and hints for future works are given in Sect. 4.
2 Proposed Method
Gradient Vector Flow [14] is a force field \(\mathbf F \) of vector \(\mathbf v (x,y)=[\textit{u}(x,y),\textit{v}(x,y)]\) that minimizes the following energy function:
where \(\mu \) is a regularisation parameter that controls the trade-off between the first term, called smoothing term, and the second term, named data term, in the integrand. The terms \(\textit{u}_x, \textit{v}_x, \textit{u}_y, \textit{v}_y\) indicate the partial derivatives along x and y axes, f is an edge map of the input image, \(|\nabla f|\) is the gradient of f and \(\nabla ^2\) is the Laplacian operator. If \(|\nabla f|\) is close to zero, the energy E in Eq. 1 is dominated by \(\mu \nabla ^2 \mathbf v \), hence GVF is a slowly varying field. On the other hand, when this quantity is large the values of GVF field are close to \(|\nabla f|\) and presents slow variations in homogeneous regions.
To solve the difficulty of GVF in driving a path into long and thin indentations that could be due to the smoothing of the field near the boundaries, \(\mu \) and \(|\nabla f|^2\) are replaced by generic weighting coefficients. Therefore, GGVF field [15] is the equilibrium solution of the following partial differential equation:
To preserve the proprieties of GVF, the weighting function \(g(\cdot )\) and \(h(\cdot )\) should be monotonically non-increasing and non-decreasing functions of \(|\nabla f|\), respectively. These coefficients are spatially varying, since they depend on the gradient of the edge map which is spatially dependent. In our experiments, the following function [15] are used:
where the parameter K balances the smoothing term and data term. Hence, the deformation curve can converge rapidly in the flat field and protect weak borders. Figure 1 shows the output of GGVF applied on a test image for different values of K. As we can observe, the value of K affects the both the gradient distribution and intensity.
In this paper, the magnitude of GGVF is used to detect the seams to be removed. So, fixed K, the proposed algorithm computes GGVF and its normalisation from the input image I that was previously converted from RGB to grey scale. The seams are built starting from the top of the image and following the direction of the normalisation of GGVF, in order to preserve edges and propagates their contributions in the neighbouring pixels, by creating a repulsive field. A cost \(c_t\) is associated to each seam \(s_t\) by the following equation:
The seam with the lower cost is hence removed from the image at each iteration. The GGVF map is then updated and a new iteration of the seam removal algorithm is performed for each seam to be removed. Such heuristic is partially inspired by the work in [2].
To drive the selection of seam to be removed and to maintain the strong edges of the images and propagates their contributions also in their neighbouring, the proposed method exploits the properties of the GGVF field without considering all the possible paths, as GVF approach present in [2]. GGVF comprises two weighting functions that are dependent on the gradient of the edge map, this guarantees the dynamic change of the field in each image region.
3 Results
In the experimental evaluation, we compared the proposed method with respect to the GVF scheme paired with seam carving approach [2] and only seam carving technique [1] on a dataset used in [2] and [4] which is composed by 1000 images, including several scenes and objects which appear in multiple instances and in different locations of the image. For each image I, the dataset provides the ground-truth map which denotes the pixels of the areas containing the main salient objects (i.e., the parts of the image that we want to preserve after the resizing). In our experiments, we evaluated the GGVF algorithm with several values of K, namely 0.001, 0.05, 0.75, 1, 1.25 whereas the parameter \(\mu \) of GVF is set to 0.1 as in [2]. The three retargeting approaches have been tested at varying the percentage of resizing from 10% to 50%. Figure 2 shows the progressive resizing of a sample image.
Figures 3 and 4 report some image examples obtained by resizing images with a scale factor of 30% and 50%, respectively, with respect the original resolution of the processed image. The three algorithms have different behaviours. In particular, comparing the seems generated by the proposed algorithm (\(3^{th}\) column) and the ones generated by the GVF scheme (\(5^{th}\) column) or by the seam carving approach (\(7^{th}\) column), is possible to observe that the methods of the state of the art remove information from the object introducing deformations and distortions on the image, whereas the GGVF approach preserves the visual content of the scene by maintaining both size of the objects and the details related the visual stimuli of textures and edges.
To evaluate the performance of our algorithm for different values of K, the corresponding binary mask is used. Indeed, the same seams of the input image are removed from each mask and then the remaining pixels are counted. This number is compared with GVF results. More specifically, let N be the total number of images in the dataset (i.e., \(N=1000\)). Let \(T=\{x:n^{GGVF}\ge n^{GVF} \}\) be the set of images such that the number of pixels of the binary mask removed with our approach \(n^{GGVF}\) is greater or equal to the number of pixels removed with approach based on GVF \(n^{GVF}\). Based on these variables, the following evaluation score is computed:
where |T| is the cardinality of set T, and N is the total number of images in the dataset.
Figures 7 and 8 show the obtained scores for each evaluation setting and the trend of this evaluation score by varying the value of K. The achieved results suggest that the best values of K are 0.75 and 1 if the percentages of resizing are in the range [10%–30%], whereas for larger scale factor (40% or 50%), the best values of parameter K are 0.05 and 0.001, respectively. Therefore, it seems that there is an inversely proportional relationship between K and the percentage of resizing.
Furthermore, for each i-th image, we considered the number of pixels in its binary mask \(p_i^{bm}\) and the number of successfully preserved pixels after the application of the Seam Carving (SC), the GVF and the GGVF methods, denoted as \(n_i^{SC}\), \(n_i^{GVF}\) and \(n_i^{GGVF}\) respectively. The quality of a resized image is evaluated by considering the ratio between \(n_i^{m}\) and \(p_i^{bm}\):
where \(m\in \{SC, GVF, GGVF\}\) is the resizing method applied to the input image. Based on these definitions, the following evaluation score is computed:
Figure 9 shows the achieved experimental results in terms of average \(Score_{2}\), by varying the resizing factor and the value of K. Figure 10 shows how the value of K affects the performances, depending on the resizing factor. The achieved results suggest that there is a relationship between K and the percentage of resizing. However, when the resizing factor is set to extreme values, the performances start to decrease after a certain value of K (see Fig. 10).
Figure 5 shows three examples with a scale factor of 40%. The \(2^{th}\) and \(4^{th}\) columns show the results obtained by GGVF (with the best choice for K), by GVF and by Seam Carving respectively. The values reported under each image are the cost obtained with Eq. 7. The \(5^{th}\) column highlights how our approach better preserves the main object of the input image with respect to other algorithms (\(6^{th}\) and \(7^{th}\) column). Although the proposed method achieves interesting performances compared to the state of the art approaches, some challenging cases have been found, as shown in the Fig. 6. As we can observe, GGVF, GVF and seam carving methods do not preserve the main object introducing distortions with respect to the original image. However, the performances in terms of cost (i.e., Eq. 7) show that the proposed approach still achieves better performances compared to GVF.
4 Conclusions
This paper addresses the problem of content-aware image resizing. The proposed work evaluates the generalised version of the Gradient Vector Flow approach (i.e., GGVF) which allows the adaptation of the algorithm parameters. Indeed, the experiments shown that with a proper parametrization, the GVF and seam carving approaches are outperformed by its generalised version. According to our hypothesis, the GGVF can be controlled by varying the parameter K. Moreover, this parameter can be properly tuned based on the percentage of resizing. Our experiments demonstrated that a good choice of K can be a critical factor, and that there is a relationship between the percentage of resizing and the optimal K value. Moreover, our experiments considered extreme percentage values of resizing, with the aim to observe the behaviour of such relationship for extreme values. The results revealed that, for reasonable resizing factors (i.e., from 10% to 30%), the performances increase by augmenting the value of K. At a certain point, augmenting the value of K does not provide substantial improvements. However, when the resizing factor is set to extreme values (i.e., 40% to 50%), the algorithm is forced to remove a large amount of seams. As result, the algorithm removes some pixels related to the objects that we want to preserve.
In this paper, the best K has been obtained empirically for each considered percentage of resizing. In the future works, methods to automatically determine the best K will be investigated. Future experiments will include horizontal paths in the resizing process, in order to further improve the method performances. Furthermore, the exploitation of saliency maps in the algorithm will be also evaluated.
References
Avidan, S., Shamir, A.: Seam carving for content-aware image resizing. ACM Trans. Graph. 26(3), 10 (2007)
Battiato, S., Farinella, G.M., Puglisi, G., Ravi, D.: Saliency-based selection of gradient vector flow paths for content aware image resizing. IEEE Trans. Image Process. 23(5), 2081–2095 (2014). https://doi.org/10.1109/TIP.2014.2312649
Cho, D., Park, J., Oh, T.H., Tai, Y.W., Kweon, I.: Weakly- and self-supervised learning for content-aware deep image retargeting. In: ICCV, pp. 4568–4577, October 2017. https://doi.org/10.1109/ICCV.2017.488
Fang, Y., Chen, Z., Lin, W., Lin, C.: Saliency detection in the compressed domain for adaptive image retargeting. IEEE Trans. Image Process. 21(9), 3888–3901 (2012). https://doi.org/10.1109/TIP.2012.2199126
Fang, Y., Fang, Z., Yuan, F., Yang, Y., Yang, S., Xiong, N.N.: Optimized multioperator image retargeting based on perceptual similarity measure. IEEE Trans. Syst. Man Cybern. Syst. 47(11), 2956–2966 (2017). https://doi.org/10.1109/TSMC.2016.2557225
Hsu, C., Lin, C., Fang, Y., Lin, W.: Objective quality assessment for image retargeting based on perceptual geometric distortion and information loss. IEEE J. Sel. Top. Sig. Process. 8(3), 377–389 (2014). https://doi.org/10.1109/JSTSP.2014.2311884
Park, H.K., Chung, M.J.: External force of snake: virtual electric field. Electron. Lett. 38, 1500–1502 (2002). https://doi.org/10.1049/el:20021037
Liang, Y., Liu, Y.J., Gutierrez, D.: Objective quality prediction of image retargeting algorithms. IEEE Trans. Vis. Comput. Graph. 23(2), 1099–1110 (2016)
Liu, C., Yuen, J., Torralba, A.: SIFT Flow: dense correspondence across scenes and its applications. IEEE Trans. Pattern Anal. Mach. Intell. 33(5), 978–994 (2011). https://doi.org/10.1109/TPAMI.2010.147
Liu, Y., Luo, X., Xuan, Y., Chen, W., Fu, X.: Image retargeting quality assessment. Comput. Graph. Forum 30(2), 583–592 (2011)
Panozzo, D., Weber, O., Sorkine, O.: Robust image retargeting via axis-aligned deformation. Comput. Graph. Forum 31(2), 229–236 (2012)
Rubinstein, M., Gutierrez, D., Sorkine, O., Shamir, A.: A comparative study of image retargeting. ACM Trans. Graph. 29(6), 160 (2010)
Rubinstein, M., Shamir, A., Avidan, S.: Multi-operator media retargeting. ACM Trans. Graph. 28(3), 1–11 (2009). (Proceedings SIGGRAPH 2009)
Xu, C., Prince, J.: Snakes, shapes, and gradient vector flow. IEEE Trans. Image Process. 7, 359–369 (1998). https://doi.org/10.1109/83.661186
Xu, C., Prince, J.: Generalized gradient vector flow external forces for active contours. Sig. Process. 71, 131–139 (2000). https://doi.org/10.1016/S0165-1684(98)00140-6
Zhou, S., Lu, Y., Li, N., Wang, Y.: Extension of the virtual electric field model using bilateral-like filter for active contours. Sig. Image Video Process. (2019). https://doi.org/10.1007/s11760-019-01456-x
Zhou, Y., Zhang, L., Zhang, C., Li, P., Li, X.: Perceptually aware image retargeting for mobile devices. IEEE Trans. Image Process. 27(5), 2301–2313 (2018). https://doi.org/10.1109/TIP.2017.2779272
Zhu, S., Gao, R.: A novel generalized gradient vector flow snake model using minimal surface and component-normalized method for medical image segmentation. Biomed. Sig. Process. Control 26, 1–10 (2016). https://doi.org/10.1016/j.bspc.2015.12.004
Zhu, S., Zhou, Q., Gao, R.: A novel snake model using new multi-step decision model for complex image segmentation. Comput. Electr. Eng. 51(C), 58–73 (2016). https://doi.org/10.1016/j.compeleceng.2016.02.023
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Rotondo, T., Ortis, A., Battiato, S. (2019). Generalised Gradient Vector Flow for Content-Aware Image Resizing. In: Ricci, E., Rota Bulò, S., Snoek, C., Lanz, O., Messelodi, S., Sebe, N. (eds) Image Analysis and Processing – ICIAP 2019. ICIAP 2019. Lecture Notes in Computer Science(), vol 11752. Springer, Cham. https://doi.org/10.1007/978-3-030-30645-8_24
Download citation
DOI: https://doi.org/10.1007/978-3-030-30645-8_24
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-30644-1
Online ISBN: 978-3-030-30645-8
eBook Packages: Computer ScienceComputer Science (R0)