Why do I write as Ib(1:478,31:565)(~BW) = 255
Ältere Kommentare anzeigen
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 Kommentar
xie
am 26 Feb. 2025
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 26 Feb. 2025
Bearbeitet: Walter Roberson
am 26 Feb. 2025
temp = Ib(1:478,31:565,:);
temp(~repmat(BW,1,1,ndims(temp))) = 255;
Ib(1:478,31:565,:) = temp;
3 Kommentare
xie
am 27 Feb. 2025
Walter Roberson
am 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
am 27 Feb. 2025
Kategorien
Mehr zu Contrast Adjustment finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







