It is better to convert hsv colour space if you are doing colour based segmentation, as it doesn’t affect the brightness and light variation,
You could use the color range like
cvtColor(src, hsv, CV_BGR2HSV);
inRange(hsv,Scalar(0,50,40), Scalar(10,255,255),thr1); //upper red range of hue cylinder
inRange(hsv,Scalar(165,50,40), Scalar(179,255,255),thr2);// lower red range of hue cylinder
thr1+=thr2; // Red pixels.
Also see the colour hsv-wheel here which will help you to get exact colour range in hsv for a particular colour