1 stddev seems to be sufficient.
enhance contract with sigmodial
change the border trimming process such that black scanlines can really
be removed with flood-fill.