I try to insert multiple variables in video -- I got a simulink model, in which there are few objects that I track using computer vision toolbox. I also compute their speeds. So my goal is to display the speed value near corresponding object. I tried to do this with insert text block, but it seems, that it's unable to match the individual variable near corresponding coordinate, only text with use of '%s'. So i wrote a M-function block, using the following code: textInserter = vision.TextInserter('%.2f','LocationSource','Input port','Color', [255, 255, 255],'FontSize', 12); J = step(textInserter, image_in, objspeed_in,int32(coordinates_in));
It works well, but it is EXTREMELY slow. So I want to ask, if there is some way, to make "Insert Text" block work the way I want it, or some faster executing variant of the insert text code.