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

Getstats for OtsuThresholdFilter

parent 985da167
No related branches found
No related tags found
No related merge requests found
function results = Getstats_OtsuThresholdFilter(img1,bytesize)
% Calculates a two class threshold using Otsu's method.
% Each pixel/voxel >= the threshold is set to the max value of the image space. All other values will be set at the minimum of the image space.
%
if (~exist('bytesize','var') || isempty(bytesize))
info = whos('img1');
bytesize = info.bytes;
end
image_out={};
for i=1:2
if (i == 1)
useMatlab = 1;
else
useMatlab = 0;
end
results(i).process = 'OtsuThresholdFilter';
if (useMatlab == 1)
results(i).Cuda_or_Matlab = 'MATLAB';
else
results(i).Cuda_or_Matlab = 'CUDA';
end
t1 = tic ;
image_out{i} = OtsuThresholdFilter(img1,1,useMatlab);
elapsedtime=toc(t1);
img_size = size(img1);
results(i).ImageSize = img_size;
results(i).timer = elapsedtime;
end
% Difference to check if addition by both methods result in same image
diffimage = image_out{2} - image_out{1};
if (sum(diffimage(:)) == 0)
accuracy = 100;
else
accuracy = 0;
end
results(1).accuracy = accuracy;
results(2).accuracy = accuracy;
results(1).ByteSize = bytesize;
results(2).ByteSize = bytesize;
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