Skip to content

Report a code error in the data_collection_gamepad.ipynb file in notebooks/road_following folder #624

@SuiHuming

Description

@SuiHuming
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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions