I used the "In-Range" function in the following code to separate RED colored lines from the image. But it doesn't give the correct output. I'm new to openCV and can anyone suggest me a way to separate the red colored lines. After detecting the red color lines I want to get its coordinates.
import cv2
import numpy as np
img = cv2.imread('masked.jpg')
ORANGE_MIN = np.array([0, 0, 255],np.uint8)
ORANGE_MAX = np.array([0, 0, 255],np.uint8)
hsv_img = cv2.cvtColor(img,cv2.COLOR_RGB2HSV)
frame_threshed = cv2.inRange(hsv_img, ORANGE_MIN, ORANGE_MAX)
cv2.imwrite('inRange.jpg', frame_threshed)
Input Image,
Result generated,
I developed the above code with the aid of the following solution. Here the above solution detects the orange color lid. But when I apply the same code it doesn't give any valued output. Why?