Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have scanned a newspaper article which was larger than the scanner glass. Each page was scanned twice: the top and the bottom parts, where the middle part appeared in both images.

Is there a way to quickly match and stitch these scanned images, preferably using CLI? The panorama stitching tools I know require lengthy configuration, which is mostly irrelevant: lens size, focus, angle etc.

Hugin has a solution for this issue, but it isn't practical for batch jobs.

share|improve this question
    
Your "hugin solution for this issue" uses the GUI interface.. hugin-tools has a CLI tool-set.. maybe you can do something with them (unless those CLI tools what you meant by "not practical".. ) –  Peter.O Jun 25 '11 at 18:16
    
Any CLI solution is welcome. –  Adam Matan Jun 25 '11 at 22:15

2 Answers 2

You could play around with ImageMagick's montage tool. You'll want to install the imagemagickInstall imagemagick package before you go any further.

At face value, you just need to ply montage with input files and then give it an output file:

montage scan1.jpg scan2.jpg output.jpg

but montage can get really powerful. You can pass along various translation arguments if you need to rotate the pages before they're combined. You can read an extended manual on it here.

share|improve this answer
2  
It simply concatenates images, without smart stitching (matching points, rotating a bit etc.) –  Adam Matan Jun 25 '11 at 22:20

Ok, in really what you need is ImageMagick, install it sudo apt-get install imagemagick and then you just need to do these steps:

  • create a blank image in the parameters to fit the two images that you need to put together.
  • type in the terminal: composite -gravity North top_scan.jpg blank_image.jpg top_image.jpg
  • type in the terminal: composite -gravity South bottom_scan.jpg top_image.jpg complete_image.jpg

But if you need something that autorotate the images to get them perfectly matching, sorry, but as far as I know there isn't anything that do it in ubuntu.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.