I took a class on computer vision and we used the OpenCV library extensively [0]. I remember that we had a project relating to detecting certain traffic signs, and obtaining the dominant color of images was a big part of my solution. Also, this tutorial seems like it would be helpful [1].