Can't find the fault in my code.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I am doing a hand recognition project and I have a problem and I can't solve it.
That is the code our network was trained with. If I train the network it tells me that it has a accuracy of 99% percent but if I'm using the code below it dosen't recognize any hand gestures. It only shows me "search" which it only should do if its a black picture. Does anyone have an idea? Thank you!
clc;
close all;
%webcam
c = webcam('HD Pro Webcam C920');
load Network;
%handbox settings
Handbox=[0 0 300 300];
while true
video = c.snapshot;
%Video RGB to gray
video_grey = rgb2gray(video);
videoAdj = imadjust(video_grey);
%Video RGB to BW
BW = imbinarize(videoAdj);
%BW inverte
BW_inverse = imcomplement(BW);
%Fill holes
BW_IH = imfill(BW_inverse, 'holes');
%change format [x x 1] --> [x x 3]
BW_3D = repmat(BW_IH,[1 1 3]);
%Create Handbox
Handbox_new = insertObjectAnnotation(video,'rectangle',Handbox,'Handgeste');
Handbox_crop = imcrop(BW_3D,Handbox);
video_new = imresize(Handbox_crop, [227 227]);
%classify
label=classify(Network,video_new);
%show
imshow(Handbox_new);
title(char(label));
drawnow;
end
3 comentarios
Image Analyst
el 14 de Jun. de 2021
You might not have trained the network very well. Unfortunately we can't really tell that from Network, even if you did attach it, since it's basically a black box. We'd need to see all of your hundreds of training images. How many hand gestures were there? How many images did you use for each gesture?
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!