Skip to content

Arminea/Edge-relaxation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edge Relaxation - image processing

author: Tereza Štanglová

Edge relaxation is method which could be applied after edge detection. The method stretches cracked edges.

Edge detection

In my work, edges are detected using gradient operators, like Sobel, Kirsch and Prewitt. Each operator use 3x3 kernel. These kernels are convolved with original image. The results are approximations of the derivatives - in horizontal and vertical changes.

For highlighting of edges could be used a simple threshold. But thresholding may eliminate important edges from image. Alternative for this method is edge relaxation.

Edge relaxation

Assumption: A weak edge positioned between two strong edges should be strong as well. On the other hans, a strong edge positioned between two weak should be also weak. Thus, the existence, non-existence, of edge is based on appearance of its neighborhood.

Edge relaxation is iterative method. Each edge receives a confidence value which is modified in loops. Main goal is convergence of confidences to 0 or 1.

Algorithm:

  1. Compute initial confidence of each edge C0(e) as the normalozed gradient magnitude normalized by the maximum gradient magnitude in the image.

  2. k=1

  3. Compure each edge type based on the confidence of edge neighbors.

  4. Modify the confidence of each edge Ck(e) based on its edge type and its previous confidence Ck-1(e).

  5. Test the Ck(e)'s to see if they have all converged to either 0 or 1. If so, stop, else increment k and go to 3.

This algorithm is taken from the book Computer Vision by Dana Ballard and Chris Brown (http://homepages.inf.ed.ac.uk/rbf/BOOKS/BANDB/bandb.htm).

The edge type is concatenation of left and right vertex types. Vertex types are computed from their strength. Vertex type is basically a number of edges emanating from vertex, except edge e.

alt tag

Examples of vertex types:

alt tag

Results

Edge relaxation rapidly improves the initial edge labeling but gives worse result after large number of iterations.

Orignal image Image after 5 iterations Image after 30 iterations
alt tag alt tag alt tag

It does good job with blurred edges and removes noise.

Original image Image after 1 iteration Image after 10 iterations
alt tag alt tag alt tag

On the other hand, for similar image with sharp edge it didn't go very well.

Original image Image after 1 iteration Image after 10 iterations
alt tag alt tag alt tag

Edge relaxation was bad for images with limited histogram as well.

Original image Image after 1 iteration Image after 10 iterations
alt tag alt tag alt tag

And finally, our beautiful Lena :)

Original image Image after thresholding Image after 5 iteration of relaxation
alt tag alt tag alt tag

About

Edge relaxation (image processing)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages