
Show HN – Command line method for digitizing photos of whiteboards - lelandbatey
About a month ago, after searching for an existing solution, I built a little script to take photo&#x27;s of whiteboards and clean them up&#x2F;make them into near perfect digital representations. Here&#x27;s the script:<p><pre><code>    #!&#x2F;bin&#x2F;bash
    convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2
</code></pre>
Example Input:<p><pre><code>    Input 1: http:&#x2F;&#x2F;i.imgur.com&#x2F;CTSIPwm.jpg
    Input 2: http:&#x2F;&#x2F;i.imgur.com&#x2F;37GXrwo.jpg
</code></pre>
Example Output:<p><pre><code>    Output 1: http:&#x2F;&#x2F;i.imgur.com&#x2F;Qf3jkBW.png
    Output 2: http:&#x2F;&#x2F;i.imgur.com&#x2F;oNueb0L.png
</code></pre>
The basic procedure was outlined in this excellent post for cleaning up whiteboard photos using GIMP: http:&#x2F;&#x2F;matthew.mceachen.us&#x2F;blog&#x2F;how-to-clean-up-photos-of-whiteboards-with-gimp-403.html I just replicated the procedure using Imagemagick.<p>Since I do a ton of work on whiteboards nearly every day, I found this really helpful for managing photos of my whiteboard work. I figured I should share this with you guys, since the HN community seems like the kind of people who&#x27;d make use of it.
======
dang
First, bravo! This post is made for HN.

Second, posts without urls (i.e. Ask HNs) have an automatic rank penalty
applied to them. Could you please put it up at an external url—even just a
pastebin would do—and resubmit it? It'll have a much better chance of making
the front page, where it belongs.

Alert readers may notice that I have to resort to this because we don't really
have any tools for making stories go up in rank. It's upvotes or nothing.

Also, I've got a sweet plan to get all the good Show HNs the attention they
deserve. It's a matter of finding time to implement it.

~~~
lelandbatey
I took your advice and posted a gist:
[https://news.ycombinator.com/item?id=7520216](https://news.ycombinator.com/item?id=7520216)

I actually made this gist a couple months ago when I first came up with this,
I can't believe I'd forgotten about it.

------
tekknolagi
Brilliant. I really love this. So basically:

`command input_whiteboard.jpg output_cleanedup.jpg`

I think the only problem I can see with this is the time it takes to convert;
on my MacBook Air 2012, running the command on the first input took >5
seconds.

~~~
lelandbatey
That invocation is precisely right. On my system, it's a shell script called
`cleanWhiteboardImage`; this is an actual command I've run, taken from my bash
history:

    
    
        cleanWhiteboardImage IMG_20140208_175541.jpg zoomedOut-action-flow-chart.png
    

Also, yes the time it takes to make this work can be problematic. That can be
mitigated by shrinking the image, though that decreases the quality of the
cleanup.

In reality though, I'm fine with it taking a couple seconds. My main
motivation wasn't so much to make this 'fast' as it was to automate the
process.

