Automatic recognition of Matlab machine learning

 Eleven lines of code to achieve automatic identification

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

Guess you like

Origin blog.csdn.net/seek97/article/details/82823180