Skip to content

Instantly share code, notes, and snippets.

View nikgens's full-sized avatar

Gennadiy Nikitin nikgens

  • Vladivostok, Russia
View GitHub Profile
# python dynamic_color_tracking.py --filter HSV --webcam
import cv2
import argparse
import numpy as np
def callback(value):
pass
#!/usr/bin/env python
# import the necessary packages
from __future__ import division
from scipy.spatial import distance as dist
import numpy as np
import time
import dlib
import cv2
from collections import OrderedDict
@nikgens
nikgens / facial_landmark_detection.py
Created April 30, 2017 11:50
facial landmark detection
#!/usr/bin/python
from __future__ import division
import dlib
import cv2
import numpy as np
def resize(img, width=None, height=None, interpolation=cv2.INTER_AREA):
global ratio
w, h = img.shape
from __future__ import division
import cv2
import numpy as np
import matplotlib.pyplot as plt
import os
os.chdir('C:/Users/gennady.nikitin/Dropbox/Coding/OpenCV')
# define variable for resize tratio
ratio = 1
import cv2
import numpy as np
import imutils
def nothing(x):
pass
# Load an image
img = cv2.imread('ellipse.jpg')
import cv2
import numpy as np
import imutils
img = cv2.imread('circle1.jpg')
if img.shape[1] > 600:
img = imutils.resize(img, width=600)
clone = img.copy()
gray = cv2.cvtColor(clone, cv2.COLOR_BGR2GRAY)
# import the necessary packages
import numpy as np
import imutils
import cv2
# initialize the list of reference points and boolean indicating
# whether cropping is being performed or not
x_start, y_start, x_end, y_end = 0, 0, 0, 0
cropping = False
getROI = False
# usage $ python click_and_crop.py --image sample.jpg
# import the necessary packages
import argparse
import cv2
import numpy as np
# initialize the list of reference points and boolean indicating
# whether cropping is being performed or not
x_start, y_start, x_end, y_end = 0, 0, 0, 0
cropping = False