This file contains hidden or 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 pandas as pd | |
import numpy as np | |
import cv2, os | |
import csv | |
input_source = "/home/stephen/Desktop/me.MP4" | |
cap = cv2.VideoCapture(input_source) | |
frame_number = 0 | |
font, scale, colorText, thick = cv2.FONT_HERSHEY_SIMPLEX, .5, (234,234,234), 1 | |
size, color, thickness = 5, (255,255,255), 5 |
This file contains hidden or 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, numpy as np, csv | |
#https://github.com/opencv/opencv/blob/master/samples/dnn/openpose.py | |
outfile_path = '/home/stephen/Desktop/workout.csv' | |
protoFile = "/home/stephen/pose/mpi/pose_deploy_linevec_faster_4_stages.prototxt" | |
weightsFile = "/home/stephen/pose/mpi/pose_iter_160000.caffemodel" | |
net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile) | |
data, input_width, input_height, threshold, frame_number = [], 368, 386, 0.1, 0 |
This file contains hidden or 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 pandas as pd | |
df = pd.read_csv('/home/stephen/Desktop/records.csv') | |
#get list of jugglers | |
jugglers = [] | |
for record in df.values: | |
jugglers.append(record[1]) | |
jugglers = list(set(jugglers)) | |
#get list of comparitive pr's |
This file contains hidden or 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 numpy as np | |
from matplotlib import pyplot as plt | |
import pandas as pd | |
from scipy import signal | |
import cv2 | |
from matplotlib import pyplot as plt | |
import pandas as pd | |
from mpl_toolkits.mplot3d import Axes3D |
This file contains hidden or 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, math, numpy as np | |
#h,s,v range of the object to be tracked | |
#h,s,v,h1,s1,v1 = 27,0,0,82,190,255 #GREEN | |
color_values = 168,154,99,177,255,255 #RED | |
threshold_value = 0 | |
output_path = '/home/stephen/Desktop/1.csv' | |
cap = cv2.VideoCapture('/home/stephen/Desktop/531.avi') |
This file contains hidden or 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 for computer vision | |
#import numpy to make blank images | |
import cv2, numpy as np | |
#capture source video | |
cap = cv2.VideoCapture('/home/acer/Desktop/colorspace/bxx.MP4') | |
#define | |
#define orange | |
orange = 0,145,155,255,255,255 |
This file contains hidden or 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, numpy as np | |
#path to source video | |
source_path = '/home/acer/Desktop/744.MP4' | |
#out path to save tracking data | |
output_path = '/home/acer/Desktop/light_blue.csv' | |
#parameter of lk optical flow | |
window_size = 18 | |
lk_params = dict(winSize = (window_size,window_size), |
This file contains hidden or 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, numpy as np, os | |
#parameters | |
working_dir = '/home/stephen/Desktop/keras_demo/' | |
cap = cv2.VideoCapture(0) | |
org, font, scale, color, thickness, linetype = (50,50), cv2.FONT_HERSHEY_SIMPLEX, 1.2, (234,12,123), 2, cv2.LINE_AA | |
#chromakey values | |
h,s,v,h1,s1,v1 = 16,0,64,123,111,187 #green | |
h,s,v,h1,s1,v1 = 0,74,53,68,181,157 #skin tone |
This file contains hidden or 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, numpy as np, os | |
#parameters | |
working_dir = '/home/stephen/Desktop/keras_demo/' | |
cap = cv2.VideoCapture(1) | |
org, font, scale, color, thickness, linetype = (50,50), cv2.FONT_HERSHEY_SIMPLEX, 1.2, (234,12,123), 2, cv2.LINE_AA | |
#chromakey values | |
h,s,v,h1,s1,v1 = 16,0,64,123,111,187 | |
#amount of data to use |
This file contains hidden or 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 numpy as np, os, cv2 | |
from keras.utils import to_categorical | |
from keras.models import load_model | |
#reads images from folder (images must be labeled 0.png, 1.png, etc...) | |
def read_from_folder(folder, pattern, image_number, stop): | |
images = [] | |
while image_number < stop: | |
path = folder + pattern + '/' + str(image_number) + '.png' | |
img = cv2.imread(path, 0) |