How to adjust reverse range for Hue in cvInRangeS?
You can generate two different threshold images, one with hue in the range from 0 to 10 and the other with hue from 170 to 180. To get an image with hue in range both from 0 to 10 and 170 to 180, just add the two threshold images together.

In C++ code this would look something like:

inRange(imgHSV, Scalar(0, sMin, vMin), Scalar(10, sMax, vMax), imgThresh);
inRange(imgHSV, Scalar(170, sMin, vMin), Scalar(180, sMax, vMax), imgThresh1);

Mat imgThreshCombined = imgThresh + imgThresh1;


You could probably do the same thing by finding the threshold image with hue in the range from 10 to 170 and then just subtracting it from a white image.