How to compare between two images in matlab using 2D dwt and find result?

2 views (last 30 days)
I want to find a way to make a comparator between two images (or more) to find out if the 2nd image is the same or not with the 1st image, using 2D dwt , I am already transform the images to the 2D dwt using Haar wavelet transform . but i do not know how to compare between the results which are ( the 4 images LL,LH,HH,HL). please I want a code with matlab to do that. Thanks.

Accepted Answer

ahmed am
ahmed am on 12 Sep 2014
hay , i wish i could but iam beginner in matalb . please can you help me by send to me you code to convert image into dwt ,haar, wavelet.
  2 Comments
Ramy Ahmed
Ramy Ahmed on 13 Sep 2014
Hi I wish if this the code you need
  • clc;
  • close all;
  • imtool close all;
  • clear;
  • %load the image you want to convert it
  • I = imread('filename.extention');
  • whos;
  • image(I); colormap; colorbar;
  • [cA1,cH1,cV1,cD1] = dwt2(I,'haar');
  • A1 = upcoef2('a',cA1,'haar',1);
  • H1 = upcoef2('h',cH1,'haar',1);
  • V1 = upcoef2('v',cV1,'haar',1);
  • D1 = upcoef2('d',cD1,'haar',1);
  • colormap;
  • subplot(2,2,1); image(wcodemat(A1,192));
  • title('Approximation A1')
  • subplot(2,2,2); image(wcodemat(H1,192));
  • title('Horizontal Detail H1')
  • subplot(2,2,3); image(wcodemat(V1,192));
  • title('Vertical Detail V1')
  • subplot(2,2,4); image(wcodemat(D1,192));
  • title('Diagonal Detail D1')
Try it and waiting your request to any help Thanks

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!