I'm not entirely clear on the purpose of this - box and tophat kernels might be all 1's or 0's, but everything else should be non-boolean.  I think throughout, a term other than `weighted` may be appropriate, but I don't understand what it's doing well enough to suggest an alternative just yet.