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 pprint import pprint | |
from collections import Counter | |
import csv | |
from itertools import chain | |
with open('Sj.csv', 'r', encoding='cp1251') as f: | |
reader = csv.reader(f) | |
your_list = list(reader) | |
def flatten(listOfLists): |
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 pprint import pprint | |
from copy import deepcopy | |
a = [ | |
["a", "b", "Xval"], | |
["a", "b", "Yval, Zval"], | |
["a", "c", "Xval"], | |
["a", "d", "Xval"], | |
["a", "d", "Yval"], | |
["a", "d", "Xval"], |
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
@classmethod | |
def open_any_available(cls): | |
for cam in cls.enumerate_uris(): | |
try: | |
return cls(cam) | |
except OpenNIError: | |
pass | |
raise Exception("no available cams") |
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
#!/usr/bin/python | |
import cv2 | |
import numpy as np | |
from primesense import openni2 | |
from primesense import _openni2 as c_api | |
openni2.initialize("<PATH TO OPENNI2 REDIST FOLDER>") | |
dev = openni2.Device.open_any() | |
depth_stream = dev.create_depth_stream() | |
depth_stream.start() | |
depth_stream.set_video_mode(c_api.OniVideoMode(pixelFormat = c_api.OniPixelFormat.ONI_PIXEL_FORMAT_DEPTH_100_UM, resolutionX = 640, resolutionY = 480, fps = 30)) |