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

2 visualizaciones (últimos 30 días)
Piyum Rangana
Piyum Rangana el 5 de Mzo. de 2017
Comentada: Jan el 6 de Mzo. de 2017
How I set all channels(RGB) into zero of a particular pixel in a RGB image ?

Respuestas (1)

Jan
Jan el 5 de Mzo. de 2017
Editada: Jan el 5 de Mzo. de 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 comentarios
Piyum Rangana
Piyum Rangana el 5 de Mzo. de 2017
Editada: Piyum Rangana el 5 de Mzo. de 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'.

Iniciar sesión para comentar.

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by