Skip to content

cv2.error #6

@iason-r

Description

@iason-r

When I run the Kitti dataset, some frames will error as follows:

Traceback (most recent call last):
  File "E:\gsloam\Tools_Merge_Image_PointCloud\main.py", line 101, in <module>
    main()
  File "E:\gsloam\Tools_Merge_Image_PointCloud\main.py", line 72, in main
    cv2.rectangle(pcimg, (int(i[0]-1),int(i[1]-1)), (int(i[0]+1),int(i[1]+1)), (0, 0, color), -1)
cv2.error: OpenCV(4.10.0) :-1: error: (-5:Bad argument) in function 'rectangle'
> Overload resolution failed:
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
>  - Can't parse 'rec'. Expected sequence length 4, got 2
>  - Can't parse 'rec'. Expected sequence length 4, got 2

I found through debugging that this issue seems to be caused by the conversion of points in the point cloud to the image coordinate system, where the coordinates are too large or negative.
I would greatly appreciate it if you could help me answer this question.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions