Computer Vision Toolbox Feature Enhancement Request?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
xingxingcui
am 30 Jul. 2021
Bearbeitet: Jayanti
am 15 Mai 2025
1、The third input parameter "labels" in the "selectStrongestBboxMulticlass" function should accept multiple types, such as string array, character cell vector, not just categorical array and numerical array
% official example in "selectStrongestBboxMulticlass" function
detectorInria = peopleDetectorACF('inria-100x41');
detectorCaltech = peopleDetectorACF('caltech-50x21');
I = imread('visionteam1.jpg');
[bboxesInria,scoresInria] = detect(detectorInria,I,'SelectStrongest',false);
[bboxesCaltech,scoresCaltech] = detect(detectorCaltech,I,'SelectStrongest',false);
labelsInria = repelem("inria",numel(scoresInria),1);
labelsInria = categorical(labelsInria,{'inria','caltech'});
labelsCaltech = repelem("caltech",numel(scoresCaltech),1);
labelsCaltech = categorical(labelsCaltech,{'inria','caltech'});
allBBoxes = [bboxesInria;bboxesCaltech];
allScores = [scoresInria;scoresCaltech];
allLabels = string([labelsInria;labelsCaltech]);% if it is string array, don't support???
[bboxes,scores,labels] = selectStrongestBboxMulticlass(allBBoxes,allScores,allLabels,...
'RatioType','Min','OverlapThreshold',0.65);
annotations = string(labels) + ": " + string(scores);
I = insertObjectAnnotation(I,'rectangle',bboxes,cellstr(annotations));
imshow(I)
title('Detected People, Scores, and Labels')
2,The first input parameter "bboxA" in the "bboxresize" function should accept a type based on the supported float type, not the current positive integer type
bboxA = rand(1,4)
bboxB = bboxresize(bboxA,2)
Error using bboxresize>iParseInputs (line 115)
The value of 'bboxA' is invalid. Expected input number 1, bboxA, to be integer-valued.
Error in bboxresize (line 48)
params = iParseInputs(bboxA,scale);
0 Kommentare
Akzeptierte Antwort
Jayanti
am 15 Mai 2025
Bearbeitet: Jayanti
am 15 Mai 2025
Hi,
If your labels are in the form of a string array or a character cell array, you can convert them to a categorical vector before passing them to the “selectStrongestBboxMulticlass” function. For example, if you have a string array named “strArray”, you can use:
labels = categorical(strArray);
And regarding your second query, in MATLAB R2021a “bboxresize” function required integer-valued bounding boxes. However, starting from R2022a, MATLAB updated the behaviour of “bboxresize” to fully support spatial coordinates.
You can refer to below documentation link for more details:
Hope this will be helpful!
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!