Hi Francisco
Here is an example of how you can modify the code to incorporate 'insertText':
%rgbFrame = step(vidDevice);
text_str= 'Red'
position = [5 2];
box_color = 'red'
htextinsRed = insertText(rgbFrame,position,text_str,'FontSize',18,'BoxColor',box_color,'BoxOpacity',0.4,'TextColor','white');
imshow(htextinsRed);
text_str= 'Green'
position = [5 18];
box_color = 'green'
htextinsGreen = insertText(rgbFrame,position,text_str,'FontSize',18,'BoxColor',box_color,'BoxOpacity',0.4,'TextColor','white');
imshow(htextinsGreen);
text_str= 'Blue'
position = [5 34];
box_color = 'blue'
htextinsBlue = insertText(rgbFrame,position,text_str,'FontSize',18,'BoxColor',box_color,'BoxOpacity',0.4,'TextColor','white');
For more details, you check out the folowing documentation link: https://www.mathworks.com/help/releases/R2017b/vision/ref/inserttext.html If any further changes are to be made, you can refer the above link for syntax and other information.
Hope this helps
Cheers
