Skip to content

Function interpolateCornersCharuco misplace corners #3301

@heidydallard

Description

@heidydallard
System information (version)
  • OpenCV => 4.6.0
  • Operating System / Platform => Ubuntu 20.04
  • Compiler => Python
Detailed description

With the version 4.6.0, the function interpolateCornersCharuco misplace some corners. In my case, the corners that are misplaced are the right most ones that are placed at the center of the board.
The previous steps of the detection with the drawDetectedMarkers is working correctly.
I have tested with the version 4.5.5 and it works in this version.
result

Steps to reproduce
import copy
import matplotlib.pyplot as plt
import cv2

if __name__ == "__main__":
    dictionary = cv2.aruco.getPredefinedDictionary(7)
    charucoboard = cv2.aruco.CharucoBoard_create(29, 18, 0.01, 0.007, dictionary)
    detectorsparam = cv2.aruco.DetectorParameters_create()

    img = cv2.imread("image.png")

    arucocorners, arucoids, rejected = cv2.aruco.detectMarkers(img, charucoboard.dictionary)

    if len(arucocorners) > 0:
        imgmarkers = copy.deepcopy(img)
        cv2.aruco.drawDetectedMarkers(imgmarkers, arucocorners, arucoids)
        plt.imshow(imgmarkers)
        plt.show()

    retvalue, charucocorners, charucoids = cv2.aruco.interpolateCornersCharuco(arucocorners, arucoids,
                                                                               img, charucoboard)

    if len(charucocorners) > 0:
        imgcorners = copy.deepcopy(img)
        cv2.aruco.drawDetectedCornersCharuco(imgcorners, charucocorners, charucoids)
        plt.imshow(imgcorners)
        plt.show()

Here is the image used to do the test.
image

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions