My function
import numpy as np
def region_of_interest(image):
height = image.shape[0]
#pixel value to be filled in mask
#as value on depends on the number of channel
if len(img.shape) > 2:
mask_color_ignore = (255,) * img.shape[2]
else:
mask_color_ignore = 255
#shape of our interest
triangle = np.array([[(0, (5/6)*height), (900, (5/6)*height), (400, (1/6)*height)]])
mask = np.zeros_like(image)
try:
cv2.polylines(mask, pts = np.int32([triangle]), isClosed=1, color=mask_color_ignore, 1, lineType = LINE_8, shift = 0 )
except Exception as e:
print(e)
return mask
error coming out
cv2.polylines(mask, pts = np.int32([triangle]), isClosed=1, color=mask_color_ignore, 1, lineType = LINE_8, shift = 0 )
^
SyntaxError: positional argument follows keyword argument
please help me understand the reason of error and why it is coming here i am pretty new to openCv