Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Problem converting formula of Welford algorthm
조회 수: 1 (최근 30일)
이전 댓글 표시
Hai, please someone help me because using code below, for different image, i still get the same value for alpha, theta and image normalization.
a = imread('3.JPG');
imshow(a);
b = roipoly(a);
%to set point
[X,Y] = size(b);
%to calculate mean image
m = mean2(b);
%to calculate standard deviation
sd = std2(b);
% initialise
sMinusMean=0;
% mean-variance moving window operation
for i=1:X
for j=1:Y
iMean = [X,Y]-m;
sMinusMean=sMinusMean+iMean;
end
end
%image normalised
iNeu=sMinusMean/sd;
[X,Y]= size(iNeu);
% gradient orientation
g1= [X,Y+1]-[X,Y-1];
g2= [X+1,Y]-[X-1,Y];
theta=atan2(g1,g2);
% magnitude
a1= [X*X,(Y+1)*X]-[X*X,(Y-1)*X];
a2= [(X+1)*Y,Y*Y]-[(X-1),Y*Y];
a3= a1+a2;
alpha=sqrt(a3);
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!