Added threshold parameter

Removed 0.8 hardcoding of r,g,b threshold and replaced with a single
input argument arg$threshold.