-
Notifications
You must be signed in to change notification settings - Fork 0
/
tester.m
33 lines (25 loc) · 896 Bytes
/
tester.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function [ ] = tester( mdl, TEST_IMAGE_PATH, TARGET_OUTPUT )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
correctClassCount = 0;
incorrectClassCount = 0;
filenames = dir(fullfile(TEST_IMAGE_PATH, '*.jpg'));
for j = 1 : size(filenames, 1),
I = imread(fullfile(TEST_IMAGE_PATH, filenames(j).name));
featureSet = extractFeatureSet(I);
class = predict(mdl, featureSet);
if class == TARGET_OUTPUT,
correctClassCount = correctClassCount + 1;
else
'incorrectly classified:'
%imshow(I)
j
filenames(j).name
incorrectClassCount = incorrectClassCount + 1;
end
end
'correctly classified examples:'
correctClassCount
'incorrectly classified examples:'
incorrectClassCount
end