Normalizing pixel colours of an RGB image
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Riccardo Rossi
am 27 Mai 2023
Kommentiert: Image Analyst
am 27 Mai 2023
Hello,
I need to normalize an RGB image by replacing each channel (RED, GREEN and BLUE) of each pixel with the following values:
RED=RED/(RED+GREEN+BLUE)
GREEN=GREEN/(RED+GREEN+BLUE)
BLUE=BLUE/(RED+GREEN+BLUE)
How can I do it? Thank you so much!
3 Kommentare
Image Analyst
am 27 Mai 2023
If that Answer solves your original question, then could you please click the "Accept this answer" link to award the answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.
Akzeptierte Antwort
DGM
am 27 Mai 2023
inpict = imread('peppers.png'); % uint8
inpict = im2double(inpict); % unit-scale float
outpict = inpict./sum(inpict,3); % all at once
imshow(outpict) % done
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Color Space Formatting and Conversions finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!