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

Getstats for NormalizedHistogram

parent 9ea7a85c
No related branches found
No related tags found
No related merge requests found
function results = Getstats_NormalizedHistogram(img,numBins,bytesize)
% Collects stats of performance and accuracy for CudaMex and Matlab
% implementations of NormalizedHistogram calculation
%
if (~exist('bytesize','var') || isempty(bytesize))
info = whos('img1');
bytesize = info.bytes;
end
for i=1:2
if (i == 1)
useMatlab = 1;
else
useMatlab = 0;
end
results(i).process = 'NormalizedHistogram';
if (useMatlab == 1)
results(i).Cuda_or_Matlab = 'MATLAB';
else
results(i).Cuda_or_Matlab = 'CUDA';
end
t1 = tic ;
histo{i} = NormalizedHistogram(img,numBins,1,useMatlab);
elapsedtime=toc(t1);
img_size = size(img);
results(i).ImageSize = img_size;
results(i).timer = elapsedtime;
end
% Difference to check if addition by both methods result in same image
diffhist = histo{2} - histo{1};
if (sum(diffhist(:)) == 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