How can I change the red pixel values that are greater than green and blue bands?
Show older comments
I have an RGB image, sized (128,128,3). I need to write a for loop and change the pixel values whose red band is larger than their green or blue channels, with white pixels. But I am new to programming and couldn't figure out how to write the for loop. i just have a basic structure;
image2 =ones(128)*255 % a matrix with all white pixel values(255)
for image(128,128,3);
if image(:,:,1) > image(:,:,2:3);
then image(:,:,1) = image2(:,:,1);
end
end
can you help me please?
Accepted Answer
More Answers (0)
Categories
Find more on Vehicle Network Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!