You have done well to use histograms to identify similar images. You will have to use pattern recognition
] to do the rest.
Try separate algorithms for cropping, rotating and scaling the image. For example when a photo of a book spine is provided,
1. You first rotate it such that the spine is in a perfect vertical line.
2. Then the remaining parts of the image should be cropped.
3. Then scale it into a predefined size. For example if you have 8"x1", 6"x1.5", 12"x0.5" spines, you can scale them all to 12"x1.5". So the comparison is much easier.
After doing this, you can use a neural network to identify the similarities. This would be a good one: http://en.wikipedia.org/wiki/Hopfield_net
Another free (GPL licenced) project: http://pdiff.sourceforge.net/
And don't forget to search in Google Scholar
]. A project such as this needs a lot of reading.