Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Problem converting formula of Welford algorthm
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!