Skip to content
Snippets Groups Projects
Commit 33d7479f authored by Eric Wait's avatar Eric Wait
Browse files

Added a variance filter for device calls

parent 8ea994ca
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,22 @@
#include <limits>
#include <omp.h>
template <class PixelTypeIn, class PixelTypeOut>
__global__ void cudaVarFilter(CudaImageContainer<PixelTypeIn> imageIn, CudaImageContainer<PixelTypeOut> imageOut, Kernel constKernelMem, PixelTypeOut minValue, PixelTypeOut maxValue)
{
Vec<size_t> threadCoordinate;
GetThreadBlockCoordinate(threadCoordinate);
if (threadCoordinate < imageIn.getDims())
{
double mu = 0.0, var = 0.0;
deviceMeanAndVariance(threadCoordinate, imageIn, constKernelMem, mu, var);
imageOut(threadCoordinate) = (PixelTypeOut)CLAMP(var, minValue, maxValue);
}
}
template <class PixelTypeIn, class PixelTypeOut>
__global__ void cudaStdFilter(CudaImageContainer<PixelTypeIn> imageIn, CudaImageContainer<PixelTypeOut> imageOut, Kernel constKernelMem, PixelTypeOut minValue, PixelTypeOut maxValue)
{
......
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