how to get started with training image labeler?

5 views (last 30 days)
Hi everyone,
I'm a newbie to Matlab and I need to use "computer vision" for "trainCascadeObjectDetector". I have two options, either to use Cascade trainer or  training image labeler app, which one is better? I tried to use training image labeler and I got .mat file exported after but I don't know what is the next step. any help will be appreciated!
When I clicked generate Matlab code I got the following code:
function importfile(fileToRead1)
    %  Imports data from the specified file
    %  FILETOREAD1:  file to read
    %  Auto-generated by MATLAB on 29-Oct-2015 19:09:24
    % Import the file
    newData1 = load('appleSession-mat', fileToRead1);
    % Create new variables in the base workspace from those fields.
    vars = fieldnames(newData1);
    for i = 1:length(vars)
        assignin('base', vars{i}, newData1.(vars{i}));
When I run it I got the following error:
 >> importfile
    Not enough input arguments.
    Error in importfile (line 9)
    newData1 = load('appleSession-mat', fileToRead1);

Accepted Answer

Dima Lisin
Dima Lisin on 29 Oct 2015
Hi Shahad,
If you use the Training Image Labeler app, once you are done labeling the objects, you have to click the "Export ROIs" button. The one with the "checkmark" icon. This will create a variable in your workspace called positiveInstances, which contains the image file names and the bounding boxes that you have labeled. This is one of the inputs into trainCascadeObjectDetector function.
raed bou aram
raed bou aram on 2 Dec 2016
Hi Dima, I am also trying to do trainCascadeObjectDetector to detect blood capillaries ( 15 capillaries) , and use image processing to compare one by one with the same capilar (example: capilar one with capilar 1 centrifuged). Is this viable? any advice? thanks for helping and for this and future advice.

Sign in to comment.

More Answers (0)


Find more on Image Processing and Computer Vision in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by