marqinhos / JetRacer_Autonomous_Driving

https://jetracer-autonomous-driving.readthedocs.io/en/latest/
GNU Affero General Public License v3.0
6 stars 2 forks source link

Problem color segmentation #8

Closed marqinhos closed 1 year ago

marqinhos commented 1 year ago

Search before asking

JetRacer_Autonomous_Driving Component

In the program segmentation, there is a threashold problem in color detectation.

If you used next image to test the program to segmentation orange. The result is null. Image

Possible solution

Change orange and white threshold. Now orange and white values:

'orange': [(1, 190, 200), (18, 255, 255)]
'white': [(0, 0, 231), (180, 18, 255)]

Compatible

No response

Additional

No response

marqinhos commented 1 year ago

JetRacer_Autonomous_Driving Component

NEW PROPOUSE program segmentation in RGB color space

Possible result to image_4.jpg Original image: Image

Brightness increased: image_5

Final Result: image

Threshold in this case:

'orange': [(180, 80, 0), (255, 179, 93)]

Compatible

Don't work perfect, because in image_4.jpg, the result shown above is achieve modifying brightness and contrast. It does this as follows:

# Defining alpha and beta:
alpha = 2.0   # Contrast Control [1.0-3.0]
beta = 1    # Brightness Control [0-100]
img = cv2.convertScaleAbs(img, alpha=alpha, beta=beta)

Additional

No response