Why do I write as Ib(1:478,31:565)(~BW) = 255
Mostra commenti meno recenti
Ib(1:478,31:565)(~BW) = 255
Ib is a gray image. I want to set a fixed black region as blue, but this code is wrong.
Do we have simple method to finish it?
1 Commento
xie
il 26 Feb 2025
Risposta accettata
Più risposte (1)
Walter Roberson
il 26 Feb 2025
Modificato: Walter Roberson
il 26 Feb 2025
temp = Ib(1:478,31:565,:);
temp(~repmat(BW,1,1,ndims(temp))) = 255;
Ib(1:478,31:565,:) = temp;
3 Commenti
xie
il 27 Feb 2025
Walter Roberson
il 27 Feb 2025
Ib = randi([0 255], 500, 600, 3, 'uint8');
temp = Ib(1:478,31:565,:);
BW = rand(size(temp,1), size(temp,2)) > 0.8;
temp(~repmat(BW,1,1,size(temp,3))) = 255;
Ib(1:478,31:565,:) = temp;
xie
il 27 Feb 2025
Categorie
Scopri di più su Contrast Adjustment in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







