필터 지우기
필터 지우기

Walsh and Inverse Walsh Transform and MSE

조회 수: 1 (최근 30일)
Raman kumar
Raman kumar 2015년 10월 30일
댓글: Image Analyst 2015년 10월 30일
I have applied Walsh transform on 3-D images of folder and then Inverse Walsh. After that when i am calculating MSE of each image with every other image the value is same. What is wrong in my code? clc; clear all; close all; Dir = 'F:\Stuff\Dataset\SignDataset_Sobel\'; count = 0;
for i = 1 : 208 A = imread([Dir,int2str(i),'.jpg']); A = double(A); [s1 s2] = size(A); % bs=input('Enter the block sizes for division of the image: '); % Block Size bs=8; % Walsh temp=double(zeros(size(A))); for y=1:bs:s1-bs+1 for x=1:bs:s2-bs+1 croppedImage = A((y:y+bs-1),(x:x+bs-1)); t=getWalshTransform(croppedImage,bs); temp((y:y+bs-1),(x:x+bs-1))=t; end end % Inverse Walsh temp1=double(zeros(size(A))); for y=1:bs:s1-bs+1 for x=1:bs:s2-bs+1 croppedImage = temp((y:y+bs-1),(x:x+bs-1)); t=getInvWalshTransform(croppedImage,bs); temp1((y:y+bs-1),(x:x+bs-1))=t; end end end for ii = 1 : 208 for jj = 1 : 208
count = count+1;
xmse(count,1)=0;
xmse(count,2)=ii;
xmse(count,3)=jj;
[r c p]=size(temp1);
for xi = 1 :r
for xj = 1 : c
for xk=1:3
xmse(count,1)=xmse(count,1)+( (temp1(xi,xj,xk)-temp(xi,xj,xk)) *(temp1(xi,xj,xk)-temp(xi,xj,xk)));
end
end
end
xmse(count,1)=xmse(count,1)/(3*r*c);
fprintf('MSE of %f with %f is :%f\n',xmse(count,2),xmse(count,3),xmse(count,1));
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Hilbert and Walsh-Hadamard Transforms에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by