aniposelib icon indicating copy to clipboard operation
aniposelib copied to clipboard

charuco board 0boards detected

Open yichuan1998 opened this issue 1 year ago • 3 comments

Hi, thanks for your great job. I followed the steps in aniposelib tutorial but got error: 0 boards detected. Could help me with that? Thanks!

My code:

from aniposelib.cameras import CameraGroup


vidnames = [['output0.avi'],
            ['output1.avi'],
            ['output2.avi']]

cam_names = ['A', 'B', 'C']

n_cams = len(vidnames)

board = CharucoBoard(7, 10,
                     square_length=25, # here, in mm but any unit works
                     marker_length=18.75,
                     marker_bits=4, dict_size=50)

cgroup = CameraGroup.from_names(cam_names, fisheye=False)
cgroup.calibrate_videos(vidnames, board)
cgroup.dump('calibration.toml')

Generate board and print it in A4 format:

from aniposelib.boards import CharucoBoard

board1 = CharucoBoard(7, 10,
                     square_length=25, # here, in mm but any unit works
                     marker_length=18.75,
                     marker_bits=4, dict_size=50)

img = board1.draw((2550,3300))
cv2.imwrite("img.jpg", img)

image

Sincerely

yichuan1998 avatar Sep 27 '23 09:09 yichuan1998

Hello, I'm not sure if you're still having this issue, but it's hard to diagnose from this alone. Could you post some sample videos to help debug? Thank you

lambdaloop avatar Jan 19 '24 06:01 lambdaloop

Could you try with the latest version of aniposelib (0.6.0 as of this writing) ? Also, could you try with CharucoBoard(10, 7, ...) instead of CharucoBoard(7, 10, ...) to see if that works?

lambdaloop avatar Jan 20 '24 11:01 lambdaloop

Hi, I am still having this issue. My code:

def cali():
    vidnames = [[r'D:\my_work\Only_test\video\0\video_152122079464.mp4'],
                [r'D:\my_work\Only_test\video\1\video_104422070017.mp4']]

    cam_names = ['A', 'B']

    n_cams = len(vidnames)

    board = CharucoBoard(4, 5,
                         square_length=14,  # here, in mm but any unit works
                         marker_length=10,
                         marker_bits=4, dict_size=50)

    # the videos provided are fisheye, so we need the fisheye option
    cgroup = CameraGroup.from_names(cam_names, fisheye=False)

    cgroup.calibrate_videos(vidnames, board)
    cgroup.dump('calibration.toml')

I'm sure the CharucoBoard parameters are right, here are my charuco board and the recorded videos. 微信图片_20240430161030 image video_104422070017.zip

video_152122079464.zip

yichuan1998 avatar Apr 30 '24 08:04 yichuan1998