Ask Your Question

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);
    Mat mask1 = Mat();
    Mat mask2 = Mat();
    inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
    inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);
    Mat mask_combined = Mat();
    bitwise_or(mask1, mask2, mask_combined);

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 :

image description

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

image description

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);
    Mat mask1 = Mat();
    Mat mask2 = Mat();
    inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
    inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);
    Mat mask_combined = Mat();
    bitwise_or(mask1, mask2, mask_combined);

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 :

image description

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

image description

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);
    Mat mask1 = Mat();
    Mat mask2 = Mat();
    inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
    inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);
    Mat mask_combined = Mat();
    bitwise_or(mask1, mask2, mask_combined);

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 :

image description

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

image description

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);
    Mat mask1 = Mat();
    Mat mask2 = Mat();
    inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
    inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);
    Mat mask_combined = Mat();
    bitwise_or(mask1, mask2, mask_combined);

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 :

image description

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

image description

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);
    Mat mask1 = Mat();
    Mat mask2 = Mat();
    inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
    inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);
    Mat mask_combined = Mat();
    bitwise_or(mask1, mask2, mask_combined);

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 :

image description

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

image description

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);
    Mat mask1 = Mat();
    Mat mask2 = Mat();
    inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
    inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);
    Mat mask_combined = Mat();
    bitwise_or(mask1, mask2, mask_combined);

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 :

image description

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

image description

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". image description

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);
    Mat mask1 = Mat();
    Mat mask2 = Mat();
    inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
    inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);
    Mat mask_combined = Mat();
    bitwise_or(mask1, mask2, mask_combined);

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 :

image description

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

image description

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". image description

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);
    Mat mask1 = Mat();
    Mat mask2 = Mat();
    inRange(imHSV, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
    inRange(imHSV, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);
    Mat mask_combined = Mat();
    bitwise_or(mask1, mask2, mask_combined);

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 :

image description

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

image description

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, i want to detect the blob "2" but i am detecting the blob "1". image description

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