I want to scan a collection of rectangular photos, both color and black-and-white. I am generally quite happy with the scanning, but I run into some practical problems, due to the fact that photos are placed by hand and may not be well aligned with the scanning canvas (or the edges of the scanner)
I assume that my photo has been scanned into a white background rectangle containing the rectangular picture I want, possibly not aligned with the edge of the white rectangle.
Is there an application (preferably running on Linux) that can rotate automatically the scan so that the picture edges are horizontal/vertical? If it also crop out the surrounding white background, it is even better (though proper Unix design would separate this issue).
I know how to do that by hand with Gimp, checking the rotation with my eyes. But I would like to have it done automatically.
To make things clearer with actual images: given the first image below with the irregular white border, I would like to automatically extract the second one, without any surrounding white.
Note: I had to add the dashed-line to show the edges of the first image. If you want to test a proposed solution for the automatic extraction, you should rather use this image.