This entire blog has loads of really interesting material on image manipulation with python. This blog was pretty interesting, it would have been cool to go the whole 9 yards and read the barcode though (maybe this technique isn't precise enough?)
And helpfully enough, my code needed a pretty good crop on the barcode, and that's what this article gives you.