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

조회 수: 1 (최근 30일)
Piyum Rangana
Piyum Rangana 2017년 3월 5일
댓글: Jan 2017년 3월 6일
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.
  댓글 수: 2
Piyum Rangana
Piyum Rangana 2017년 3월 5일
편집: Piyum Rangana 2017년 3월 5일
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'.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by