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 | |
from argparse import ArgumentParser | |
from pathlib import Path | |
import cv2 | |
import numpy as np | |
from PIL import Image | |
def project(angle, mirror, img): |
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 | |
from __future__ import division | |
from collections import namedtuple | |
class ObjectWrapper(object): | |
def __init__(self, obj, weight_call): | |
self.obj = obj | |
self.weight_call = weight_call | |
@property |
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 __future__ import division | |
import numpy as np | |
class Edge(object): | |
def __init__(self, p, q): | |
self.xmin = np.min((p[0], q[0])) | |
self.xmax = np.max((p[0], q[0])) | |
self.ymin = np.min((p[1], q[1])) |
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 | |
def twiddle(p, x=None, y=None, z=None): | |
j = np.argmax(p[1:]>0)+1 | |
if p[j-1] == 0: | |
i = j-1 | |
while i != 1: | |
p[i] = -1 |