What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-17 11:42:06
cv2 load image
import cv2 img = cv2.imread('/path_to_image/opencv-logo.png') cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAllWindows() # to use it in a loop k = cv2.waitKey(0) if k == 27: # wait for ESC key to exit cv2.destroyAllWindows() elif k == ord... Add solution -
Python 2021-10-15 01:55:11
how to use edge detection using gradient magnitude in python
import numpy as np import cv2 # Load the image, convert it to grayscale, and show it image = cv2.imread("hand.png") image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) cv2.imshow("Greyscale", image) # Compute the Laplacian of the image l... Add solution -
Python 2021-10-14 11:52:12
how to convert into grayscale opencv
import cv2 # Reading color image as grayscale gray = cv2.imread("color-img.png",0) # Showing grayscale image cv2.imshow("Grayscale Image", gray) # waiting for key event cv2.waitKey(0) # destroying all windows cv2.destroyAllWindows() Add solution -
Python 2021-10-14 00:25:13
object color detection python program youtube
# Python code for Multiple Color Detection import numpy as np import cv2 # Capturing video through webcam webcam = cv2.VideoCapture(0) # Start a while loop while(1): # Reading the video from the # webcam in image frames _... Add solution -
Python 2021-10-11 22:29:05
import numpy import cv2 cv2.imshow('image',img) cv2.waitKey(0)
import cv2 import numpy as np #numpy array ndarray = np.full((300,300,3), 125, dtype=np.uint8) #show image cv2.imshow('Example - Show image in window', ndarray) cv2.waitKey(0) # waits until a key is pressed cv2.destroyAllWindows() # destroys the wind... Add solution -
Python 2021-10-11 15:56:03
opencv load image python
import cv2 img = cv2.imread('/path_to_image/opencv-logo.png') cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAllWindows() # to use it in a loop k = cv2.waitKey(0) if k == 27: # wait for ESC key to exit cv2.destroyAllWindows() elif k == ord... Add solution -
Python 2021-10-09 21:19:09
python opencv camera capture
import cv2 cap = cv2.VideoCapture(0) while True: ret, frame = cap.read() cv2.imshow('webcam feed' , frame) if cv2.waitKey(1) & 0xFF == ord(' '): break cap.release() cv2.destroyAllWindows() #by using the spacebar you will be able t... Add solution -
Python 2021-10-09 17:35:08
cv2 open blank window
# sadly, if you're using cv2.imread(), not many options exist... import cv2 import numpy as np # black blank image blank_image = np.zeros(shape=[512, 512, 3], dtype=np.uint8) # print(blank_image.shape) cv2.imshow("Black Blank", blank_image) # w... Add solution -
Python 2021-10-09 09:15:05
stackoverflow ocr,cropping letters
import cv2 import numpy as np #import image image = cv2.imread('image.png') #grayscale gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) cv2.imshow('gray', gray) cv2.waitKey(0) #binary ret,thresh = cv2.threshold(gray,127,255,cv2.THRESH_BINARY_INV) cv2.imsh... Add solution -
Python 2021-10-08 19:08:04
cv2 rectangle fill color opacity
import cv2 import numpy as np # Load image img = cv2.imread('images/paddington.png') # Initialize black image of same dimensions for drawing the rectangles blk = np.zeros(img.shape, np.uint8) # Draw rectangles cv2.rectangle(blk, (5, 5), (100, 75), (255... Add solution
Best helpers
Erica Price
+5
Scoiattolo
+5
Vigrond
+5
Muazam
+5
Emmet
+5
A G Davey
+5
Arad
+5
Meital Regev
+5
Entrepreneur
+5
Majte
+5
JoshuaFicy
+5