diff --git a/Aufraeumroboter_Drakkar/Dennis_Dirk_Becker/depth_related/depth_reader.py b/Aufraeumroboter_Drakkar/Dennis_Dirk_Becker/depth_related/depth_reader.py index 2a616a6..930cf19 100644 --- a/Aufraeumroboter_Drakkar/Dennis_Dirk_Becker/depth_related/depth_reader.py +++ b/Aufraeumroboter_Drakkar/Dennis_Dirk_Becker/depth_related/depth_reader.py @@ -129,8 +129,11 @@ class tutel(): self.pixel_depth = ((self.pixel_length/2858.4636643479)**(-1/1.0056840993))*10 #self.pixel_depth = (self.pixel_depth + ((((self.x[1] - self.x[0] + self.y[1] - self.y[0]) / 2)/2914.29872964688)**(-1/1.01590290349592))*10)/2 depth_values = [] - M = ((x[0] + (x[1]-x[0])//2), (y[0] + (y[1]-y[0])//2)) - depth_values.append(depth_image[M[1]][M[0]]) + #M = ((x[0] + (x[1]-x[0])//2), (y[0] + (y[1]-y[0])//2)) + for i in range(x[0], x[1]+1): + if depth_image[y[0]][i] > self.min_threshold and depth_image[y[0]][i] < self.max_threshold and depth_image[y[0]][i] < self.pixel_depth: + depth_values.append(depth_image[y[0]][i]) + #depth_values.append(depth_image[M[1]][M[0]]) #for i in range(self.x[0], self.x[1]): #for j in range(self.y[0], self.y[1]): #if depth_image[j][i] > self.min_threshold and depth_image[j][i] < self.max_threshold and depth_image[j][i] < self.pixel_depth: @@ -151,8 +154,8 @@ class tutel(): lengths = [abs(self.top_left[0]-self.top_right[0]), abs(self.top_left[1] - self.bottom_left[1]), abs(self.top_right[1]-self.bottom_right[1]), abs(self.bottom_right[0]-self.bottom_left[0])] #pixel_length = (abs(self.top_left[0]-self.top_right[0]) + abs(self.top_left[1] - self.bottom_left[1]) + abs(self.top_right[1]-self.bottom_right[1]) + abs(self.bottom_right[0]-self.bottom_left[0]))/4 pixel_length = max(lengths) - M_Kante = (M[0], y[0]) - print(pixel_length, M_Kante) + #M_Kante = (M[0], y[0]) + print(pixel_length) self.number_of_operations = 0 self.number_of_pixels = 0 pixel_length = 0