Bounding Box Not Drawn/Some Variables Are Empty
古いコメントを表示
Hi Professionals,
Me here again,
I managed based on some advice but the advice only got me thus far as i 've tried google and this community as well but i am grateful!
What I am trying to do is draw the yellow box around the object of interest and it's challenging!
Can someone tell me why these variables are empty when the data is loading and traning without error please?
please point me in the right direction so that i can get this sorted!!
Thank you in adavance for acknowledging me!
I will upload and image of the empty variables and dispense my code!
Please see screen shot for details
Mycode:
%% Training the R-CNN detector. Training can take a few minutes to complete.
% Loading .MAT file, the ground truths and the Network layers
load('gTruth.mat')
net = alexnet
%load('gimlab.mat', 'gTruth', 'net');
rcnn = trainRCNNObjectDetector(gTruth, netTransfer, opts, 'NegativeOverlapRange', [0 0.3])
%% Testing the R-CNN detector on a test image.
img = imread('Gun00011.jpg');
[bbox, score, label] = detect(rcnn, img, 'MiniBatchSize', 32);
%% Displaying strongest detection result.
[score, idx] = max(score);
bbox = bbox(idx, :);
annotation = sprintf('%s: (Confidence = %f)', label(idx), score);
detectedImg = insertObjectAnnotation(img,'rectangle', bbox, annotation);
figure
imshow(detectedImg)
回答 (3 件)
Dinesh Yadav
2020 年 1 月 22 日
0 投票
Hi Matpar,
Even though you have loaded and trained on the data without error, the reason your bounding box shows empty is because during testing the RCNN detector is unable to find the object (matching class) in the image and hence is does not draw any bounding box(therefore, bbox is empty matrix).
4 件のコメント
jaida alsuhaibani
2020 年 2 月 10 日
im facing the same problem with https://www.mathworks.com/help/vision/examples/object-detection-using-faster-r-cnn-deep-learning.html tutorial.
[bboxes,scores] = detect(detector,I); always return empty boxes and scores even though the dataset is about 500 images.
Matpar
2020 年 2 月 10 日
France
2020 年 3 月 19 日
0 投票
Dear Matpar,
I'm in the same situation. have you understood the problem so far?
thank you!
1 件のコメント
France
2020 年 3 月 19 日
Thanks a lot! I will try with all your suggestions!!
カテゴリ
ヘルプ センター および File Exchange で Object Detection についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

