MATLAB: How to make text color black when using the function insertText

Computer Vision Toolboximage analysisimage processingimagesimreadinsertrgb

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

Best Answer

Read the rest of the documentation...
'BoxColor' Text box color
'yellow' (default) | character vector | cell array of character vectors | [R G B] vector | M-by-3 matrix
Use
DD= insertText(whiteImage, [100,234],'Hello World','FontSize',18,'TextColor','black','BoxColor','white');
It seems a more logical 'Default' choice would be the existing background color of the image, but I guess that's probably more difficult to ascertain...