author: Tereza Štanglová
Edge relaxation is method which could be applied after edge detection. The method stretches cracked edges.
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.
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:
-
Compute initial confidence of each edge C0(e) as the normalozed gradient magnitude normalized by the maximum gradient magnitude in the image.
-
k=1
-
Compure each edge type based on the confidence of edge neighbors.
-
Modify the confidence of each edge Ck(e) based on its edge type and its previous confidence Ck-1(e).
-
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.
Examples of vertex types:
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 |
---|---|---|
It does good job with blurred edges and removes noise.
Original image | Image after 1 iteration | Image after 10 iterations |
---|---|---|
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 |
---|---|---|
Edge relaxation was bad for images with limited histogram as well.
Original image | Image after 1 iteration | Image after 10 iterations |
---|---|---|
And finally, our beautiful Lena :)
Original image | Image after thresholding | Image after 5 iteration of relaxation |
---|---|---|