hand_seg = dir(['Z:\eee_biophotonics1\Shared\SPOT dataset (Training dat' ...
'a)\Testing Images\images 123 network 456 (completed)\hand seg\*.tif']);
NN_seg = dir(['Z:\eee_biophotonics1\Shared\SPOT dataset (Training data' ...
')\Testing Images\images 123 network 456 (completed)\nn seg\*.tif']);
x_max = 400; y_max = 512;
FP = 0; FN = 0; TP = 0; TN = 0;
acc = nan; spec = nan; sens = nan;
nfiles = length(hand_seg);
image_hand = hand_seg(j).name;
folder_hand = hand_seg(j).folder;
full_dir_hand = fullfile(folder_hand,image_hand);
im_hand = imread(full_dir_hand);
image_NN = NN_seg(j).name;
folder_NN = NN_seg(j).folder;
full_dir_NN = fullfile(folder_NN,image_NN);
im_NN = imread(full_dir_NN);
colour_hand = impixel(im_hand,x,y);
colour_NN = impixel(im_NN,x,y);
if colour_hand == 0 && colour_NN == 0
elseif colour_hand == 0 && colour_NN ~= 0
elseif colour_hand ~= 0 && colour_NN == 0
elseif colour_hand ~= 0 && colour_NN ~= 0
fprintf("Image Number = %d\t", j);
fprintf("True Positive = %d\t", TP);
fprintf("True Negative = %d\t", TN);
fprintf("False Positive = %d\t", FP);
fprintf("False Negative = %d\n", FN);
acc = (TP + TN)/(TP + TN + FP + FN);
fprintf("Accuracy = %f\t", acc)
fprintf("Specificity = %f\t", spec);
fprintf("Sensitivity = %f\t", sens);