Skip to content

Instantly share code, notes, and snippets.

View raul23's full-sized avatar

Raul raul23

View GitHub Profile
@raul23
raul23 / create_user_with_grant.sql
Last active July 30, 2018 04:32
MySQL 8.0: create user with all privileges
CREATE USER 'foo'@'localhost' IDENTIFIED WITH mysql_native_password BY 'bar' REQUIRE NONE;
GRANT ALL PRIVILEGES ON *.* TO 'foo'@'localhost' WITH GRANT OPTION;
@raul23
raul23 / opencv_sift_surf_test.py
Last active May 29, 2018 14:42
Code for testing that you have access to SIFT, SURF, and other keypoint detectors and local invariant descriptors. Reference: Adrian Rosebrock's blog post @ https://www.pyimagesearch.com/2015/07/16/where-did-sift-and-surf-go-in-opencv-3/
# Test code is from Adrian Rosebrock's blog post @ https://www.pyimagesearch.com/2015/07/16/where-did-sift-and-surf-go-in-opencv-3/
import cv2
image = cv2.imread("test.png")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# SIFT features
sift = cv2.xfeatures2d.SIFT_create()
(kps, descs) = sift.detectAndCompute(gray, None)
print("# kps: {}, descriptors: {}".format(len(kps), descs.shape))
@raul23
raul23 / opencv_install_test.py
Last active May 29, 2018 14:55
Code for testing your OpenCV 3 installation by displaying an image and stream from a webcam feed
# Code for showing webcam feed is from Adrian Rosebrock's tutorial @
# https://www.pyimagesearch.com/2015/05/25/basic-motion-detection-and-tracking-with-python-and-opencv/
import cv2
print('OpenCV version: {}'.format(cv2.__version__))
# Read test image and show it
img = cv2.imread('test.png')
cv2.imshow('Window', img)
cv2.waitKey(0)