from scipy.spatial import Delaunay, ConvexHull
import networkx as nx
points = [ [0,0],[0,50],[50,50],[50,0],[0,400],[0,450],[50,400],[50,450],[700,300],[700,350],[750,300],[750,350],
[900,600],[950,650],[950,600],[900,650]
]
def concave(points,alpha_x=150,alpha_y=250):
points = [(i[0],i[1]) if type(i) <> tuple else i for i in points]
de = Delaunay(points)
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
| # Original Matlab code https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html | |
| # | |
| # | |
| # Python port of depth filling code from NYU toolbox | |
| # Speed needs to be improved | |
| # | |
| # Uses 'pypardiso' solver | |
| # | |
| import scipy | |
| import skimage |
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
| # https://www.youtube.com/watch?v=Y3ac5rFMNZ0&t=318s | |
| # avconv -i rtsp://admin:admin@192.168.1.68/play1.sdp -c copy -map 0 -f segment -segment_time 300 -segment_format mp4 "capture-%03d-`date +%Y-%m-%d_%H:%M:%S`.mp4" | |
| import cv2 | |
| backsub = cv2.BackgroundSubtractorMOG() #background subtraction to isolate moving cars | |
| capture = cv2.VideoCapture("/home/ubuntu/Downloads/traffic_video.avi") | |
| i = 0 | |
| minArea=1 | |
| while True: | |
| ret, frame = capture.read() |