Presentation on theme: "A joint work with Nir Sochen & Yehoshua Y. Zeevi."— Presentation transcript:
1A joint work with Nir Sochen & Yehoshua Y. Zeevi. Computer Vision Seminar, HUJI, December 2002 PDE-based Image Processing and the Triple Well Potential for Image SharpeningGuy GilboaFaculty of Electrical Engineering,Technion, Haifa, IsraelA joint work with Nir Sochen & Yehoshua Y. Zeevi.
2Objectives A review on PDE-based methods for image processing. Show relation to energy minimization.Present a new well-shaped potential for image sharpening.Introduce hyper-diffusion for regularization.Examples and conclusion.
3Basic Linear and Nonlinear Diffusion Linear scale-space.Perona-Malik scheme.The intuition behind nonlinear-diffusion filtering.Numerical schemes
4Uncommitted front end vision “We know nothing, we have no preference whatsoever” The mathematical formulation for that is:Linearity (no knowledge, no model)Spatial shift invariance (no preferred location)Isotropy (no preferred orientation)Scale invariance (no preferred size, or scale)
5Connecting PDE’s to Image processing, introducing: The Linear Scale-Space Scale Space is represented by the linear diffusion equation:We add a scale dimension to the original image – using a single scale parameter t.As shown by Koendrink: The diffusion equation is the unique scheme that incorporates all the above requirements (isotropy, homogeneity, causality).
6Linear Scale-Space Applying the diffusion equation to the original image – creating a 3rd dimension tAdopted from[Romeny ‘96]t
15Intuition for adaptive denoising “Do not diffuse the leaves of the tree with the sky at the background” [P-M]Diffuse (low-pass-filter) only within the same region \ object.Therefore -> Slow the diffusion near edges.
16Gaussian averaging along the curve of the signal The distance is measured not only spatially,the values of the signal are also considered.Related to the logic of bilateral filters.Adopted from [Sochen et al ‘01]
17Relation to robust statistics Reducing the effect of outliers – pixels at the other side of an edge are treated as outliers and should not be considered in the estimation (see Black et al `98).
18Numerics – how do we actually do that ? Reminder from first year Infi course:For images we usually take h=1and simply compute the difference between neighboring pixels:1st order: Forward: Ii+1,j - Ii,j , Backward: Ii,j – Ii_1,jCentral: (Ii+1,j – Ii-1,j )/22nd order: Central: Ii+1,j – 2Ii,j + Ii-1,j
19Explicit SchemesComputation is done on each pixel separately – using the values of the previous iteration. Example of linear diffusion:
20Explicit scheme – cont’ Main advantage – simplicity, very easy to implement.Main disadvantage - time constraints (CFL bound): the scheme is stable only when(for 2D)Summary: a very popular scheme (esp. when the process does not need a lot of iterations).
21Perona-Malik example in Matlab function J=diffusion(J,K,N)for i=1:N,% calculate gradient in all directions (N,S,E,W)In=[J(1,:); J(1:Ny-1,:)]-J;Is=[J(2:Ny,:); J(Ny,:)]-J;Ie=[J(:,2:Nx) J(:,Nx)]-J;Iw=[J(:,1) J(:,1:Nx-1)]-J;% calculate diffusion coefficientsCn=exp(-(abs(In)/K).^2);Cs=exp(-(abs(Is)/K).^2);Ce=exp(-(abs(Ie)/K).^2);Cw=exp(-(abs(Iw)/K).^2);J=J+0.2*(Cn.*In + Cs.*Is + Ce.*Ie + Cw.*Iw);end; % for i
22Advanced SchemesImplicit schemes – need to solve for all the pixels together, no time constraints, produces a very large set of equations. Iterative methods are often used (Jacobi, Gauss-Seidel, Multigrid).Level-sets – used for curve evolution (like snakes). Representing a curve as a level set of a higher dimensional function. Scheme is stable, non-parametric, able to change topologies.
23Other PDE-based Processes Coherence-enhanceing diffusion.Total-Variation denoisingBeltrami flow color processingSegmentation – Mumford-Shah functional and active contours (snakes).
24Anisotropic diffusion Cottet and Germain, Weickert - coherence enhancing flow: strong diffusion along the edge, weak diffusion across the edge (tensor diffusion coef.) .
25Total Variation denoising (Osher-Rudin-Fatemi) Denoising by minimizing the total variation yet staying close to the input image. Reduces the oscillatory part of the signal that contains mostly noise (but also texture and some small details).Energy to be minimized:f – original image
26TV - does not penalize large gradients (edges) Same energy for any monotone part of the signal, unlike linear diffusion.For L1 norm all the lines on the right has the same energy, whereas for L2 norm the blue line has the highest energy and the red line has the lowest.
27TV vs. PM - a sketchy comparison Top: original+noise(SNR=11.9dB)Bottom:left – TV (SNR=17.6dB)right – PM (SNR=16.9dB)TVPM
28Color processing by Beltrami flow (Sochen, Kimmel, Malladi) Representing color image as a 2D surface in a 5D Riemannian manifold. A surface minimizing process that denoises and preserves edgesEvolving each color channel via the Beltrami flow:
32Image SegmentationMumford shah functionalActive contours (snakes)
33Mumford-Shah Functional A variational approach for image segmentation.Minimizing the following energy functional:f – original image, u – piece-wise smooth approx. of f separated bythe contour – C.
34Active contours (snakes) Evolving a curve like a rubber-band, with the aim to “close” on the object to be segmented, creating a continuous, smooth curve.Motivation is drawn from the active contour model of Kass et al (’87) but rely on level set techniques introduced by Osher and Sethian to handle topological changes in a seamless fashion (introduced independently by Caselles et al. and Malladi et al. in ’95-`97, “Geodesic Active Contours”).Emin (C) “smooth”+”elastic”+”on edges”
35Segmentation examples Adpoted from Chan & Vese, UCLA site
38Some ReferencesBlack, M., G. Sapiro, D. Marimont, and D. Heeger, Robust anisotropic diffusion, IEEE Transactions on Image Processing Volume 7, PP , 1998.V. Caselles, R. Kimmel, and G. Sapiro. Geodesic active contours. International Journal of Computer Vision, 22(1):61-79, 1997.Chan T, Vese L.A., Image Segmentation Using Level Sets and the Mumford-Shah Model , CAM 00-14, April 2000Chan T, Vese L.A. , Active Contours Without Edges, IEEE Image Proc. Feb 2001.Chan T, Shen J., Vese L.A., Variational PDE models in image processing, Amer. Math. Soc. Notice, 50, pp , January 2003.G.H. Cottet and L. Germain, “Image processing through reaction combined with nonlinear diffusion", Math. Comp., 61 (1993)M. Kass, A. Witkin and D. Terzopoulos, "Snakes: Active contour models," International Journal of Computer Vision, pp , 1987.R Kimmel, R Malladi and N Sochen, ``Images as Embedding Maps and Minimal Surfaces: Movies, Color, Texture, and Volumetric Medical Images", Int. J. of Computer Vision, 39(2): , Sept
39R. Malladi, J. A. Sethian and B. C. Vemuri R. Malladi, J. A. Sethian and B.C. Vemuri. Shape modeling with front propagation : A level set approach. IEEE Transactions on Pattern Analysis and Machine Intelligence, 17(2): , February 1995.D. Mumford and J. Shah, Optimal approximations by piece-wise smooth functions and assosiated variational problems, Comm. Pure and Appl. Math., LII (1989),P. Perona and J. Malik, “Scale-space and edge detection using anisotropic diffusion", IEEE Trans. PAMI vol. 12,no. 7, pp , 1990.T. Lindeberg, “Scale-space theory: a basic tool..”, J. App. Statistics, 21(2): , 1994.Rudin L, Osher S and Fatemi C 1992 Nonlinear total variation based noise removal algorithm, Physica D 60, (1992).N Sochen, R Kimmel and R Malladi , “`A general framework for low level vision", IEEE Trans. on Image Processing, 7, (1998)N. Sochen, R. Kimmel, and A.M. Bruckstein. Diffusions and confusions in signal and image processing, Journal of Mathematical Imaging and Vision, 14(3): , 2001.ter Haar Romeney B.M., “An Intorduction to Scale-Space Theory”, VBC-’96, Hamburg, Germany.
40J. Weickert,``Coherence-enhancing diffusion of colour images", Image and Vision Comp., 17 (1999)J. Weickert, A review on nonlinear diffusion filtering, LNCS 1252, Scale-Space Theory in Computer Vision, Springer-Verlag, 1997, 3-28.A. P. Witkin, ``Scale space filtering", Proc. Int. Joint Conf. On Artificial Intelligence, pp , 1983.Bookster Haar Romeny, Geometry-driven diffusion in computer vision.Weickert, Anisotropic diffusion in image processing .Sapiro, Geometric partial differential equations and image analysis .SitesRon Kimmel’s course “Numerical Geometry of Images”:My web site:
41Nonlinear diffusion as an energy minimizing process A general nonlinear diffusion process can be viewed as a steepest descent sequence that minimizes the signal’s energy.The energy functional E is defined as the cumulative potential (energy density) Ψ of the signal in the domain Ω.
42We define an energy functional E: where Ψ is a potential which is a function of the gradient magnitude.The steepest descent process is:
43we get the nonlinear diffusion equation (“Perona-Malik” style): Assigning:we get the nonlinear diffusion equation(“Perona-Malik” style):see- You, Xu, Tannenbaum, Kaveh, IEEE Trans. IP, 5(11), 1996.- Weickert, LNCS 1252, pp.3-28, 1997.
44The nature of the diffusion depends on the potential function ψ (or the corresponding diffusion coefficient c)
47(e.g. linear diffusion, Charbonnier et al., Beltrami) Convex Potentials(e.g. linear diffusion, Charbonnier et al., Beltrami)Reach a global minimumWell-posed processesStrong denoisingEdge preservation is weaker
48Nonconvex Potentials (e.g. Perona-Malik) In general can have many minima (Hollig, You et al.). produce staircasing.Need some sort of regularization to be well-posed (Catte et al).Weaker denoisingStrong edge preservationPerforms well for images-processing
49Sharpening by going back in time ? forwardbackward
50Potential requirement for image sharpening Basic sharpening property: gradients should increase (at least in some range).High gradients should “cost “ less energy than medium gradients.Minimum-maximum principle is not kept.blursharpen
51Inverse diffusionA classical ill posed sharpening process, attempting to reverse forward diffusion (Gaussian blur).Drawbacks:OscillatoryAmplifies noise exponentiallyCauses the explosion of the signal
521D inverse diffusion example: trying to restore a blurred step.
54We would like to find a potential function that has a sharpening ability and yet avoids the inverse diffusion drawbacks.
55Low gradients should not be enhanced Restrictions on the potential - 1Rule 1:Low gradients should not be enhancedAvoid amplification of noiseSpecifically, the zero gradient should be stable –> have minimum energy.
56Very high gradients should not be enhanced Restrictions on the potential - 2Rule 2:Very high gradients should not be enhancedAvoid explosion of the signalTo reduce staricasing – very high gradients should contribute some positive energy.
57There should be minimal oscilations between low energy states Restrictions on the potential - 3Rule 3:There should be minimal oscilations between low energy statesWe assume the original image is with little oscillations.
58The triple-well potential DenoisingSharpeningSharpeningW(Ix)Slow smoothingSlow smoothingIxSharpening potential W(Ix) in one dimension.Forms the shape of three wells.
59From inverse diffusion to a Forward-and-Backward (FAB) diffusion C(|grad(U)|)1|grad(U)|-α
60Stability of smooth regions Given Mf > Mb then for every x0: |Ix (x0;0)|<rf we satisfy |Ix (x0;t)|<rf for any t>0.
61The proposed energy functional for sharpening: whereW is a gradient dependent well-shaped potential.F is a fidelity term.R is a high order regularization term.
62We assign a standard convex fidelity term to the input image I0: Next:We discuss the need for a high order regularization term R .
63Higher order regularization We search for the “smoothest” energy minimizer with minimal oscillations between the low energy states (similar to the viscosity solutions reasoning).For that we add a second order term to the energy functional. We use a convex rotationally invariant term:The steepest descent flow is of hyper-diffusion.
64Hyper-diffusion Initial and boundary conditions: n is a unit vector normal to the boundary
65Hyper-diffusion as a stabilizer of inverse diffusion (from the literature) In the Cahn-Hilliard and Kuramoto-Sivashinsky equations a hyper diffusion term is used to stabilize linear inverse diffusion. Kuramoto, Dynamics of interacting particles, Springer 1984, Sivashinsky Ann. Rev. Mech. 15, 1983, J.W Cahn, J.E. Hilliard, J. Chem. Phys. 28,2, 1958.Physical processes modeled by forward-and-backward diffusion and hyper-diffusion are shown to have a unique solution (no proof in our case yet). see Witelski, Studies in Applied Mathematics, 96, pp , 1996.
66Hyper-diffusion vs. diffusion 1D (Step and noise processed after times 0.1,1,10) Hyper-diffusion Diffusion
67Hyper-diffusion 2D (Cameraman processed after times 0.1,1,10)
68Energy minimization process for selective sharpening Summary:Energy minimization process for selective sharpeningInitial and boundary conditions:
76ConclusionPDE-based techniques were shown to be effective in a variety of image-processing applications with concise and well defined formulations.A well-shaped potential was presented for image sharpening.The process rewards the increase of gradients in some range, while being able to operate in a noisy environment and avoid oscillations and the explosion of the signal.Hyper-diffusion was introduced as a means to stabilize inverse-diffusion type processes.