MATLAB Answers

Computer Vision Toolbox Feature Enhancement Request?

1 view (last 30 days)
cui
cui on 30 Jul 2021
Edited: cui on 30 Jul 2021
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);
Error using selectStrongestBboxMulticlass
Expected input number 3, label, to be one of these types:

uint8, int8, uint16, int16, uint32, int32, double, single

Instead its type was string.

Error in selectStrongestBboxMulticlass>iCheckLabel (line 229)
validateattributes(value,{'uint8', 'int8', 'uint16', 'int16', 'uint32', ...

Error in selectStrongestBboxMulticlass>iCheckInputBboxScoreAndLabel (line 216)
iCheckLabel(label)

Error in selectStrongestBboxMulticlass>iParseInputs (line 244)
iCheckInputBboxScoreAndLabel(bbox, score, label);

Error in selectStrongestBboxMulticlass (line 115)
[ratioType, overlapThreshold, numStrongest] = iParseInputs(bbox,score,label,varargin{:});
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);

Answers (0)

Community Treasure Hunt

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

Start Hunting!