Search code examples
opencvhsv

HSV colour space and CvInRangeS function


cvInRangeS(imgHSV, cvScalar(15, 234, 120), cvScalar(21, 234, 120), imgThreshed);

I am wondering what each parameter in the cvScalar function represents. I thought it would be HSV but it doesnt seem to be thresholding the desired color. Could someone explain the parameters a bit clearer?


Solution

  • It means

    H - Hue, S - Saturation, V - Value

    take a look in here for understanding each one of those:

    http://en.wikipedia.org/wiki/HSL_and_HSV

    the color is mainly defined in the Hue component. There is a good tutorial about thresholding in HSV space in here:

    http://aishack.in/tutorials/thresholding/