Normalization of gradient image

13 次查看(过去 30 天)
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?

采纳的回答

Shunichi Kusano
Shunichi Kusano 2019-2-21
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by