InsertText only showing the first text box of multiple.

2 views (last 30 days)
I'm trying to use insertText to overlay multiple text boxes on an image, but only the first text box is showing up and there is no error message. I followed the 'board' example exactly and I've checked that all of the positions are valid and on the image. There are 5 boxes in total.
Here is the code:
width=min(size(circle_blobs));
text=cell(length(ply_thickness),1);
position=zeros(length(ply_thickness),2);
position(:,2)=width/2;
for i = 1:length(ply_thickness)
position(i,1)=starts(i)+(ply_thickness(i)/2);
text{i}=['Layer ' num2str(i) ': ' num2str(ply_thickness(i),'%0.2f')];
end
overlay=insertText(uint8(boundaries)*255,position,text,'AnchorPoint','Center',FontSize=100);
figure
imshow(overlay)
  3 Comments
Krisztian
Krisztian on 17 Jul 2023
Here's the code, the image I'm getting out at the moment and a screenshot of the input image since it's bigger than 5MB. The goal is to have a label like the first one in the middle of each layer. Thanks
Krisztian
Krisztian on 18 Jul 2023
Problem solved. I had the x and ys the wrong way around. My brain didn't switch from working with a matrix to working with an image.

Sign in to comment.

Answers (0)

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!