Image pattern matching, filtering and energy centroid