Coloring pixels with a specific color
Ältere Kommentare anzeigen
Is it possible to create an image (like the original) in which only the desired pixels are colored?
For example, I want to color white only the pixels with the numbers 25 to 27 (present inside 'grayLevel'). Any ideas?
rgb = imread('example.jpg');
%% Matrix of pixels
Number_Of_Rows = height(rgb);
Number_Of_Columns = width(rgb);
grayLevel = zeros(Number_Of_Rows,Number_Of_Columns);
for Row = 1:Number_Of_Rows
for Column = 1:Number_Of_Columns
grayLevel(Row,Column) = rgb(Row, Column);
end
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Region and Image Properties 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!