Listing 5 below shows you a simple way to access image data using pointers. It loads an image, setup the pointer, and perform some manipulation to the image.
Listing 5: Access image data
The code above converts the image to grayscale manually only for an example. It is more efficient and much simpler if we just use built-in OpenCV functions to perform image manipulations (using cvCvtColor in this case).
| 5. Convert RGB to Grayscale | 7. Conclusion |
| Tel. | +62 31 8662872 +62 856 338 6017 |
| ICQ | 489571630 |
| Skype | dede_bl4ckheart |
| Yahoo | dede_bl4ckheart |
| nashruddin.amin |