画像の黒を白に置き換える方法を知りたいです

13 visualizzazioni (ultimi 30 giorni)
渓太
渓太 il 6 Dic 2022
Commentato: 渓太 il 9 Dic 2022
お世話になります。
添付画像のうち、画素値が[0 0 0]の部分を[255 255 255]に置き換えたいのですが、やり方が分かりません。
もしご存知でしたら、教えてください。

Risposta accettata

Hernia Baby
Hernia Baby il 6 Dic 2022
まずは読み込みます。
I = imread("image.png");
imshow(I)
バイナリイメージを作成します。
Ir = I(:, :, 1);
Ig = I(:, :, 2);
Ib = I(:, :, 3);
idx = Ir == 0 & Ig == 0 & Ib ==0;
imoverlayでバイナリイメージからtrueの値を着色します。
I1 = imoverlay(I,idx,'w');
imshow(I1)
  1 Commento
渓太
渓太 il 9 Dic 2022
できました!
ありがとうございます、助かります!

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!