Only calculate the absolute black threshold once.

This reduces the number of times the same calculation was performed, and
also downgrades float parameters to int when calling the image processing
functions.
Calculate the absolute white threshold in main() as well.
Group all the post-option parsing constant calculations together.
Calculate and use absolute values for black and grayfilters too.
Move some variables down the blocks.