;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('dilationbse1(r=3).tif') imagesize =[1024,768] ;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],imagesize1[1]) img3=img2 img4=img2 for i=0,1023 do begin for j=0,767 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 1023) and ((i+s) gt 0) and ((j+t) lt 767) and ((j+t) gt 0)) then begin if (img4[i+s,j+t] ge 60) 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 if(count eq 0) then begin img3[i,j]=img4[i,j] endif endif end end write_tiff, 't_dilate_convertbse1(r=3).tif' , img3 ;TO WRITE FINAL OUTPUT IMAGE. END