diff --git a/rear_camera_py/Makefile b/rear_camera_py/Makefile index 405775ca..2c617458 100644 --- a/rear_camera_py/Makefile +++ b/rear_camera_py/Makefile @@ -74,12 +74,12 @@ check_style: format-check: @${make} format - @${make} format-check + @${make} check_style all-check: @${make} format @${make} test - @${make} format-check + @${make} check_style debug: python -m src --debug @@ -90,7 +90,7 @@ clean: create-env-rear: pip install -r ../requirements.txt -## 作業用 ## +## get_area_info.py用 ## get_area: python src/get_area_info.py -develop diff --git a/rear_camera_py/src/get_area_info.py b/rear_camera_py/src/get_area_info.py index 8e5509b1..f9bbb2ba 100644 --- a/rear_camera_py/src/get_area_info.py +++ b/rear_camera_py/src/get_area_info.py @@ -648,7 +648,7 @@ def get_first_line(self, front_course_img, second_from_front_img, coordi_circle_ circle_blue_coordi2[1]:circle_blue_coordi2[1]+2]\ = Color.BLACK.value - # 座標が逆だった場合 + # 座標が逆だった場合(3行目青) if circle_blue_coordi1 is not None and circle_blue_coordi2 is not None and \ circle_blue_coordi2[0] > circle_blue_coordi1[0]: self.course_info_block[3, 0], self.course_info_block[3, 1] = \ @@ -711,8 +711,9 @@ def get_first_line(self, front_course_img, second_from_front_img, coordi_circle_ circle_green_coordi2[1]:circle_green_coordi2[1]+2]\ = Color.BLACK.value - # 座標が逆だった場合 - if circle_green_coordi1 is not None and circle_green_coordi2 is not None and \ + # 座標が逆だった場合(3行目緑) + if circle_green_coordi1 is not None and \ + circle_green_coordi2 is not None and \ circle_green_coordi1[0] > circle_green_coordi2[0]: self.course_info_block[3, 2], self.course_info_block[3, 3] = \ self.course_info_block[3, 3], self.course_info_block[3, 2] @@ -796,7 +797,7 @@ def get_second_line(self, second_are_img, second_detect_circle_img) -> None: if self.develop: print("サークルなし2") - # 座標が逆だった場合 + # 座標が逆だった場合(2行目青) if second_circle_blue_coordi1 is not None and second_circle_blue_coordi2 is not None and \ second_circle_blue_coordi2[0] > second_circle_blue_coordi1[0]: self.course_info_block[2, 0], self.course_info_block[2, 1] = \ @@ -881,14 +882,14 @@ def get_second_line(self, second_are_img, second_detect_circle_img) -> None: if self.develop: print("サークルなし4") - # 座標が逆だった場合 + # 座標が逆だった場合(2行目緑) if second_circle_green_coordi1 is not None and \ second_circle_green_coordi2 is not None and \ second_circle_green_coordi1[0] > second_circle_green_coordi2[0]: self.course_info_block[2, 2], self.course_info_block[2, 3] = \ self.course_info_block[2, 3], self.course_info_block[2, 2] - self.course_info_coordinate[2, 2] = second_circle_green_coordi1 - self.course_info_coordinate[2, 3] = second_circle_green_coordi2 + self.course_info_coordinate[2, 2] = second_circle_green_coordi2 + self.course_info_coordinate[2, 3] = second_circle_green_coordi1 def predict_block_locate(self, block_coordi) -> (int, int): """ブロックと直線の距離を判別する. @@ -1565,11 +1566,8 @@ def get_area_info(self, isR=True) -> None: test_images = os.listdir(work_dir_path) # NOTE:画像番号が一桁は"_"をつける - image_number = "22" - image_number = "_8" - image_number = "_0" - image_number = "_9" - image_number = "_4" + image_number = "20" + # image_number = "_1" for img in test_images: if img[-6:-4] == image_number: