<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Unix utility that straightens images?</title>
	<link>http://ask.metafilter.com/32307/Unix-utility-that-straightens-images/</link>
	<description>Comments on Ask MetaFilter post Unix utility that straightens images?</description>
	<pubDate>Wed, 08 Feb 2006 08:45:46 -0800</pubDate>
	<lastBuildDate>Wed, 08 Feb 2006 08:45:46 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Unix utility that straightens images?</title>
		<link>http://ask.metafilter.com/32307/Unix-utility-that-straightens-images</link>	
		<description>Is there a Unix command-line utility that automatically straightens images? &lt;br /&gt;&lt;br /&gt; I have some images containing pure black text on a white background, but these images were scanned from paper documents and aren&apos;t aligned perfectly -- that is, the text is slightly on an angle. I&apos;d like to find a Unix tool that automatically rotates the images so that the text is straight.&lt;br&gt;
&lt;br&gt;
(The Unix part is important, as this process will be automated on a Linux box. And I&apos;m dealing with hundreds of images here, so I don&apos;t have the resources to do the rotation by hand.)&lt;br&gt;
&lt;br&gt;
The images contain only text, no graphics. The rotation needed is inconsistent across documents, but it&apos;s generally between .5 and 2 degrees in either direction.</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.32307</guid>
		<pubDate>Wed, 08 Feb 2006 08:26:21 -0800</pubDate>
		<dc:creator>adrian_h</dc:creator>
		
			<category>image</category>
		
			<category>unix</category>
		
	</item> <item>
		<title>By: boo_radley</title>
		<link>http://ask.metafilter.com/32307/Unix-utility-that-straightens-images#505125</link>	
		<description>Well, I&apos;d start with &lt;a href=&quot;http://www.imagemagick.org&quot;&gt;imagemagick&lt;/a&gt;.&lt;br&gt;
&lt;tt&gt;convert -rotate &lt;i&gt;nn&lt;/i&gt; foo.jpg foo_rotated.jpg&lt;/tt&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.32307-505125</guid>
		<pubDate>Wed, 08 Feb 2006 08:45:46 -0800</pubDate>
		<dc:creator>boo_radley</dc:creator>
	</item><item>
		<title>By: handee</title>
		<link>http://ask.metafilter.com/32307/Unix-utility-that-straightens-images#505131</link>	
		<description>The ImageMagick &quot;convert&quot; program can do rotations. But you have to tell it by how much. I&apos;m no unix guru, but I expect there&apos;s no off-the-shelf package to do this. &lt;br&gt;
&lt;br&gt;
If you could find a package which could tell you the rotation you could do it (by finding the required rotational degree and then calling convert) but I&apos;d be surprised if such a beast existed. What you&apos;re looking for is something that fits lines to an image, and tells you their orientation. &lt;br&gt;
&lt;br&gt;
Disclaimer: I&apos;m a CV researcher but I&apos;ve never done much text processing so I could be wrong here.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.32307-505131</guid>
		<pubDate>Wed, 08 Feb 2006 08:49:22 -0800</pubDate>
		<dc:creator>handee</dc:creator>
	</item><item>
		<title>By: boo_radley</title>
		<link>http://ask.metafilter.com/32307/Unix-utility-that-straightens-images#505134</link>	
		<description>I&apos;ve posted too soon. The difficult part will be figuring out how to programmatically address inconsistent rotation. I can&apos;t think of a good way to do that part offhand.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.32307-505134</guid>
		<pubDate>Wed, 08 Feb 2006 08:50:56 -0800</pubDate>
		<dc:creator>boo_radley</dc:creator>
	</item><item>
		<title>By: empath</title>
		<link>http://ask.metafilter.com/32307/Unix-utility-that-straightens-images#505141</link>	
		<description>You probably want a program that can do OCR.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.abbyy.com/press/press_releases.asp?param=28960&quot;&gt;This one&lt;/a&gt; looks like it does pre-processing to align the documents properly.  It may be possible to skip the OCR process and just have it align the images.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.32307-505141</guid>
		<pubDate>Wed, 08 Feb 2006 08:55:44 -0800</pubDate>
		<dc:creator>empath</dc:creator>
	</item><item>
		<title>By: Ogre Lawless</title>
		<link>http://ask.metafilter.com/32307/Unix-utility-that-straightens-images#505480</link>	
		<description>I know what you are looking for exists, adrian -- back in the early 90s we used such software at my shop here frighteningly, on a PC via primtive UNIX emulation tools -- yikes!.  That was sadly some time ago and I don&apos;t know that anyone could remember what the hell it was we used though &quot;imgfix&quot; comes to mind (google is a bit unhelpful here).  The tool was designed to correct the &quot;skew&quot; on auto-fed scanners which at the time were quite teh-sucky, but I&apos;m sure the problem continues with hand-scanned docs today.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.google.com/search?q=rotation+scanned&quot;&gt;quick googlesmack&lt;/a&gt; provides &lt;a href=&quot;http://www.3miasto.net/~ortylp/pgmangle.html&quot;&gt;this link&lt;/a&gt; which might be a bit rough-and-ready, but might serve a batch process.  Uses PGM files.&lt;br&gt;
&lt;br&gt;
 &lt;a href=&quot;http://unpaper.berlios.de/&quot;&gt;unpaper&lt;/a&gt; looks pretty cool in both auto deskewing and fixing a number of other paper-conversion issues.  Uses PBM files.&lt;br&gt;
&lt;br&gt;
Imagemagic&apos;s afformentioned `convert` will help ease the translation pain.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.32307-505480</guid>
		<pubDate>Wed, 08 Feb 2006 12:37:27 -0800</pubDate>
		<dc:creator>Ogre Lawless</dc:creator>
	</item><item>
		<title>By: adrian_h</title>
		<link>http://ask.metafilter.com/32307/Unix-utility-that-straightens-images#505531</link>	
		<description>Ogre Lawless: Thanks very much! Those two tools look like exactly what I needed.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.32307-505531</guid>
		<pubDate>Wed, 08 Feb 2006 13:04:10 -0800</pubDate>
		<dc:creator>adrian_h</dc:creator>
	</item>
	</channel>
</rss>
