lambdaloop / aniposelib

📷 🐊 An easy-to-use library for calibrating cameras in python
https://anipose.readthedocs.io
BSD 2-Clause "Simplified" License
71 stars 33 forks source link

charuco board 0boards detected #23

Open yichuan1998 opened 1 year ago

yichuan1998 commented 1 year ago

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:
```import cv2
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

lambdaloop commented 8 months ago

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 commented 8 months ago

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?

yichuan1998 commented 5 months ago

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