Skip to content

Commit

Permalink
fix:バグ解消
Browse files Browse the repository at this point in the history
  • Loading branch information
kawano committed Nov 7, 2023
1 parent dfea11a commit ddf29a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions rear_camera_py/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
22 changes: 10 additions & 12 deletions rear_camera_py/src/get_area_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = \
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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] = \
Expand Down Expand Up @@ -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):
"""ブロックと直線の距離を判別する.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ddf29a1

Please sign in to comment.