Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Fault in result in formula
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Stefan Raab
2016년 4월 24일
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
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!