Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Fault in result in formula

3 visualizzazioni (ultimi 30 giorni)
Dani D
Dani D il 24 Apr 2016
Chiuso: MATLAB Answer Bot il 20 Ago 2021
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 Commento
Stefan Raab
Stefan Raab il 24 Apr 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

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by