# Revision history [back]

### Separate red detection and red reflection from an object

Hello,

Please i need your help, i want to detect a red color in an image, i change the channel to HSV to detect "lower red" and "upper red" by this code and it's working : .

            cvtColor(im, imHSV, COLOR_BGR2HSV);
inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);


But i have a problem with this image (in the top right of the image), it's detected as red, i think it's the reflexion of light on a red object :

I used this link ( https://pinetools.com/image-color-picker) to find HSV values of this part of the image, and that's what i found : it's aroud : H : 18 S : 29 V : 27

I I don't understand why i am detecting this as red, i need your help and thank you.

### Separate red detection and red reflection from an object

Hello,

Please i need your help, i want to detect a red color in an image, i change the channel to HSV to detect "lower red" and "upper red" by this code and it's working : .

            cvtColor(im, imHSV, COLOR_BGR2HSV);
inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);


But i have a problem with this image (in the top right of the image), it's detected as red, i think it's the reflexion of light on a red object :

I used this link ( https://pinetools.com/image-color-picker) to find HSV values of this part of the image, and that's what i found : it's aroud : H : 18 S : 29 V : 27

I I don't understand why i am detecting this as red, i need your help and thank you.

### Separate red detection and red reflection from an object

Hello,

Please i need your help, i want to detect a red color in an image, i change the channel to HSV to detect "lower red" and "upper red" by this code and it's working :

            cvtColor(im, imHSV, COLOR_BGR2HSV);
inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);


But i have a problem with this image (in the top right of the image), it's detected as red, i think it's the reflexion of light on a red object :

I used this link ( https://pinetools.com/image-color-picker) to find HSV values of this part of the image, and that's what i found : it's aroud : H : 18 S : 29 V : 27

I I don't understand why i am detecting this as red, i need your help and thank you.

### Separate red detection and red reflection from an object

Hello,

Please i need your help, i want to detect a red color in an image, i change the channel to HSV to detect "lower red" and "upper red" by this code and it's working :

            cvtColor(im, imHSV, COLOR_BGR2HSV);
inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);


But i have a problem with this image (in the top right of the image), it's detected as red, i think it's the reflexion of light on a red object :

I used this link ( https://pinetools.com/image-color-picker) to find HSV values of this part of the image, and that's what i found : it's aroud : H : 18 S : 29 V : 27

I tried to use only the "Upper red", it not detecting the reflected light but the result are not good detecting the real red color.

I I don't understand why i am detecting this as red, i need your help and thank you.

### Separate red and red reflection from an object

Hello,

Please i need your help, i want to detect a red color in an image, i change the channel to HSV to detect "lower red" and "upper red" by this code and it's working :

            cvtColor(im, imHSV, COLOR_BGR2HSV);
inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);


But i have a problem with this image (in the top right of the image), it's detected as red, i think it's the reflexion of light on a red object :

I used this link ( https://pinetools.com/image-color-picker) to find HSV values of this part of the image, and that's what i found : it's aroud : H : 18 S : 29 V : 27

I tried to use only the "Upper red", it it's not detecting the reflected light but the result are not good detecting the real red color.

I I don't understand why i am detecting this as red, i need your help and thank you.

### Separate red and red reflection from an object

Hello,

Please i need your help, i want to detect a red color in an image, i change the channel to HSV to detect "lower red" and "upper red" by this code and it's working :

            cvtColor(im, imHSV, COLOR_BGR2HSV);
inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);


But i have a problem with this image (in the top right of the image), it's detected as red, i think it's the reflexion of light on a red object :

I used this link ( https://pinetools.com/image-color-picker) to find HSV values of this part of the image, and that's what i found : it's aroud : H : 18 S : 29 V : 27

I tried to use only the "Upper red", it's not detecting the reflected light but the result are not good detecting the real red color.

That's the result i get, me i want to detect the blob "2" but i am detecting the blob "1".

I I don't understand why i am detecting this as red, i need your help and thank you.

### Separate red and red reflection from an object

Hello,

Please i need your help, i want to detect a red color in an image, i change the channel to HSV to detect "lower red" and "upper red" by this code and it's working :

            cvtColor(im, imHSV, COLOR_BGR2HSV);
inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);


But i have a problem with this image (in the top right of the image), it's detected as red, i think it's the reflexion of light on a red object :

I used this link ( https://pinetools.com/image-color-picker) to find HSV values of this part of the image, and that's what i found : it's aroud : H : 18 S : 29 V : 27

I tried to use only the "Upper red", it's not detecting the reflected light but the result are not good detecting the real red color.

That's the result i get, me i want to detect the blob "2" but i am detecting the blob "1".

I I don't understand why i am detecting this as red, i need your help and thank you.

### Separate red and red reflection from an object

Hello,

Please i need your help, i want to detect a red color in an image, i change the channel to HSV to detect "lower red" and "upper red" by this code and it's working :

            cvtColor(im, imHSV, COLOR_BGR2HSV);
inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);