Skip to content

cv2.error: Unknown C++ exception from OpenCV code #2

@shahzad-ali

Description

@shahzad-ali

Hi @HuXiaoling 👋🏼

I'm testing the warping_loss through the following code:

y_pred = torch.randn((1, 4, 128, 128), device='cuda')
y_gt = (torch.randn(1, 4, 128, 128) > 0.5).to(torch.uint8).cuda()
y = warping_loss(y_pred, y_gt)

Unfortunately, I'm getting the following error caused by the line number_fore, _ = cv2.connectedComponents(patch, 4)

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "<input>", line 116, in warping_loss
  File "<input>", line 64, in update_simple_point
  File "<input>", line 17, in decide_simple_point_2D
cv2.error: Unknown C++ exception from OpenCV code

If you could assist me with this issue, I would greatly appreciate it.

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