(tile_corners, threshold_image)
| 71 | |
| 72 | # Function to check if all corners are inside the mask |
| 73 | def is_tile_fully_enclosed(tile_corners, threshold_image): |
| 74 | for corner in tile_corners: |
| 75 | x, y = corner |
| 76 | # Check if x, y are within the bounds of the threshold_image |
| 77 | if not (0 <= x < threshold_image.shape[1] and 0 <= y < threshold_image.shape[0]): |
| 78 | return False |
| 79 | |
| 80 | # Check if the corner is inside the mask (non-zero pixel) |
| 81 | if threshold_image[y, x] == 0: # 0 means the pixel is outside the contour |
| 82 | return False |
| 83 | return True |
| 84 | |
| 85 | response[tile_index] = is_tile_fully_enclosed(corners, threshold_image) |
| 86 |
no outgoing calls
no test coverage detected