Clean up pen-on-paper line drawings

lines plus paper minus paper equals line

I wrote up a proof of concept in MATLAB that performs the following steps:

  • Find edges in the image (note that this is different than finding lines, edges in our case occur on either side of a pen-on-paper line).
  • Find edges in image

  • Blur these edges using a blur kernel whose width is parameterized based on the expected thickness of the lines (smaller for ball-point pens, larger for thick markers).
  • blur edges in image

  • Threshold all values over some small amount in the blurred edges mask, also get rid of tiny regions.
  • threshold blurred in image

  • Fill use this mask as “holes” to be filled in via Laplacian hole-filling. Notice we now have an approximation of the blank sheet of paper:
  • Filled holes

  • Subtract the paper from the original image and intensify the lines so the image is black on white (but not necessarily a binary image):
  • Filled holes

    Results

    Here are some results. I compare the original photograph or scan of the line drawing with my best clean up job using (only) Curves in Photoshop and my automatic script. For my script I am not adjusting the parameters for each input. I have found a set of parameters that work well for pen on paper inputs and I used this preset for all the images shown in the table.

    Original

    Photoshop Curves

    MATLAB script

    arm

    arm curves

    arm automatic

    Page 2 of 5 | Previous page | Next page