What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-02 10:30:11
make correlated array with cholesky decomposition python
import numpy as np #desired expected rho (of the distribution of the corr matrix) rho = 0.5 # desired correlation matrix cor_matrix = np.ones((5,5))* rho np.fill_diagonal(cor_matrix,1) # 1s in diagonal print(cor_matrix) # this is artificial case but it... 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 -
Other 2021-10-09 19:15:08
perform zero crossing using openCV
LoG = cv2.Laplacian(src, cv2.CV_16S) minLoG = cv2.morphologyEx(LoG, cv2.MORPH_ERODE, np.ones((3,3))) maxLoG = cv2.morphologyEx(LoG, cv2.MORPH_DILATE, np.ones((3,3))) zeroCross = np.logical_or(np.logical_and(minLoG < 0, LoG > 0), np.logical_and(maxL... 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-03 02:38:03
get text from image python
# Import some modules import cv2 # An image proccessing library import pytesseract # an image to text library import numpy as np # used for mathematics but can be used in image proccessing # Configure the module pytesseract.pytesseract.tesseract_cmd = r'... Add solution -
Python 2021-09-30 15:59:03
classical mds python
from __future__ import division import numpy as np def cmdscale(D): """  ... Add solution