How can this code be modernized?
    4 ビュー (過去 30 日間)
  
       古いコメントを表示
    
So currently I came across a really interesting code which I want to implement in a school project.
While running it, I have come across the issue with vision.TextInserter. I know that the modern way to insert text is to use the function insertText but I cannot seem to figure out how to correctly execute that function. Can someone help me solve that issue?
0 件のコメント
回答 (1 件)
  Prajit T R
      
 2018 年 4 月 9 日
        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
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で Point Cloud Processing についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

