Вставка ограничивающих рамок, когда их больше двух - PullRequest
0 голосов
/ 30 октября 2019

Я хотел бы получить справку по следующему коду, в котором я хочу, чтобы в изображении или видео появлялись ограничивающие прямоугольники, если для обнаружения объекта их более двух ограничивающих прямоугольников или более, код

% PROCESS
    [bboxes, scores, label] = detect(detector,I,'MiniBatchSize', 128);

 % Select strongest detection 
% New - Find those bounding boxes that surpassed a threshold
T = 0.50; % Define threshold here
idx = scores >= T;
% Retrieve those scores that surpassed the threshold
s = scores(idx);
% Do the same for the labels as well
lbl = label(idx);
bboxes = bboxes(idx, :); % This logic doesn't change
for ii = 1 : size(bboxes, 1)
    annotation = sprintf('%s: (Confidence = %f)', lbl(ii), s(ii)); % Change    
    I = insertObjectAnnotation(I, 'rectangle', bboxes(ii,:), annotation); % New - Choose the right box
end
step(vidPlayer,I);
 i = i+1;
end
 results = struct2table(results);
 release(vidPlayer);
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...