change detection is nothing but process of detecting difference between two different images . this can also be performed by using Mean Ratio operator give below
µ1, µ2 is local mean values of images A and B.
the underlying idea of the optimal difference image is that unchanged pixels exhibit small values,whereas changed areas exhibit larger values. it show changed region but it doesn't enhance it.result is better then that of log ratio operator
procedure is giveb below
STEP1 : clear previous project variable, clear history , and close all the window
STEP2 : Read the two source images as A and B
STEP4: convert to gray scale image to if it is color image (if dimension is 3 then it is color image )
STEP5: Fing the difference between image using Mean Ratio operator
STEP6: Display the source and Rasult image
Coding is given below
%%step1
close all
clear all
clc
%%step2
[filename pathname]=uigetfile({'*.bmp';'*.jpg';'*.png';'*.tif'},'Select SAR image 1');
a=imread([pathname filename]);
[filename pathname]=uigetfile({'*.bmp';'*.jpg';'*.png';'*.tif'},'Select SAR image 2');
b=imread([pathname filename]);
%%step3
b=imresize(b,[size(a,1) size(a,2)]);
%%step4
dim=ndims(a);
if(dim==3)
a=rgb2gray(a);
end
dim1=ndims(b);
if(dim1==3)
b=rgb2gray(b);
end
%%step5
c=mean2(im2double(a));
d=mean2(im2double(b));
m=(a/c)-(b/d);
m=im2bw(m,.5);
%%step6
figure(1),imshow(a);
title('SAR image1');
figure(2),imshow(b);
title('SAR image2');
figure(3),imshow(m);
title('Mean Ratio image');
screen shot
source image A
source image B
result image
No comments:
Post a Comment