Skip to content

Instantly share code, notes, and snippets.

View SimLeek's full-sized avatar
:octocat:
Making something

SimLeek

:octocat:
Making something
View GitHub Profile
from displayarray import display
import cv2
import numpy as np
from copy import copy
class ColorRange(object):
def __init__(
self,
color_num,
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]
#
# 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.