I've never done any analysis of this type, but I know there are packages in R that allow image analysis. One of the most common uses for me is to analyze changes in geography and biology, but I believe it can be used for any type of image. Performing a quick search I found the package "EBImage", take a look at it, maybe that's what you're looking for.