필터 지우기
필터 지우기

Normalization of gradient image

조회 수: 21 (최근 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 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