Bounding Box Not Drawn/Some Variables Are Empty

10 visualizzazioni (ultimi 30 giorni)
Matpar
Matpar il 19 Gen 2020
Commentato: France il 19 Mar 2020
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)

Risposte (3)

Dinesh Yadav
Dinesh Yadav il 22 Gen 2020
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 Commenti
Matpar
Matpar il 10 Feb 2020
Modificato: Matpar il 10 Feb 2020
what i do is go to the workspace with the same link you provided and observe what is being produced when the code is in progress!
ohhhhhh! by the way Dinesh Yadav provided some insight but this same code produced the result perfectly but when i try another image is did not detect anything and when I swapped back Unknown.pngthe image that had the perfect result, the bounding box was empty and this has been the case since then!
I have been searching for a method to get this accurate but this is ongoing and the challenge is still with me!
if you have another link i would gladly take a look at it to see if i can move forward but thus far this is where i have gotten too!

Accedi per commentare.


France
France il 19 Mar 2020
Dear Matpar,
I'm in the same situation. have you understood the problem so far?
thank you!

Matpar
Matpar il 19 Mar 2020
Modificato: Matpar il 19 Mar 2020
Hey France ,
Yes I manage to the solve this by myself and i am so proud, thus far it was frustrating but I got through with this!
  1. ensure your labling is completed properley this is what is causing the issue. if the system has nothing to compare the positive region of interest with guess what? it will not present the bounding box and the results you are looking for! unfortunately in the examples loads of details are missing and well by trial and error you have to figure this out, or if a kind soul decides to assist you!
  2. Specify the negative blob in the labelling of the same image or point the system to a folder of images similar in gradient intesities and highlight the negative region of interest, (ie) everything that is not the object that you are trying to find!
  3. it is easier to specify the negative blog in the same image
  4. ensure that blob is small so that you can select the negative area as well i will attach an image check it out
  5. the region of the positive blog must be that same size with the negative blob on the same image
  6. if you are confuse that is normal check the image and you will see what i am talking about!
  7. export the labelling as a table to workspace not
  8. then the code above will work
  9. the labelling must be done for every image in the data set and yes it is tedious I suggest playing somemmusic whilst you do this!
  1 Commento
France
France il 19 Mar 2020
Thanks a lot! I will try with all your suggestions!!

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by