Can't find the fault in my code.

조회 수: 2 (최근 30일)
Marlene Patterer
Marlene Patterer 2021년 6월 13일
댓글: Marlene Patterer 2021년 6월 14일
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
Image Analyst
Image Analyst 2021년 6월 14일
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?
Marlene Patterer
Marlene Patterer 2021년 6월 14일
We took 500 images for each gesture, so for the numbers 0-5. Shell I send you one of each? Or what else may I give you so you have a better picture of it? Thank you!
Which settings would you therefore use? Thank you!

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by