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 scipy.spatial.distance as distance | |
def get_interpolated_points(c1, c2, step, scale): | |
c1 = c1.reshape(c1.shape[0], c1.shape[-1]) | |
c2 = c2.reshape(c2.shape[0], c2.shape[-1]) | |
dif = c2 - c1 | |
return np.array(c1 + dif*step/scale, dtype=np.int32) |
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 | |
def get_interpolated_points(c1, c2, step, scale): | |
dif = c2 - c1 | |
return np.array(c1 + dif*step/scale, dtype=np.int32) | |
def get_line_list(img, height, simplified): |
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
#anim { | |
width: 800px; | |
height: 800px; | |
} |
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 scipy.spatial.distance as distance | |
def get_interpolated_points(c1, c2, step, scale): | |
""" | |
Performs a linear interpolation between c1 and c2. Draws a line between | |
members of c1 and c2 on the same index, divides the line between the | |
points into "scale" sections and returns the step-th point. |
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 os.path | |
import cv2 | |
import numpy as np | |
import pafy | |
class AddressableQueue(object): | |
""" | |
Creates a data structure that will hold some number of records. |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2011 Yesudeep Mangalapilly <[email protected]> | |
# Copyright 2012 Google, Inc. | |
# Copyright 2014 Thomas Amland | |
# Copyright 2015 Petr Blahos | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. |
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
def make_text_table(row_count, column_width): | |
""" | |
Makes a textual table with the numbered rows and 2 columns. The first | |
column is 5 characters wide, the 2nd and 3rd columns are column_width | |
characters wide. | |
Params: | |
row_count The number of rows. The rows are then numbered | |
1 to row_count | |
column_width The width of the second and third column. | |
""" |
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
def make_text_table(row_count, column_width): | |
""" | |
Makes a textual table with the numbered rows and 2 columns. The first | |
column is 5 characters wide, the 2nd and 3rd columns are column_width | |
characters wide. | |
Params: | |
row_count The number of rows. The rows are then numbered | |
1 to row_count | |
column_width The width of the second and third column. | |
""" |
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
def make_text_table(row_count, column_width): | |
print "+", | |
for width in range(5): | |
print "-", | |
for width in range(2): | |
print "+", | |
for width in range(column_width): | |
print "-", | |
print "+" | |
''' |
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
def make_text_table(row_count, column_width): | |
""" | |
Makes a textual table with the numbered rows and 2 columns. The first | |
column is 5 characters wide, the 2nd and 3rd columns are column_width | |
characters wide. | |
Params: | |
row_count The number of rows. The rows are then numbered | |
1 to row_count | |
column_width The width of the second and third column. | |
""" |