Borrar filtros
Borrar filtros

Normalization of gradient image

21 visualizaciones (últimos 30 días)
Kyle Wang
Kyle Wang el 13 de Feb. de 2019
Respondida: Shunichi Kusano el 21 de Feb. de 2019
https://au.mathworks.com/help/images/ref/imgradient.html#bthgcil-method
imgradient does not normalize the gradient output. If the range of the gradient output image has to match the range of the input image, consider normalizing the gradient image, depending on the method argument used. For example, with a Sobel kernel, the normalization factor is 1/8, for Prewitt, it is 1/6, and for Roberts it is 1/2.
I'm confused with the last sentence. So excatly how to calculate the normalised gradient image with a sobel kernel for example?

Respuesta aceptada

Shunichi Kusano
Shunichi Kusano el 21 de Feb. de 2019
For the case using sobel kernel, multiply 1/8 to the resulted values:
[Gmag,Gdir] = imgradient(I, 'sobel');
Gmag_normalized = Gmag / 8;
The window (kernel) used in sobel filter is:
w = [1 0 -1; 2 0 -2; 1 0 -1]; % for vertical edge detection
The sum of the absolute value is 8 (=abs(1+2+1)+abs(-1-2-1)). Hence, the resulted values are enhanced by this factor due to the convolution. One needs to compensate this for the normalization. The idea is the same as moving average.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by