import numpy as np import cv2 def click_event(event, x, y, flags, param): if event == cv2.EVENT_LBUTTONDOWN: blue = img[x, y, 0] green = img[x, y, 1] red = img[x, y, 2] cv2.circle(img, (x,y), 3, (0, 0, 255), -1) mycolorImage = np.zeros((512, 512, 3), np.uint8) mycolorImage[:]=[blue, green, red] cv2.imshow('color', mycolorImage) img = cv2.imread('lena.jpg') cv2.imshow('image', img) points = [] cv2.setMouseCallback('image', click_event) cv2.waitKey(0) cv2.destroyAllWindows()
Popular Posts
-
import numpy as np import cv2 as cv cap = cv.VideoCapture( 'traffic.mp4' ) #take first frame of the video ret , frame = cap...
-
I wanted to know the different between hashtable and hashmap. And search from Google i found another thing, that is hashset. Here is the ...
-
import cv2 face_cascade = cv2.CascadeClassifier( 'haarcascade_frontalface_default.xml' ) eye_cascade = cv2.CascadeClassifie...
May 22, 2020
show color channel of original image mouse click
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment