Add test for issue #2646
Fix integer overflow in NL-Means denoising on white input

Issues #2646