Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Piyum Rangana
Piyum Rangana am 5 Mär. 2017
Kommentiert: Jan am 6 Mär. 2017
How I set all channels(RGB) into zero of a particular pixel in a RGB image ?

Antworten (1)

Jan
Jan am 5 Mär. 2017
Bearbeitet: Jan am 5 Mär. 2017
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.
  2 Kommentare
Piyum Rangana
Piyum Rangana am 5 Mär. 2017
Bearbeitet: Piyum Rangana am 5 Mär. 2017
Hi Jan
Although I set zero like that, the uint8 array values does not get 0. in my case it is a '16×35×3 uint8 array'.

Melden Sie sich an, um zu kommentieren.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by