Skip to content
Snippets Groups Projects
Commit dbc239da authored by sundar's avatar sundar
Browse files

MaxFilterKernel implementation

parent be7e6835
No related branches found
No related tags found
No related merge requests found
function imageOut = MaxFilterKernel(image1,kernel,device,useMatlab)
% This will set each pixel/voxel to the max value of the neighborhood defined by the given kernel.
if (~exist('device','var') || isempty(device))
device = 1;
end
if (~exist('useMatlab','var') || isempty(useMatlab))
useMatlab = false;
end
if (~useMatlab)
[numCudaDevices, memoryStats] = CudaMex('DeviceCount');
if (numCudaDevices < 1)
useMatlab = true;
elseif (device > numCudaDevices)
device = numCudaDevices;
end
% do something smart here if there is not enough memory...
end
if (useMatlab)
imageOut = imdilate(image1, kernel);
else
imageOut = CudaMex('MinFilterKernel',image1,kernel,device);
end
end
\ No newline at end of file
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