A Example source code for rgb histogram, the source code uses calcHist function in opencv.
Important things in the source code are the part of split rgb mat to vector[3] and drawing part.
Read the code carefully, so then you can understand easliy. ^^
Another routine is FREAK feature extraction.
Firstly, find feature using FAST_GPU, and extract FREAK descriptor.
After extraction, 2 descriptor can compare same image or not.
This code is made for processing time check.
The process is enough to processing in real time, because image is resized and use GPU.