This file contains 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 displayarray import display | |
import cv2 | |
import numpy as np | |
from copy import copy | |
class ColorRange(object): | |
def __init__( | |
self, | |
color_num, |
This file contains 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 PIL import Image | |
import cv2 | |
import numpy as np | |
import svgwrite | |
def get_contour_levels(contours, hierarchy): | |
levels = [0] * len(contours) | |
for i in range(len(hierarchy[0])): | |
level = 0 | |
parent = hierarchy[0][i][3] |
This file contains 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
# | |
# Copyright (c) 2021 Simleek <simulator.leek@gmail.com>. All rights reserved. | |
# Licensed under the MIT license. See https://opensource.org/licenses/MIT | |
# | |
# To run this with Unity, the camera GameObject must have a Unity Capture behavior added to it. | |
# Follow instructions here: https://github.com/schellingb/UnityCapture | |
# If the resolution format doesn't exactly match Unity's resolution, | |
# you'll need to set Resize Mode to Linear to see anything. |