This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2, time, sys | |
from random import * | |
import numpy as np | |
font = cv2.FONT_HERSHEY_SIMPLEX | |
xi, yi = 0, 0 | |
def func(event, x, y, _, __): | |
global cap, img, xi, yi | |
xi, yi = x, y | |
if event == cv2.EVENT_LBUTTONUP: | |
___, img = cap.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2, time, sys | |
from random import * | |
import numpy as np | |
cap = cv2.VideoCapture(0) | |
while 1: | |
_, frame = cap.read() | |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) | |
lower_clr = np.array([0,0,0]) | |
upper_clr = np.array([176,100,100]) | |
mask = cv2.inRange(frame, lower_clr, upper_clr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2, time, sys | |
from random import * | |
import numpy as np | |
def trans_effect(named, img1, img2, speed=100): | |
h1, w1, c1 = img1.shape | |
h2, w2, c2 = img2.shape | |
h, w, c = min(h1, h2), min(w1, w2), min(c1, c2) | |
img1 = img1[:h, :w, :c] | |
img2 = img2[:h, :w, :c] | |
for i in range(1, 10): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2, time, sys | |
from random import * | |
import numpy as np | |
font = cv2.FONT_HERSHEY_SIMPLEX | |
cap = cv2.VideoCapture(0) | |
width, height = cap.get(3), cap.get(4) | |
print(width, height) | |
ck = 0 | |
start = time.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <string> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
string url; cin >> url; | |
url = "http://www.mcgov.co.uk/riddles/" + url + ".html"; | |
ShellExecute(NULL, "open", url.c_str(), "", ".", SW_SHOWNORMAL); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import quandl, pickle, math, datetime | |
import numpy as np | |
import pandas as pd | |
from sklearn.linear_model import LinearRegression | |
from sklearn import preprocessing, cross_validation | |
from sklearn.externals import joblib | |
import matplotlib.pyplot as plt | |
from matplotlib import style | |
one_day = 86400 | |
one_week = one_day*7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import html | |
import requests, sqlite3, re | |
def Process(url): | |
id = int(re.findall('/([0-9]+)/.*?$', url)[0]) | |
if (id in id_fetched): | |
print('Skiping ', id) | |
return | |
page = requests.get(url + '/userrecs') | |
tree = html.fromstring(page.content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, shutil, stat, sys, win32api, time, datetime | |
from distutils.dir_util import copy_tree | |
curr_dir = sys.argv[0] | |
args = sys.argv[1:] | |
argc = len(args) | |
def get_IVG(location): | |
try: | |
return open(os.path.join(location, 'System Volume Information', 'IndexerVolumeGuid')).readlines()[0] | |
except: | |
return 'None_Info' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
img = cv2.imread('me.png', 0) | |
img = cv2.resize(img, (0, 0), fx=0.5, fy=0.5) | |
# img = cv2.GaussianBlur(img, (5, 5), 0) | |
img = cv2.Laplacian(img, cv2.CV_64F) | |
img = np.uint8(np.absolute(img)) | |
canny = cv2.Canny(img, 200, 200)# Dissemination, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle, cv2, sqlite3 | |
import numpy as np | |
class BGRHist: | |
def __init__(self, bins): | |
self.bins = bins | |
def describe(self, img): | |
hist = cv2.calcHist([img], range(3), None, self.bins, [0, 256]*3) | |
cv2.normalize(hist, hist) | |
return hist.flatten() | |
class Searcher: |
OlderNewer