Revised Gaussian filter sigma calculation and added options for debug and verbose output.