how to mask hue channel - threshold

asked 2014-04-02 14:50:09 -0600

updated 2018-10-26 15:54:08 -0600

Hi Guys ! I´m an beginner but i´ll not give up ;). Nevertheless I would be thankful for help.

I want to mask the hue channel by thresholding.

what I have:

Mat image = imread.....

cvtColor(image, image_hsv, CV_BGR2HSV);
// split 
vector<Mat> hsv_channel;
      split(image_hsv, hsv_channel);
      hsv_channel[0] // H channel
      hsv_channel[1] // S channel
      hsv_channel[2] // V channel

 Rect roi(point1x, point1y, (point2x-point1x), (point2y-point2y));

threshold(roi, image_mask, 0, 255, CV_THRESHOLD_BINARY_INV );

I dont know how to mask the Hue channel... would be very thankful for help Thanks ! :)

edit retag flag offensive close merge delete

Comments

1

Probably you are looking for inRange()

Haris gravatar imageHaris ( 2014-04-02 22:28:34 -0600 )edit