Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions SurroundBirdEyeView/surroundBEV.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
parser.add_argument('-ch', '--CAR_HEIGHT', default=400, type=int, help='Car Frame Height')
parser.add_argument('-fs', '--FOCAL_SCALE', default=1, type=float, help='Camera Undistort Focal Scale')
parser.add_argument('-ss', '--SIZE_SCALE', default=2, type=float, help='Camera Undistort Size Scale')
parser.add_argument('-blend','--BLEND_FLAG', default=False, type=bool, help='Blend BEV Image (Ture/False)')
parser.add_argument('-blend','--BLEND_FLAG', default=True, type=bool, help='Blend BEV Image (Ture/False)')
parser.add_argument('-balance','--BALANCE_FLAG', default=False, type=bool, help='Balance BEV Image (Ture/False)')
args = parser.parse_args()

Expand Down Expand Up @@ -271,8 +271,9 @@ def get_blend_mask(self, maskA, maskB, lineA, lineB):
overlap = cv2.bitwise_and(maskA, maskB)
indices = np.where(overlap != 0)
for y, x in zip(*indices):
distA = cv2.pointPolygonTest(np.array(lineA), (x, y), True)
distB = cv2.pointPolygonTest(np.array(lineB), (x, y), True)
# Change the order of x and y in the point tuple
distA = cv2.pointPolygonTest(np.array(lineA), (float(x), float(y)), True)
distB = cv2.pointPolygonTest(np.array(lineB), (float(x), float(y)), True)
maskA[y, x] = distA**2 / (distA**2 + distB**2 + 1e-6) * 255
return maskA

Expand Down