;THIS PROGRAM ILLUSTRATES PHASE-I OF THE PROJECT. ;This program gets rid of the cracks and noises from the orignial image. pro convertbse1 device , decomposed = 0 loadct , 0 file1 = filepath('subtractionbse1.tif') imagesize =[1046,790] ;DIMENSIONS OF THE ORIGINAL IMAGE. img1 = read_image(file1) ;THIS IS TO READ A IMAGE FILE. file2 = filepath('originalbse1.tif') imagesize1 =[1024,768] ;DIMENSIONS OF THE ORIGINAL IMAGE. img2 = read_image(file2) bordercolor=!d.table_size-1 tvlct,0,0,0,bordercolor img3=replicate(byte(bordercolor),imagesize1[0]+22,imagesize1[1]+22) img3[11,11]=img2 img4=img3 for i=0,1045 do begin for j=0,789 do begin if(img1[i,j] eq 255) then begin img3[i,j]=255 count=0 tempsum=0 for s=-5,5 do begin for t=-5,5 do begin if (((i+s) lt 1045) and ((i+s) gt 0) and ((j+t) lt 789) and ((j+t) gt 0)) then begin if (img1[i+s,j+t] ne 255) then begin tempsum=tempsum+img4[i+s,j+t] count=count+1 endif endif end end if(count gt 0) then begin img3[i,j]=tempsum/count endif endif end end write_tiff, 'convertbse1.tif' , img3 ;TO WRITE FINAL OUTPUT IMAGE. END