A while back I bookmarked How to Revive The Levelator in El Capitan on TidBITS and followed the instructions to get this essential piece of podcasting software to work again after updating my mac to El Capitan.

This week TidBITS had the news: The Levelator 2.1.2 Works in El Capitan announcing a new version.

The Levelator is

a free app that ensures audio files use a consistent loudness, something that’s often hard to achieve with group podcasts and between episodes.

I find it very useful for Radio Edutalk episodes where we record over Skype.

This is going to be another slightly geeky post. The previous one, Testing a new system, was about a way to blog using dropbox and AppleScript folder actions had me thinking about other things that could be done using this sort of system. The way I am doing this relays on having dropbox and a mac that is on when you want it. If you don’t have a mac you might like Wappwolf which is a web service that can do a lot of things with files in your dropbox automatically.

So I already have a system for blogging by dropping files into a folder on my dropbox and was looking around for another idea to play with. There seems to be a few OCR apps for iPhones but I had noticed that Tesseract was available on Google Code and googled around to see how it could be installed and run on a mac. One I found was TesseractOCR Mac a Cocoa Front end to the Tesseract OCR program. I downloaded this and gave it a try. It worked well on my desktop. I then struck gold: Installing and using Tesseract 2.04 on Mac OS X 10.6.6 with Homebrew | Ramble On. This post explains clearly how to install Tesseract on a mac so that it can be used on the command line. It is also a good intro to homebrew.

Homebrew

Homebrew is the easiest and most flexible way to install the UNIX tools Apple didn’t include with OS X.

For someone who has struggled with this sort of thing before, homebrew is pretty straightforward. Installing homebrew is just a case of copying a line of code from the installation page, pasting it into the terminal and pressing return.

imagemagick

Following the instructions from Ramble On I just typed brew install imagemagick in the terminal and hit return. Lots of scary text scrolls by:

Install Imagemagick

installing Tesseract

Once imagemagick was installed I repeated the process for Tesseract.

Testing Tesseract

As I was wanting to figure out how to use my phoe for OCR I took a photo of a bit of newspaper, I used Camera+, the clarity filter, cropped and made the image Black and White:

fr_160
Click the image to see fullsized on flickr

I used Wifi Photo Transfer to grab the photo from my camera and put it on the desktop.

The OCR process is in two steps using the terminal and the newly installed applications:

  1. Convert to 200dpi tiff:
    cd Desktop
    convert -density 200 -units PixelsPerInch -type Grayscale +compress fr_160.jpg fr_160.tif
  2. Preform OCR on the tif
    tesseract fr_160.tif fr_160 -1 eng

I now have two extra files on my desktop, fr_160.tif and fr_160.txt, the txt file contains the OCR text:

(_;oogle is facing fresh criticism after
admitting that it has not deleted all of the
private data, including emails and pass-
words, it secretly collected from internet
users around the UK as it gathered data for
its Street View maps.
The search firm was ordered in Decem-
ber 2010 to delete the private information
hoovered up by its Street View cars from
open Wi-Fi networks. r
But yesterday Google told the Infor-
mation Commissioner’s Office “human
error” had prevented it from erasing the
data, which could include the millions of
emails and passwords .
Google admitted in May 2010 its Street
View cars had “mistakenly” collected pri-

Which is pretty good.

OCR for dropbox

I now can see that tesseract works well and needed to make it work on images added to a particular dropbox folder.

There are a few folder action scripts that come with a mac, there are in /Library/Scripts/Folder Action Scripts/ several of these deal with images files ad contain routines for handling the dropping of files. These ‘standard’ routines move added files of the correct file type to a subfolder and then pass them on to a sub-routine that deals with the files. I could just duplicated one of these and edit the process_item sub routine. Basically I just scripted the process tested above. I’ve uploaded the script ocr folder action as html, incase anyone will find it useful or fun.

To use the script you put it in the Folder Action Scripts (copy the text of the html file paste it in the appleScript script editor.). Add a folder to dropbox and attached the script to that (right click on the folder and choose Folder Actions Setup…).

Most of my bit of the script just uses do shell script to run the scripts above, the only gotcha was that although I can use convert in the terminal, in a script I have to use the full path to the script:
set ocrscript to

"/usr/local/Cellar/tesseract/3.01/bin/tesseract '" & tif_file & "' '" & tif_file & "' -1 eng"

do shell script ocrscript

This is to do with the way homebrew installs applications and the fact AppleScript doesn’t access commands from /usr/local/….

My script is fairly crude, especially about file endings, if I add :Photo 28-07-2012 12 35 55.jpg to the dropbox folder, it is moved into the processed files folder and Photo 28-07-2012 12 35 55.jpg.tif and Photo 28-07-2012 12 35 55.jpg.tif.txt are created. Not elegant.

The whole process from taking a photo to opening the txt file in dropbox only takes a couple of minutes when using 3G. The system will not deal with columns or more than a single block of text but it does that fairly well. Mostly it was fun to figure out how to do.

Like many folk who teach using ict and blog about using computers in teaching I take a lot of screenshots. Macs have great keyboard shorts cuts for this built into the system:
?-shift-3 put a screenshot of the whole screen on the desktop.
?-shift-4 gives you cross hairs to snap a selection.windowshadow

While in the selection mode you can press the space bar and the cross-hairs turn into a camera icon, this allows you to capture a window, menu or other gui element and adds a nice drop shadow to it automatically.

With both keyboard commands you can hold the control key down and the screenshot will go to the clipboard rather than the desktop. The latest version of the MAC OS uses png files as default.

This is very useful stuff and I usually just take the screenshot with the control key down and paste into ImageWell for annotating, cropping resizing and uploading, all of which ImageWell does very quickly and efficiently. ImageWell even put the html image tag onto the clipboard after uploading.

I know a lot of folk use skitch for this sort of thing, but I’ve always found ImageWell fits better with my style of working.

So I though I was pretty well fixed for taking screenshots, but I have now downloaded the demo of LittleSnapper, Screen and Web Snapping for Mac OS X to give it a try. LittleSnapper doesn’t do much more that the above mac screen capture as far as capturing from the desktop, but it then handles the pictures in some very useful ways. The application instals a system wide menu which lets you take a variety of screenshots but instead of the resulting pictures ending up on the clipboard the end up in LittleSnapper.

The LittleSnapper interface is quite familiar if you use iPhoto, itunes and the like. Very intuitive it allows you to tag, rate and describe the images. You can organise them into folders, collections (sets for folders) and with smart folders.

You can annotate the images, adding text, blurs (useful for usernames and personal details), highlights and various vertor graphics.

I said above that LittleSnapper doesn’t do much more than the system for desktop screenshots, but it does for screenshots of websites where things become even more interesting. You can just use the system menu to snap your current browser window into your LittleSnapper application. When you do so it not only snaps the page it brings in the source code and the url of the page. You can also (again from the system wide menu or a keyboard shortcut) pull the current page into LittleSnapper’s built in web-browser. you can then snap an element of the page, you click the element selection tool and the mouse then highlights elements on the current webpage as you rollover them, paragraphs, divs, and other html define sections of the page. click on an element and then a button to snap the element. The element is added to your library awaiting annotation.

The annotations, crops, highlights etc are applied in a non destructive way so that you can roll back to the original image if you want.

After you have done all of this you can then upload the images in several ways, via ftp, to flickr (example) or QuickSnapper, this last is a companion site to littleSnapper with lots of flickrish, web2.0 features (example). The ftp and quicksnapper export worked seamlessly here, but the flickr export uploaded the pic to flickr but then LittleSnapper sat with a progress bar for a few minutes, LittleSnapper unexpectedly quit on cancelling the progress bar. The image was on flickr but on the tags or description.

From the Case Studies on the LittleSnapper site would suggest that the audience for the application is made up of designers and developers. I think that they could add eduTech to that list. For writing walkthroughs, documenting, blogging and presenting LittleSnapper looks like a very handy tool. If the flickr upload works it would be easy to write and publish guides to using software without leaving the application by producing a set of screenshots with descriptions. (This could then be published to a website using the flickr API perhaps.)

It would also be interesting if the app was AppleScriptable as another option for automatically publishing. I guess it is early days for that.

The only obvious thing I can see missing is a way to resize images before publishing them which would be very handy for blogging. I think I’ll stick with ImageWell for at least part of the process, but keep testing LittleSnapper for its organisational features.

If you are a mac using educator I’d recommend giving LittleSnapper the once over.