Color the the image
Mostrar comentarios más antiguos
Hi all,
How can I do the script for the 2 input images to produce the output image?
Respuesta aceptada
Más respuestas (1)
Mahesh Taparia
el 28 de Feb. de 2022
Hi
This problem can be solve by adding the image of both the letter 'U' and 'H' and doing some color changing. At first, split the image from middle to 2 images of letter 'U' and 'H'. For example, consider the code below:
a=rgb2gray(imread('uh.png'));
sz = size(a);
u = a(:,1:sz(2)/2);
h = a(:,sz(2)/2+1:end);
Then add the images of both the letters and change the color as per requirement. Use 'insertText' function to add text inside the image, you can change the text color, box color, etc. For more information, you can refer its documentation here. For example, consider the below code
uh = u+h;
I = zeros(162,160,3);
I(:,:,1) = uh; % To keep red background, you can change the color as per need
I = insertText(I,[35,7],'Output 2: UH Red');
figure;imshow(I)
Hope it will help!
1 comentario
Tu Nguyen
el 28 de Feb. de 2022
Categorías
Más información sobre Images en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


