Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Fault in result in formula
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello, I want implement this formula . but i think it give me fault result. For example : X = 156 and Pmn should be .0540 but with matlab give me .0059
input = imread('cameraman.tif');
[m , n] = size(input);
output = zeros(m,n);
L = 256;
Xmax = L - 1 ;
Fe = 2;
Fd = 30;
Pmn = zeros(m,n);
Pmn = double(Pmn);
for i = 1:m
for j = 1:n
Xmn = double(input(i,j));
Pmn(i,j)=1/((1+((Xmax-Xmn)/Fd)).^Fe);
end
end
1 comentario
Stefan Raab
el 24 de Abr. de 2016
Hello,
I cannot reproduce your error. If I set m=1, n=1 and input=156, then MATLAB calculates the correct result Pmn = P11 = 0.0540832.... Here my code, I changed only the input:
n = 1;
m = 1;
input = 156;
output = zeros(m,n);
L = 256;
Xmax = L - 1 ;
Fe = 2;
Fd = 30;
Pmn = zeros(m,n);
Pmn = double(Pmn);
for i = 1:m
for j = 1:n
Xmn = double(input(i,j));
Pmn(i,j)=1/((1+((Xmax-Xmn)/Fd)).^Fe);
end
end
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!