You are assigning a function to a function. Functions do not have a static value as you are trying to assign, and therefore you cannot simply assign another function to it. Maybe you want to assign each to a variable like this:
my_var1 = predict_func(x, y, w, h)
my_var2 = cv2.boundingRect(cnts[i])
Or maybe you want this:
def predict_func(x, y, w, h):
return cv2.boundingRect(cnts[i])
But this would be strange, as none of predict_func
s parameters are used, so if you would provide clarification on what you are trying to do, we may be able to help better.
solved SyntaxError: can’t assign to function call ( Python ) [closed]