1. A method for imaging features on a substrate, comprising: scanning the substrate and producing an image thereof; overlaying a grid model on the image; fitting the grid model to the locations of at least some of the features on the image; and extracting images of the features, wherein the fitting comprises an iterative optimization of the result of an energy functional of the grid model, wherein the result of the energy functional is minimized, and said energy functional is defined as 
 E ( P )=α F ( P )+β G ( P )+γ H ( P ) where α, β, and γ are weighting factors, F(P) is a distance term determined by the distance between adjacent points of the grid model, G(P) is a perpendicularity term of the grid model, and H(P) is a curvature term determined by the deviation of the points of the grid model from the locations of the features computed from a curvature map of the image, and the corresponding terms are given as F ⁡ ( P ) = ∑ p i , j ⁢ f ⁡ ( p i , j , p i - 1 , j ) + f ⁡ ( p i , j , p i + 1 , j ) + f ⁡ ( p i , j , p i , j - 1 ) + f ⁡ ( p i , j , p i , j + 1 ) ⁢ ⁢ with ⁢ f ⁡ ( p , q ) = ( D interspot - d ⁡ ( p , q ) ) 2 , ⁢ G ⁡ ( P ) = ∑ p i , j ⁢ g ⁡ ( p i , j ⁢ p i - 1 , j ⟶ , p i , j ⁢ p i , j - 1 ⟶ ) + g ⁡ ( p i , j ⁢ p i , j - 1 ⟶ , p i , j ⁢ p i + 1 , j ⟶ ) + g ⁡ ( p i , j ⁢ p i + 1 , j ⟶ , p i , j ⁢ p i , j + 1 ⟶ ) + g ⁡ ( p i , j ⁢ p i , j + 1 ⟶ , p i , j ⁢ p i - 1 , j ⟶ ) ⁢ ⁢ with ⁢ g ( u -> , v -> ) =  u -> · v ->  u ->  ⁢  v ->   , and ⁢ H ⁡ ( P ) = - ∑ p i , j ⁢ curv ⁡ ( I σ ⁡ ( p i , j ) ) .