I'm struggling to find the (x,y) coordinate of certain RGB values in an image. Lets say I edit an image and put a single pixel of (0,255,5), how can I find the 2D coordinate?
My current approach is using numpy.where
, but it doesn't seem to work. I'm aware of opencv storing images in BGR. I don't really want to use the HSV approach and inRange
because I just want single pixels of very specific values, so that would be overkill.
import numpy as np
import cv2
im = cv2.imread(image)
point = np.where(im == 5,255,0))