Surface Topography of Cuneiform Tablets
Monica Barbu
IDL Code
This is the IDL code written to create the surface topography matrix .
|
PRO linearize ;This program takes each image and runs it through the TTF of the Kodak camera read_image = DIALOG_PICKFILE(/read) image = READ_TIFF(read_image) linear_image = 0.032+0.964*image+0.0009068*image^2-0.000002999*image^3
file = DIALOG_PICKFILE(/write) WRITE_TIFF,file,linear_image END PRO flat_fielding ;This program takes each image along with a reference image and corrects for irregularities in illuminations. read_image = DIALOG_PICKFILE(/read) read_referanceimage = DIALOG_PICKFILE(/read) image = READ_TIFF(read_image) referance_image = READ_TIFF(read_referanceimage) print, size(image) print, size(referance_image) Pd=2.86 Pref = 94.65 flatfield_image = ((float(image)-Pd)/(float(referance_image)-Pd))*(Pref-Pd) window, 0 tvscl, flatfield_image file = DIALOG_PICKFILE(/write) WRITE_TIFF, file, flatfield_image END
FUNCTION divide_images, image_one, image_two ;This function takes two images and finds their ratio. new_image = image_two index = where(image_two EQ 0.0, count) if count GT 0 then image_two[index] = 0.000001 new_image = float(image_one) / float(image_two) maximum = max(new_image) minimum = min(new_image) return, new_image END
PRO topography2, h ;This program find the topographic matrix of two images illuminated at two different angle, theta_one and theta_two. read_first_image = DIALOG_PICKFILE(/read) read_second_image = DIALOG_PICKFILE(/read) image_1 = READ_TIFF(read_first_image) image_2 = READ_TIFF(read_second_image)
theta_one = 60*!Pi/180 theta_two = 150*!Pi/180 result = divide_images(image_1,image_2)
!p.multi = [0, 1, 3] plot, image_1[*, 362], title='image one' plot, image_2[*, 362], title='image two' plot, result[*, 362], title='result of divide' !p.multi = 0 result_one = (SIN(theta_one) - (result)*SIN(theta_two))/((result)*COS(theta_two) - COS(theta_one)) window, 3 & plot, result_one[*, 362], title='result 1' result_two = ATAN(result_one) window, 4 & plot, result_two[*, 362], title='result 2'
print, min(result_two), max(result_two) result_three=(float(result_two)-float(min(result_two)))*255.0/(float(max(result_two))-float(min(result_two)))
WRITE_TIFF, 'topography_image.tif',result_three END
PRO extractline ;This program extract a specified array of data from a chosen image. file = DIALOG_PICKFILE(/read) image = READ_TIFF(file) section = image[935:950,240] file_in = DIALOG_PICKFILE(/write) openw, 1, file_in num = N_ELEMENTS(section) FOR i = 0, num-1 DO BEGIN printf, 1, section[i] ENDFOR close,1 END
|