Skip to content

Unexpect error when invoke cv2.sampsonDistance #25370

@beanduan22

Description

@beanduan22

System Information

Python version: 3.8.18
OpenCV python version: 4.9.0
Operating System / Platform: Windows-10-10.0.19045-SP0

Detailed description

cv2.error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\calib3d\src\fundam.cpp:1214: error: (-215:Assertion failed) _pt1.type() == CV_64F && _pt2.type() == CV_64F && _F.type() == CV_64F in function 'cv::sampsonDistance'

all of the input param I set were float64

Steps to reproduce

import numpy as np
import cv2
pt1 = (np.random.rand(100, 1, 2)* 256).astype(np.float64)

pt2 = (np.random.rand(100, 1, 2)* 256).astype(np.float64)

m3 = (np.random.rand(3,3) * 256).astype(np.float64)

output = cv2.sampsonDistance(pt1, pt2, m3)
print(output)

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions