Report a code error in the data_collection_gamepad.ipynb file in notebooks/road_following folder
SuiHuming opened this issue · 0 comments
SuiHuming commented
image = cv2.circle(image, (widget_width / 2, widget_height), 8, (0, 0,255), 3)
image = cv2.line(image, (x,y), (widget_width / 2, widget_height), (255,0,0), 3)
This code will cause to "TypeError: integer argument expected, got float".
And as a result, the live camera feed fails to display properly.
To ensure that all arguments passed to OpenCV functions are integers and to avoid the "TypeError: integer argument expected, got float" error, it should be changed to:
image = cv2.circle(image, (int(widget_width / 2), widget_height), 8, (0, 0, 255), 3)
image = cv2.line(image, (x, y), (int(widget_width / 2), widget_height), (255, 0, 0), 3)