Normalization of gradient image

44 ビュー (過去 30 日間)
Kyle Wang
Kyle Wang 2019 年 2 月 13 日
回答済み: Shunichi Kusano 2019 年 2 月 21 日
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 Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by