Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Problem converting formula of Welford algorthm

1 visualización (últimos 30 días)
Syakira Akmal
Syakira Akmal el 26 de Abr. de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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);

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by