Why do I write as Ib(1:478,31:565)(~BW) = 255
이전 댓글 표시
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개)
Walter Roberson
2025년 2월 26일
편집: Walter Roberson
2025년 2월 26일
temp = Ib(1:478,31:565,:);
temp(~repmat(BW,1,1,ndims(temp))) = 255;
Ib(1:478,31:565,:) = temp;
댓글 수: 3
xie
2025년 2월 27일
Walter Roberson
2025년 2월 27일
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
2025년 2월 27일
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







