Show three circles on same image
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello i would like to have 3 circles on the same image in one figure Also i dispay a text but now the text is all at the same pixel maybe i could use a variable which counts some pixels down for each circle it will display? How can i do this? Here is my code:
%Image
I = imread ('bonds_image.jpg');
% excel File einlesen/ auswählen
[fileName,dirName]=uigetfile('T_APC_RUNKEYNUMBER_test.xlsx');
[~,~,rawData] = xlsread(fullfile(dirName,fileName));
%
I_with_circle = insertShape ( I , 'circle', [951 332 20] , 'LineWidth' , 5 , 'Color' , 'red');
I_with_circle_and_text = insertText(I_with_circle, [470, 12], 'Bond 1 Draht 1 Bottom', 'FontSize', 18, 'BoxColor', 'red', 'TextColor', 'black');
imshow(I_with_circle_and_text);
%
I_with_circle = insertShape ( I , 'circle', [664 331 20] , 'LineWidth' , 5 , 'Color' , 'red');
I_with_circle_and_text = insertText(I_with_circle, [470, 12], 'Bond 1 Draht 9 Bottom', 'FontSize', 18, 'BoxColor', 'red', 'TextColor', 'black');
imshow(I_with_circle_and_text);
%
I_with_circle = insertShape ( I , 'circle', [267 331 20] , 'LineWidth' , 5 , 'Color' , 'red');
I_with_circle_and_text = insertText(I_with_circle, [470, 12], 'Bond 1 Draht 19 Bottom', 'FontSize', 18, 'BoxColor', 'red', 'TextColor', 'black');
imshow(I_with_circle_and_text);
0 commentaires
Réponses (1)
Kim Winter
le 27 Juin 2018
Hi, For displaying all three circles at the same time, since they are all the same circle, just in different places, you actually only need one call for this.
I_with_circle = insertShape (I, 'circle', [951 332 20;664 331 20; 267 331 20], 'LineWidth', 5 , 'Color', 'red');
I_with_circle_and_text = insertText(I_with_circle, [470, 12], 'Bond 1 Draht 1 Bottom', 'FontSize', 18, 'BoxColor', 'red', 'TextColor', 'black');
imshow(I_with_circle_and_text);
As far as displaying the boxes separately, you can use the following (you can put in whatever positions you want).
position = [470,12; 470, 100; 470, 188];
box_color = {'red','red','red'};
text={'Bond 1 Draht 1 Bottom' 'Bond 1 Draht 9 Bottom' 'Bond 1 Draht 19 Bottom'};
I_with_circle_and_text = insertText(I_with_circle, position,text, 'FontSize', 18, 'BoxColor', box_color, 'TextColor', 'black');
imshow(I_with_circle_and_text);
Hope that helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!