FUNCTION sharpness,ima,d ; ; Evaluation of image sharpness according to the SST algorithm ; (see Thesis by Luc Rouppe van der Voort) ; but independent on window size. ; INPUT: image array - IMA ; shift in pixels - D (4 pix recommended) ; CALLING: sharpness_value = SHARPNESS(ima,4) ; ; 24 September 2003, Michal on_error,1 si=size(ima) if si(0) ne 2 then message,' Not a 2D image' xn=si(1)-1 yn=si(2)-1 ave=total(ima) ; =(avg_int*n_pixels), independent ; ---------------------------------------------------------- ; ave=total(ima)/si(4) ;average intensity, used at the SST ; ---------------------------------------------------------- sx=total(abs(ima(d:xn,*)-ima(0:xn-d,*))) sy=total(abs(ima(*,d:yn)-ima(*,0:yn-d))) RETURN, (sx+sy)/ave END