フィルターのクリア

fprintf showing multiple boxes instead of value

3 ビュー (過去 30 日間)
Muhamad Luqman Mohd Nasir
Muhamad Luqman Mohd Nasir 2021 年 6 月 21 日
Hi i was trying to display student id: 164335 as im working on digit recognition using CNN
but instead it shows multiple boxes and not 164335
and when i change the script label = classify ( net, I) to label(k) = classify ( net , I ) with added script k = k + 1 the net recognize the digit wrongly
Below is the script
myFolder = 'D:\CNN test\segmentedImages1';
% Get a list of all files in the folder with the desired file name pattern.
filePattern = fullfile(myFolder, '*.png');
theFiles = dir(filePattern);
storedStructure = load('test2.mat');
net = storedStructure.net;
%i = 0;
label = zeros(1,1e6);
%label = [];
for k = 2 : length(theFiles)
baseFileName = theFiles(k).name;
fullFileName = fullfile(theFiles(k).folder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
I = imread(fullFileName);
subplot(3, 4, k);
imshow(I); % Display image.
drawnow; % Force display to update immediately.
%label(k) = classify(net,I);
%i = 0;
k = k + 1;
label(k)=(classify(net,I));
title([' Recognized Digit is ' char(label(k))])
end
%% Displaying Detected Text
fprintf( 'student id: %s\n',label)

回答 (0 件)

カテゴリ

Help Center および File ExchangePattern Recognition and Classification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by