Skip to content
Snippets Groups Projects
Commit cbbdf8d1 authored by actb's avatar actb
Browse files

nlmeans - add an eps to denominator variance

parent 7a8ae0fd
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -50,7 +50,7 @@ __global__ void cudaNLMeans_mv(CudaImageContainer<PixelTypeIn> imageIn, CudaImag
float kernelVarVal = (float)imageVariance(kernelPos);
float kernelVal = (float)imageIn(kernelPos);
double w = SQR(inputMeanVal - kernelMeanVal) / (inputVarVal + kernelVarVal);
double w = SQR(inputMeanVal - kernelMeanVal) / (inputVarVal + kernelVarVal + 1e-9);
w= exp(-w / SQR(h));
if (w > wMax)
wMax = w;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment