25 Apr 2012

Converting Images of Documents to Near Scanned Quality

I’m working on a project at the moment where we’re handling large quantity of documents that have been photographed in less than ideal circumstances. These photographs are high resolution color photos of typed and handwritten documents that need to be transformed into scan quality documents.  The steps involved are:

  • Convert color to grayscale (128 shades or less)
  • Remove background noise and speckles/flecks/etc
  • Reduce size of images for easier distribution and lower bandwidth usage (currently ~40 GB for set of images) After a few days of working on the problem and learning about the technologies involved… here’s the script I came up with, along with notes about sources and inspirations (note much of the heavy lifting is done by ImageMagick and   Fred’s ImageMagick Scripts[gist id=2494870]

25 Apr 2012

Label every image with its filename in one fell swoop

Here’s a one off Ruby script to wrap up some ImageMagick labeling magic. This script takes all the JPG images in folder and applies the file’s name, as a label, to the bottom of the image. [gist id=2495001]

19 Feb 2012

Absence

Dear spammers, You’ll be relieved to know that i am planning to get back to blogging more.  Thus you’ll have fresh tech posts where you can vainly attempt to post about Viagra and knockoff phones. PS, to human readers… I’ve been very busy with work and getting up to speed on web scraping, ruby, active record & SQLite3, Sinatra, and GIS. It’s an exciting time but a it mellows I’ll get back to blogging.

05 Oct 2011

Uggh - "Puppet hostname doesnt match server certificate"

Wow, this one stumped me for the better part of 12 hrs… So Puppet (the Ruby Gem) uses SSL certificates to authenticate to the Puppet Master.  I kept receiving the warning listed in the title of this post no matter how I altered my configs. Here’s the short version: Determine what Fully Qualified Domain Name is being used by the PuppetMaster to created the signing cert.  On my virtual platform this ended up being the hostname Add that hostname/FQDN and it’s IP address to your PuppetClient’s /etc/hosts like so: 173.999.999.999    hostname Now start up the PuppetMaster Server with the following command # puppetmasterd --verbose --no-daemonize Now invoke the puppet client like so: puppet agent --no-daemonize --verbose --server=HostnameOfServer Finally, now that we know it’s working well edit the /etc/puppet/puppet.conf on Puppet Client so that you have a server entry in the [main] section: [main] server=HostnameOfServer Tada!   Source of partial answer: Puppet hostname doesnt match server certificate - Server Fault.