I am trying to use the trainRcnnObjectDetector on R2020b (I have all toolboxes) and the example input is a table of image locations (allready created and loaded as a .mat). My images are frames in an array of 256x256x4000. So 4000 frames with no individual .jpg corresponding files. How can I input image data into these detector functions? It seems rediculuous to save all frames as .jpg files (4000 files) just so they can be imported from their location in the table. Even doing this I was unable to get the table to act like their example table. I not share my code as it is on a isolated air-gap computer but I can show some code from the example
options = trainingOptions('sgdm', ...
'MiniBatchSize', 128, ...
'InitialLearnRate', 1e-3, ...
'LearnRateSchedule', 'piecewise', ...
'LearnRateDropFactor', 0.1, ...
'LearnRateDropPeriod', 100, ...
'MaxEpochs', 100, ...
'Verbose', true);
% Train an R-CNN object detector. This will take several minutes.
rcnn = trainRCNNObjectDetector(stopSigns, cifar10Net, options, 'NegativeOverlapRange', [0 0.3], 'PositiveOverlapRange',[0.5 1])
where the stopSigns table looks like
stopSigns =
41×2 table
imageFilename stopSign
____________________________________________________________________________ ____________
'C:\RTN\MATLAB\R2018a\toolbox\vision\visiondata\stopSignImages\image001.jpg' [1×4 double]
'C:\RTN\MATLAB\R2018a\toolbox\vision\visiondata\stopSignImages\image002.jpg' [1×4 double]
'C:\RTN\MATLAB\R2018a\toolbox\vision\visiondata\stopSignImages\image003.jpg' [1×4 double]
'C:\RTN\MATLAB\R2018a\toolbox\vision\visiondata\stopSignImages\image004.jpg' [1×4 double]
'C:\RTN\MATLAB\R2018a\toolbox\vision\visiondata\stopSignImages\image005.jpg' [1×4 double]
'C:\RTN\MATLAB\R2018a\toolbox\vision\visiondata\stopSignImages\image006.jpg' [1×4 double]
I would like to skip the file nonsense and use the image array I have (already parsed from a video). Any pointers would be great.
I tried writing individual .jpg files but could not correctly reconstruct the table, seems to be issues with the stopSign column being listed as {1x4 double} cells and not the example's [1x4 double], not sure how to fix that either. But I would like to know how to input the image array directly.
The matlab help menu and site is no help as they have a premade table of image locations only.