필터 지우기
필터 지우기

How can I paint a list of pixels in a matlab image?

조회 수: 1 (최근 30일)
Wanderson
Wanderson 2012년 1월 16일
I'm working with a lot of images here and I have to find all the pixels above a scalar value and paint all them into any color.
I've all the indexes of this pixels but I don't know how can I paint them now...
Thx for the help again.
  댓글 수: 1
Jan
Jan 2012년 1월 16일
In which format are the "images" represented? Printed on paper, as JPEGs on the harddisk or as arrays in Matlab? What does "paint all of them in any color" exactly mean?

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

채택된 답변

Image Analyst
Image Analyst 2012년 1월 16일
Here's the way to do it without using slow loops:
grayImage = imread('coins.png');
subplot(2,2,1);
imshow(grayImage);
binaryImage = uint8(255 * ~(grayImage > 150));
subplot(2,2,2);
imshow(binaryImage, []);
uniformImage = uint8(255 * ones(size(grayImage)));
zeroImage = uint8(255 * zeros(size(grayImage)));
rgbImage = cat(3, uniformImage, binaryImage, zeroImage);
subplot(2,2,3);
imshow(rgbImage);

추가 답변 (2개)

Wanderson
Wanderson 2012년 1월 16일
LoL, sorry I'll try to explain it better now.
I have one image 320x256 as arrays in matlab. I use the function "find" to find all the pixels between 0 and 0.5 and I have to paint this set of pixel from "yellow" for example and them I'll do the same thing to find another set of pixel between 0.5 and 1.0 and paint this new set to "red".
better now?

Wanderson
Wanderson 2012년 1월 17일
Thank you both for the help.

카테고리

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