Skip to content

findCirclesGrid() Assertion failed in function 'transform' #19574

@alexcaoys

Description

@alexcaoys
System information (version)
  • OpenCV => 4.5.1
  • Operating System / Platform => Ubuntu 18.04.5 64-bit
  • Compiler => Anaconda 4.9.2 / JupyterLab 2.2.6 / Python 3.7.8
Detailed description

Using findCirclesGrid() on OpenCV 4.5.1. After detecting the grid, OpenCV will crash and give this error:
error: OpenCV(4.5.1) ../modules/core/src/matmul.dispatch.cpp:439: error: (-215:Assertion failed) scn == m.cols || scn + 1 == m.cols in function 'transform'
I checked the history of calib3d module, I guess the fault code is in the Dec. 11 commit. So I downgraded OpenCV to 4.5.0. The issue is not presented and my code works like a charm.

Steps to reproduce

In Python, this should be the minimum working example.

# continuously check the camera for grid and save the frame
cap = cv.VideoCapture(0)
img_counter = 0
while img_counter != 50:
	retval, frame = cap.read()
	gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
	ret, centers = cv.findCirclesGrid(gray, (13, 8), None, cv.CALIB_CB_SYMMETRIC_GRID)
	if ret:
                img_name = "opencv_frame_{}.png".format(img_counter)
                cv.imwrite(img_name, frame)
                img_counter += 1
cap.release()
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 solution
  • I updated to 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