diff --git a/dennis_nodes/tutel_depth_filter_option_01.py b/dennis_nodes/tutel_depth_filter_option_01.py index 8b63563..962521c 100644 --- a/dennis_nodes/tutel_depth_filter_option_01.py +++ b/dennis_nodes/tutel_depth_filter_option_01.py @@ -166,10 +166,15 @@ class tutel(): if self.bottom_left[1] < self.bottom_right[1]: y = (self.bottom_left[1],self.bottom_right[1]) else: y = (self.bottom_right[1],self.bottom_left[1]) cv2.line(depth_image, (x[0],y[0]), (x[1],y[1]), (0,255,0), 2) + depth_values = [] for i in range(x[0], x[1]): for j in range(y[0], y[1]): - if depth_image[j][i] > (max(depth_image)-10): - self.last_depth += depth_image[j][i] + if depth_image[j][i] > 399: + depth_values.append(depth_image[j][i]) + #depth_values = np.array(depth_values) + for k in range(0, len(depth_values)): + if depth_values[k] > (max(depth_values) - 9): + self.last_depth += depth_values[k] self.number_of_operations += 1 self.last_depth /= self.number_of_operations print(self.depth_counter, self.last_depth, self.number_of_operations)