How can I classify the tracked position of a blob in a sequence of logical images using MATLAB "Classification Learner"?

1 vue (au cours des 30 derniers jours)
Hi everyone!
I have simplified my question down to basicly having a sequence of logical images with a blob in them (varying in size and position).
How can I train the classifier to label each blob position? e.g. "TOP', "MIDDLE", "BOTTOM" labels assigend to the blob according to its position within the field of view.
Cheers!

Réponses (1)

Vinai Datta Thatiparthi
Vinai Datta Thatiparthi le 30 Juil 2019
Hi Kam!
The Classification Learner App on MATLAB is a tool to work with Supervised Learning problems, where the performance is highly accurate when the input predictor variables are in the form of tables. Maybe, extracting some useful details from the images and feeding this data into the app could be a better approach. Directly applying the App may lead to potential loss in performance.
Further, the command regionprops would be helpful to you in extracting these details about the image. In fact, if you want to classify the images only based on the position and dimensions of the blob, you can do this very easily using regionprops function alone.
imds = imageDatastore(imageFolder, 'LabelSource', 'foldernames', 'IncludeSubfolders', true);
% According to your files
for i=1:numel(imds.Files)
im = readimage(imds,i);
im = imbinarize(im);
cent = regionprops(im, 'centroid');
minAxis = regionprops(im, 'MinorAxisLength');
majAxis = regionprops(im, 'MajorAxisLength');
% Enter Code Here to classify
% Or, use these paremeters to classify using the Classification Learner
% App
end
Using the above code, you may use these parameters and feed them into the Classification Learner Appand train the model, or you can write a simple if-else case to classify the images right here within the code.
For further help, refer to –

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by