Custom Algorithm in Video Labeler returns "Unable to initialize Algorithm Error" with error in line algObj.delW(n) = (endROIpos(3) - startROIpo​s(3))/numF​ramesForIn​terp;

Hi MATLAB Community,
I am currently working in MATLAB Video Labeler and try to develop a custom automation algorithm to automate polygon ROIs by modifying from Temporal Interpolator algorithm.
I import the algorithm to the dropdown menu, as told for customized algorithms, and it works wihout a problem until executing the methods and functions to initialize the automation session.
The algorithm has a different name and description but similar setup and execution codes with Temporal Interpolator. I only modified the lines
labelType.Polygon; % (from Rectangle)
and
labelsToAutomate.Type{3}; % from {1}
and I comment the lines
% areTimestampsUnique = isequal(frameTime, unique(frameTime));
% repeatedTime = unique(frameTime(diff(frameTime)==0)); % ??
% msg = sprintf('Expected one ROI per video frame. Remove extra ROIs from frames at time: %s\n', ... % ...
% num2str(repeatedTime(:)')); % ...
% assert(areTimestampsUnique, msg);
because I got erorrs about the setup earlier. During the labeling, I do not use more than one label in each frame and I labeled at least two polygon ROIs for the same label.
I also want to attach the algorithm.
Your any helps are appreciated.
Sincerely,
Serdar

Respuestas (1)

I found that Storage Format of M-by-4 numeric matrix of the form [x, y, w, h] for rectangles does not support the one for Polygons. I will try to modify the setup and execution part of the code to fit to numeric matrix of the form [x1 y1; x2 y2; ... ; xN yN] for N points in the polygon.

Categorías

Preguntada:

el 21 de Feb. de 2022

Respondida:

el 3 de Mzo. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by