<commit_before>import freenect
from math import tan
import cv2

class Kinect:
    def __init__(self):
        pass
        #try:
        #    _,_ = get_depth()
        #except:
        #    raise Exception("Kinect not found!")
    
    def get_depth(self):
        return freenect.sync_get_depth()[0]
        
    def get_video(self):
        rgb = freenect.sync_get_video()[0]
        return cv2.cvtColor(rgb, cv2.COLOR_RGB2BGR)

    # needs testing!!!
    def get_IR_image(self):
        ir = freenect.sync_get_video(0, freenect.VIDEO_IR_10BIT)
        return ir



        
    def get_raw_depth_at(self, x, y):
        return self.get_depth()[y][x]
        
    def get_depth_at(self, x, y):
        raw = self.get_raw_depth_at(x, y)
        return self.raw_to_meters(raw)
        
    def raw_to_meters(self, raw):
        return 0.1236 * tan(raw / 2842.5 + 1.1863)<commit_msg>adding get rgb image function, adding back old constructor<commit_after>import freenect
from math import tan
import cv2

class Kinect:
    def __init__(self):
        try:
            _,_ = get_depth()
        except:
            raise Exception("Kinect not found!")
    
    def get_depth(self):
        return freenect.sync_get_depth()[0]
        
    def get_video(self):
        rgb = freenect.sync_get_video()[0]
        return cv2.cvtColor(rgb, cv2.COLOR_RGB2BGR)
        
    def get_video_rgb(self):
    	return freenect.sync_get_video()[0]

    # needs testing!!!
    def get_IR_image(self):
        ir = freenect.sync_get_video(0, freenect.VIDEO_IR_10BIT)
        return ir



        
    def get_raw_depth_at(self, x, y):
        return self.get_depth()[y][x]
        
    def get_depth_at(self, x, y):
        raw = self.get_raw_depth_at(x, y)
        return self.raw_to_meters(raw)
        
    def raw_to_meters(self, raw):
        return 0.1236 * tan(raw / 2842.5 + 1.1863)
{'fraction_non_alphanumeric': 0.10315339390700161, 'fraction_numerical': 0.026189203634420097, 'mean_word_length': 2.189097103918228, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3666188', 'n_tokens_mistral': 693, 'n_tokens_neox': 662, 'n_words': 136}