十一行代碼實現自動識別功能
clear
camera=webcam;%%打開攝像頭信息
nnet=alexnet;%%獲取神經網絡模型數據
while true%%死循環,不斷顯示
picture=camera.snapshot;%%獲取攝像頭信息
picture=imresize(picture,[227,227]);%%設置圖片大小
label=classify(nnet,picture);%%匹配圖片信息
image(picture);%%顯示圖片
title(char(label));%%顯示匹配內容
drawnow;
end