1

I am using this script

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

On one of the input it gave this result- input 1 output 1

while on the other example it gave- input 2 output 2

What could I change to get clean up the green board image I have like the whiteboard one?

Shivendra
  • 1,076
  • 2
  • 12
  • 26

1 Answers1

0

You'll need to adjust the channel/level correction. Something like 50%,81%,0.1. Also switch the -morphology to EdgeIn Octagon. Adjusting the blur & maybe switch colorspace at the end could help.

#!/bin/bash 
convert "$1" \
        -morphology EdgeIn Octagon \
        -negate -normalize -blur 0x2 \
        -channel RGB -level 50%,81%,0.1 \
        -colorspace Gray \
        "$2"

Blackboard Imagemagick

emcconville
  • 23,800
  • 4
  • 50
  • 66
  • Thanks for the answer. I have few doubts though. Why did you put colorspace as gray ? Can I do this while preserving the original colours (In the original script the colour is preserved) ? Do you have any suggestions for preserving the smoothness of the edges? They seem thicker. – Shivendra Apr 28 '14 at 14:16
  • No need for the colorspace, completely optional. The thickness was increased by adjusting the blur. Checkout the usage documentation on [Morphology](http://www.imagemagick.org/Usage/morphology/#difference) for great examples on preserving the edges. – emcconville Apr 28 '14 at 14:20