Color the the image
古いコメントを表示
Hi all,
How can I do the script for the 2 input images to produce the output image?
採用された回答
その他の回答 (1 件)
Mahesh Taparia
2022 年 2 月 28 日
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!
カテゴリ
ヘルプ センター および File Exchange で Images についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


