1 | initial version |
You may have some confusion about the order of the colors in the pixel (BGR vs RGB). Take a look at the definition of HSV color space and then, if necessary, experiment using images of known colors (e.g. all blue, all red, etc.).