Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(sliding window): fix the boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
jemmyshin committed Aug 1, 2019
1 parent 5f1ba18 commit 14cdfab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gnes/preprocessor/image/sliding_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _get_slid_offset_nd(self, all_subareas: List[List[int]], index: List[List[in
@staticmethod
def _get_location(all_subareas: List[List[int]], center_point: List[float]) -> List[bool]:
location_list = []
x_boundary = max([x[1] for x in all_subareas])
x_boundary = max([x[2] for x in all_subareas])
y_boundary = max([y[3] for y in all_subareas])
for area in all_subareas:
if center_point[0] in range(int(area[0]), int(area[2])) and center_point[1] in range(int(area[1]),
Expand All @@ -110,6 +110,8 @@ def _get_location(all_subareas: List[List[int]], center_point: List[float]) -> L
location_list.append(True)
else:
location_list.append(False)
if True not in location_list:
location_list[-1] = True
return location_list


Expand Down

0 comments on commit 14cdfab

Please sign in to comment.