How can i Change pixel color?
Ältere Kommentare anzeigen
Hello
I have a color image of type RGB and I need to change the color of each point (red, yellow, orange) to green. I hope that there is a programmatic solution to this problem.
5 Kommentare
jonas
am 7 Jul. 2020
What do you mean "of each point"? Better upload an example image and explain what type of output you're looking for.
Ansam Nazar
am 7 Jul. 2020
Mehmed Saad
am 7 Jul. 2020
Bearbeitet: Mehmed Saad
am 7 Jul. 2020
Suppose i have a picture of size 400x400. When i import it in MATLAB (using imread or directly) the matrix size will be 400x400x3 uint8. Now the 3rd dimension depicts R,G and B. Now you can apply conditions on these three colors for 1 pixel and change there values as you want
For example True red is [255 0 0], now apply a check that if this condition satisfies change pixel to
[0 255 0]
jonas
am 7 Jul. 2020
Better replace loop by logical indexing and upload an example image.
Mehmed Saad
am 8 Jul. 2020
jonas is right, understand the code and try to replace for loops with logical indexing
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Image Arithmetic finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


