I’m working on am app where I generate a CharucoBoard
, which I then display on a monitor. I plan to take photos of this board from different angles using a camera, and use those images for camera calibration.
The part I’m unsure about is how to correctly determine the values for squareLength
and markerLength
that I need to pass into the cv::aruco::CharucoBoard()
constructor.
What seems most practical to me is to let users of this app define the size of the squares in pixels (e.g. square_size_px
). From there, I calculate how many squares fit in the X and Y directions based on the screen size. Then, using the monitor’s DPI, I convert the square size from pixels to millimeters and use those values for squareLength
and markerLength
.
Does that approach make sense? Am I missing anything important, or is there a better or more reliable way to go about this?
that depends on the parameters you generated the board with.
you could assume 96 dpi, or 72 dpi, or anything really. for monocular calibration, it doesn’t matter because similar triangles, depth directly depends on the assumed size of objects.
Thanks @crackwitz! I’ve implemented this approach and it seems to work well. What I did notice however is that when I generate a board using the 7x7_250 dictionary, that I never find any detections. What does work well is 6x6_250.
7x7 makes no sense. that requires too much detail to resolve, and you have no use at all for that huge a capacity for IDs, if it’s even available… the set of predefined aruco dictionaries only distinguish at most 1000 IDs. pick the lowest that’ll work. 4x4 works just fine.
Thanks @crackwitz! Initially I thought that Aruco markers might work better when they can use more bits; but I understand now that I was wrong. Using 4x4 now which works great.
charuco is actually a terrible kludge for the problem of what I call “grid recovery”. one of these days I’ll write something to do this. then nobody will have to use charuco ever again. for intrinsic calibration anyway.
1 Like