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

Getstats for ThresholFilter

parent 374aff3c
No related branches found
No related tags found
No related merge requests found
function results = Getstats_ThresholdFilter(img1,threshold,bytesize)
% Collects stats of performance and accuracy for CudaMex and Matlab
% implementations of ThresholdFilter calculation
%
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 = 'ThresholdFilter';
if (useMatlab == 1)
results(i).Cuda_or_Matlab = 'MATLAB';
else
results(i).Cuda_or_Matlab = 'CUDA';
end
t1 = tic ;
image_out{i} = ThresholdFilter(img1,threshold,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