Filling a group of pixels with a new color?
Ältere Kommentare anzeigen
I've taken a picture, say 10x10 pixels, and converted it to doubles like this:
a = imread('photo');
b = im2double(a);
This gives me a 10x10 matrix of numbers that represent each pixel. I want to take a group of these pixels and change them all to the same color. I've tried changing the pixel values to the same value but this seems to just change the intensity of the image in that pixel group from dim to bright red.
Example:
b(1:5,1:5) = 100;
% I'm taking the pixels from 1 to 5 on x and y and making their value in
the matrix the same thing. Again, this just changes the intensity of
that group of pixels.
How can I fill those pixels with the same color? I've tried using the fill function as well, nothing is working.
The image is an unedited screenshot that I took on my computer.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Contrast Adjustment finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!