def getFrames(self, frames=5, rgb=False):
    '\n        Retrieves depth frames (and RGB if true) from R200 input, cleans and averages depth images\n        '
    self.dev.wait_for_frames()
    depth = (self.dev.depth * self.dev.depth_scale)
    col = self.dev.color
    if (self.save_images and ((time.time() - self.clock) > self.t_buffer)):
        np.save(path.join(self.data_dir, (str(time.time()) + '_d')), depth)
        np.save(path.join(self.data_dir, (str(time.time()) + '_c')), col)
        self.clock = time.time()
    for _ in range((frames - 1)):
        self.dev.wait_for_frames()
        curr = (self.dev.depth * self.dev.depth_scale)
        depth = np.dstack((depth, curr))
    if (frames != 1):
        depth = np.nanmean(depth, 2)
    depth[(depth <= 0)] = np.nan
    depth[(depth > self.max_depth)] = np.nan
    if rgb:
        return (depth, col)
    return depth
Retrieves depth frames (and RGB if true) from R200 input, cleans and averages depth images
def getFrames(self, frames=5, rgb=False):
    '\n        \n        '
    self.dev.wait_for_frames()
    depth = (self.dev.depth * self.dev.depth_scale)
    col = self.dev.color
    if (self.save_images and ((time.time() - self.clock) > self.t_buffer)):
        np.save(path.join(self.data_dir, (str(time.time()) + '_d')), depth)
        np.save(path.join(self.data_dir, (str(time.time()) + '_c')), col)
        self.clock = time.time()
    for _ in range((frames - 1)):
        self.dev.wait_for_frames()
        curr = (self.dev.depth * self.dev.depth_scale)
        depth = np.dstack((depth, curr))
    if (frames != 1):
        depth = np.nanmean(depth, 2)
    depth[(depth <= 0)] = np.nan
    depth[(depth > self.max_depth)] = np.nan
    if rgb:
        return (depth, col)
    return depth