from this stackoverflow question i found this code
import numpy as np
import imutils
import cv2
img_rgb = cv2.imread('black.png')
Conv_hsv_Gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
ret, mask = cv2.threshold(Conv_hsv_Gray, 0, 255,cv2.THRESH_BINARY_INV |cv2.THRESH_OTSU)
img_rgb[mask == 255] = [0, 0, 255]
cv2.imshow("imgOriginal", img_rgb) # show windows
cv2.imshow("mask", mask) # show windows
cv2.waitKey(0)
is there any way i could change the line
img_rgb[mask == 255] = [0, 0, 255]
or something else to make it change a range of colors? for example:
([255, 255, 0], [255, 55, 10])