How do I make text color black when using the function insertText
Ältere Kommentare anzeigen
Hello I created a white image using the code below. and then i inserted a text. but the text has yellow background. I dont know where this is coming from
N=500;
M=500;
whiteImage = 255 * ones(N, M, 'uint8');
DD= insertText(whiteImage, [100,234],'Hello World','FontSize',18,'TextColor','black');
imshow(DD);
Please help, how do I remove the yellow background under the text

Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 3 Feb. 2020
It comes from the 'BoxColor' option. See the documentation. To have background be white:
N=500;
M=500;
whiteImage = 255 * ones(N, M, 'uint8');
DD= insertText(whiteImage, [100,234],'Hello World','FontSize',18,'TextColor','black', 'BoxColor', 'white');
imshow(DD);
1 Kommentar
fadams18
am 3 Feb. 2020
Kategorien
Mehr zu Read, Write, and Modify Image finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
