Need to set all channels(RGB) into 0 of a particular pixel in a RGB image

2 次查看(过去 30 天)
How I set all channels(RGB) into zero of a particular pixel in a RGB image ?

回答(1 个)

Jan
Jan 2017-3-5
编辑:Jan 2017-3-5
img = 0.6 + 0.4 * rand(30, 20, 3); % Test image with light colors
pixel = [12, 17];
img(pixel(1), pixel(2), :) = 0;
figure;
image(img);
Not the pixel at position (12, 17) is black.

产品

Community Treasure Hunt

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

Start Hunting!

Translated by