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
# python dynamic_color_tracking.py --filter HSV --webcam | |
import cv2 | |
import argparse | |
import numpy as np | |
def callback(value): | |
pass |
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
#!/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 |
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
#!/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 |
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 __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 |
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 imutils | |
def nothing(x): | |
pass | |
# Load an image | |
img = cv2.imread('ellipse.jpg') |
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 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) |
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 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 |
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
# 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 |