Top Banner
Sharpening and Edge Detection C. Andrés Méndez 10/04/2013
12

Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

Mar 27, 2015

Download

Documents

Melissa Barrett
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

Sharpening and Edge Detection

C. Andrés Méndez10/04/2013

Page 2: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

Where to find the presentations?

http://profs.sci.univr.it/~mendezguerrero

Page 3: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

High Boost Filtering

• Allied to unsharp masking filters are the high boost filters, which are obtained by

• where A is an amplificator factor. If A=1, then the high boost filter becomes an ordinary highpass filter.

• Weighted combination of the original image and the high-pass-filtered version of the image.

Page 4: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

High Boost Filtering

Page 5: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

High Boost Filtering

• Esercizio 1

• Usando il filtro identità e il filtro di media creare un filtro di high boosting utilizzando i parametri 3, 2 e 1.25, 0.25

• Applicare i filtri ottenuti alle immagini cat.jpg e deathstar.jpg

Page 6: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

Sharpening• The process of sharpening is related to edge detection -

changes in color are attenuated to create an effect of sharper edges.

• Using fspecial , we create a filter for sharpening an image. The special filter is ironically named 'unsharp':

• The idea of unsharp masking is to subtract a scaled “unsharp” version of the image from the original.In practice, we can achieve this affect by subtracting a scaled blurred image from the original.

Page 7: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

Sharpening

• Esercizio 2

• Applicare il filtro “unsharp” alle immagini pomegranate.jpg e deathstar.jpg

• Applicare il filtro “unsharp” alle immagini ottenute al punto precedente

• Convertire le immagini pomegranate e deathstar nello spazio YCbCr

• Applicare lo sharpening solo ad un canale alla volta

• Visualizzare le immagini

Page 8: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

MatLab’s Edge function• The Sobel method finds edges using the Sobel approximation to the derivative.

It returns edges at those points where the gradient of I is maximum.• The Prewitt method finds edges using the Prewitt approximation to the

derivative. It returns edges at those points where the gradient of I is maximum.• The Roberts method finds edges using the Roberts approximation to the

derivative. It returns edges at those points where the gradient of I is maximum.• The Laplacian of Gaussian method finds edges by looking for zero crossings

after filtering I with a Laplacian of Gaussian filter.• The zero-cross method finds edges by looking for zero crossings after filtering I

with a filter you specify.• The Canny method finds edges by looking for local maxima of the gradient of I.

The gradient is calculated using the derivative of a Gaussian filter. The method uses two thresholds, to detect strong and weak edges, and includes the weak edges in the output only if they are connected to strong edges. This method is therefore less likely than the others to be fooled by noise, and more likely to detect true weak edges.

Page 9: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

Edge Detection• Esercizio 3• Scalare l’immagine

pomegranate • Extract edges for each color

layer (red, green, and blue), and place the edge intensity images in a matrix which will resemble a multi-dimensional color (RGB) image. Use edge(X,‘sobel’)

• In one figure display separatedly the edges for each channel (fig 1)

• In another figure show the composite (color) edge images, which combine information from all three channels (as shown in fig 2)

50 100 150 200

50

100

150

Pomegranate Edges Channel R

Pomegranate Edges Channel G Pomegranate Edges Channel B

Fig 1

Pomegranate Edges RGB Combined edges in one intensity image

Fig 2

Page 10: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

Edge Detection

• Esercizio 4• Applicate all the methods of the function edge (sobel,

prewitt, roberts, laplacian of gaussian, zerocross, canny) to the image inception.jpg and visualize the results in the same figure.

original sobel prewitt roberts

log zerocross canny

original sobel prewitt roberts

log zerocross canny

Page 11: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

Edge detection

• Esercizio 5 • Confrontare il risultato di un filtro di Sobel

applicato nel dominio dello spazio e delle frequenze sull’immagine inception

Page 12: Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.

Edge Detection

• Esercizio proposto

• Caricare l’immagine mappa.jpeg. Trovare il migliore fra i filtri per l’edge detection in modo da mettere in evidenza i confini.