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 | |
cap = cv2.VideoCapture('/home/sm/Desktop/VIRB0034.MP4') | |
fourcc = cv2.VideoWriter_fourcc(*'XVID') | |
out = cv2.VideoWriter('/home/sm/Desktop/balance.avi',fourcc, 30.0, (1920,1080)) | |
color = (123,123,12) | |
def dst(f,c): | |
distance = math.sqrt((f[0]-c[0])**2+(f[1]-c[1])**2) | |
return distance |
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 necessary libraries | |
import cv2 | |
import numpy as np | |
#capture video from the webcam | |
cap = cv2.VideoCapture(0) | |
#load the face finder | |
face_cascade = cv2.CascadeClassifier('/home/sm/Desktop/haarcascade_frontalface_default.xml') |
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 | |
cap = cv2.VideoCapture(0) | |
# params for ShiTomasi corner detection | |
feature_params = dict( maxCorners = 50, | |
qualityLevel = 0.2, | |
minDistance = 7, | |
blockSize = 7 ) |
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
from mpl_toolkits.basemap import Basemap | |
import matplotlib.pyplot as plt | |
import csv | |
#get list of temple name, location, dedication data, lat, and lon | |
path = '/home/sm/Desktop/temple_data.csv' | |
temples = [] #create a list to store the temple data from the spread sheet | |
with open(path, 'rb') as csvfile: #open the csv file | |
temple_data = csv.reader(csvfile, delimiter=',', quotechar='"') #load temple data | |
for temple in temple_data: #iterate through data to change year to int |
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 | |
cap = cv2.VideoCapture(0) | |
kernel = np.ones((8,8),np.uint8) | |
while(1): | |
# Take each frame |
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 pygame | |
import random | |
import math | |
background_colour = (255,255,255) | |
(width, height) = (500, 500) | |
class Particle(): | |
def __init__(self, (x, y), size): | |
self.x = x |
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 pygame | |
import random | |
import math | |
background_colour = (255,255,255) | |
(width, height) = (400, 400) | |
drag = 0.999 | |
elasticity = 0.75 | |
gravity = (math.pi, 0.002) | |
import cv2 |
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 | |
#path to video paths | |
#source_path = '/home/sm/Desktop/VIRB0054.MP4' | |
source_path = 0 | |
save_path = '/home/sm/Desktop/mandt_effect.avi' | |
image_path = '/home/sm/Desktop/map.png' | |
frame_rate, resolution = 25.0, (640,480) | |
text = cv2.imread(image_path) |
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
article_path = 'furniture/furniture_invintory' #path to the article | |
article = open(article_path, 'r') #open the article | |
products = [] | |
while True: | |
line = article.readline() | |
if line[:-1] == 'end_furniture': break | |
if line[:-1] == 'start_product': | |
product_key = article.readline() | |
product_name = article.readline() | |
banner_line_one = article.readline() |
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 | |
import cv2 | |
import math | |
#capture webcam video | |
cap = cv2.VideoCapture(0) | |
width, height = 1920,1080 | |
cap.set(3,width) | |
cap.set(4,height) | |
#create a method that can seperate the foreground from the background |
OlderNewer