Listing 4 below loads an RGB image and convert it to grayscale.
Listing 4: Convert RGB to grayscale
To convert image color space, simply use cvCvtColor. This function supports several color spaces. Consult OpenCV Reference Manuals for the details.
| 4. Copy an Image | 6. Access Image Data |
| Tel. | +62 31 8662872 +62 856 338 6017 |
| ICQ | 489571630 |
| Skype | dede_bl4ckheart |
| Yahoo | dede_bl4ckheart |
| nashruddin.amin |