Thanks to visit codestin.com
Credit goes to github.com

Skip to content

unexpected inf and nan in the output #25133

@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

(array([[ inf, nan, inf],
[ inf, inf, nan],
[-inf, nan, nan]]), array([[1],
[1],
[1],
[1],
[1]], dtype=uint8))

Steps to reproduce

import cv2
import numpy as np

point1 = np.float64( [[-2/2, -2/2], [-2, -2], [-2/2, 2/2], [-2, 2], [-2/2, 0]])
point2 = np.float64( [[0, -2/2], [-2/2, -2/2], [0, 0], [-2/2, 0], [0, -1/2]])
output = cv2.findHomography(point1, point2)
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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions