Determine class of image using neural network

2 views (last 30 days)
I have written a code to detect face and give it to a trained network. Its work is to detect which face is it based on the training. I only get numbers between 49 and 50. I don't know what it means and how to use this number to get which image is it. During training the target set was numbers, different numbers for different images. I want the image number set during the training when testing my neural net. Here is my code to test my network :
function name = search( net, img )
faceDetector = vision.CascadeObjectDetector();
disp('Detecting face of input image.');
bbox=step(faceDetector, img);
max=1;
for i=1:size(bbox,1);
if(areaRect(bbox(max,:))<areaRect(bbox(i,:)))
max=i;
end
end
img=img(bbox(max,2):bbox(max,2)+bbox(max,4),bbox(max,1):bbox(max,1)+bbox(max,3));
imshow(img);
disp('scanning for result.');
hs=im2vec(imresize(img,[27 18]));
name=sim(net,hs)
end
function area = areaRect(rect) area=rect(3)*rect(4); end
Please help me with this.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!