Created
March 23, 2016 14:35
-
-
Save udaya1223/5769ad4fe8b8f62227f8 to your computer and use it in GitHub Desktop.
Convert RGB image to HSV using OpenCV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mat srcImg = imread("image.jpg", CV_LOAD_IMAGE_COLOR); | |
Mat srcHSVImage, hue, sat, val; | |
vector<Mat> hsv; | |
cvtColor(srcImg, srcHSVImage, CV_BGR2HSV_FULL); | |
split(srcHSVImage,hsv); | |
hsv[0].copyTo (hue); //Hue channel | |
hsv[1].copyTo(sat); //Saturation channel | |
hsv[2].copyTo(val); //Value channel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment