Consider i have an image 'abc.jpeg' which is a RGB image how do i convert it to Grayscale without rgb2gray() func????
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sahithi N
am 2 Nov. 2016
Kommentiert: Sahithi N
am 3 Nov. 2016
can someone give the manual code
0 Kommentare
Akzeptierte Antwort
Nick Counts
am 2 Nov. 2016
Bearbeitet: Nick Counts
am 2 Nov. 2016
You can see how TMW does it with
open rgb2gray
The entire function is available for you to read.
Also, there are many color map manipulation tools available. See the documentation for
colormap
gray <- This one especially
That should point you in the right direction. (There is example code in the help for these functions)
If you need to literally do the math yourself, it boils down to matrix manipulation. You could brute force it by adding the R, G, and B matrices together and dividing by 3. That would give you some approximation of a brightness matrix, which is essentially the image in grayscale.
You can experiment with how you weight each color channel to get different results (kind of like using filters with black and white film).
Good luck!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Modify Image Colors 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!