Answers for "image search python and opencv stackoverflow"

0

image search python and opencv stackoverflow

import cv2
import numpy as np

img = cv2.imread('one.jpg')

pixel = img[801,600]
print (pixel) # pixel value i am searching for

def search_for():
    for iidx, i in enumerate(img):
        for xidx, x in enumerate(i):
            if (x == pixel).all():
                print (f"SUCCESS - [{iidx} {xidx}]")

if __name__ == "__main__":
    print("Search using for loops...")
    search_for()
Posted by: Guest on June-16-2020

Code answers related to "image search python and opencv stackoverflow"

Python Answers by Framework

Browse Popular Code Answers by Language