-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow setting of legacy pattern for charuco #652
Comments
Check the
|
I have already modified the config appropriately. This is its full contents:
With another problem I've encountered, board_width is capped to 99.99 - when launching app with config value exceeding this number, it gets capped anyway (not enough for 1189mm of a0 format). Dimensions shouldn't be a problem when it comes to just detecting points, should they? |
Thank you for bringing the value cap issue to my attention. I've updated a separate issue related to that input box so that I can address this at the same time: #641 My recollection is that the board dimensions should not be influencing the point detection. That is there primarily to aid with printing. The square size override is there to help with the world scale. Back to your Issue.... One other thought is that it is the aruco_scale may be throwing things off. In the raw charuco board definition, the scale is used to set the aruco_length parameter based on the square_length (inferred from the board dimensions or the override):
I hope to have more time tomorrow/later this week to look at this. If you are comfortable sharing one of your calibration video files it would be helpful for my troubleshooting/iterating. |
I just merged in some changes and published to PyPI (v0.5.2). I have made some updates that should hopefully resolve the board size restrictions you encountered and make the GUI run a little more smoothly. I continue to suspect that the Long ago I had played around with changing the relative size of the aruco marker relative to the solid squares and settled on a 0.75 ratio as a sensible default that seemed to have good recognition. I'm curious to learn what your board is using. Please let me know if this resolves your issue. If not, I'm still open to troubleshooting it, though it would be easier even with just a single frame or screenshot of the charuco you are using. |
Thanks for quick reply. When it comes to aruco_scale, as my aruco markers are 60mm and squares are 80mm, 0.75 should work fine (another problem I've encountered, aruco_scale value set in config gets overwritten with 0.75 when launching the app, so I can't test other values). I've tried playing around with other config values but no luck. I attach 9 seconds of my calibration video: port_1.mp4 |
Thank you for the video file! When I use the configuration above (10 rows, 14 columns, DICT_4X4_250, aruco_scale = 0.75) this is the board generated by opencv that Caliscope is looking for (and doesn't match the board in the video): Could you share the code that you used to define the board such that the points were successfully identified in your test script? Just to provide some additional context, the board dictionary name in the config is ultimately used to map to a
This is the dictionary that is ultimately used to create the charuco board in charuco.py:
Thank you! |
I see, I've generated my board using calib.io, not opencv own functions. Seems like calib.io is using the "legacy" generator which starts board with a marker instead of a chessboard when row count is even, as opencv did until release 4.6.0. They hid this functionality behind setLegacyPattern() in newer releases |
Ah, excellent! Seems we've tracked down the heart of the problem and it doesn't look like a difficult fix.... I'm renaming this thread and going to see if I can make a quick fix. Are you pulling your code from github or just downloading from PyPI? |
I'm using PyPI |
Cool. I think I have it working. The latest version is now published to PyPI as 0.5.3, though with the way these things go, I probably broke something else while I was at it. At the very least, your board is recognized: Note that you need to add
Please let me know how it goes! |
Thank you, I’ve tested the new version and it works as expected. I have two additional questions for you, I didnt want to open additional issues for them:
|
Glad to hear it's working!
[ edit: reflecting on this I'm not really sure what you mean by error between 5-20. I got a RMSE of 0.582 from the video you sent me. Could you clarify what you mean?] I'd have two recommendations after viewing your sample calibration video. First, have the board shown from multiple distances. Second, have the board shown from multiple angles. You want the foreshortening to be quite apparent. You may also benefit from having the camera fixed and slowly moving the board in front of it (held at an angle and back and forth through a range of distances). Motion blur is your enemy.
I wasn't aware of this project and am glad that you've put me in the loop. I definitely see the value in this for allowing lower exposure/less blurred calibration images. If there was a simple plug and play solution for this I'd definitely try to integrate it in the near term. Is there a specific implementation you would recommend? |
The video I attached here was just a quick test recording, I've refined my methods since. Currently I have the camera fixed and try to move the board around with varying distance and angles - these "refined" videos result in pretty high RMSE/reprojection error, even for cameras without significant distortions. I will try to re-record them with your tips in mind, do you by any chance have a good calibration video at hand so I can follow more closely? When it comes to deepcharuco, I've briefly tested this implementation as it seems to be the only publicly available one. it also supports MPS on mac systems out of the box and has pretty good inference instruction straight in the readme. edit: the only problem with it, it's trained on particular board configuration, and only one model based on the original paper was pretrained. |
I had edited my question so I'm not sure if you'd read that. I'm still not sure what is meant by a reprojection error "between 5-20". I got 0.582 from your rough cut video so I'm hoping that you get better than that when the camera is stable and foreshortened views are available. It's also important to consider that the reprojection is measured in pixels and you have a video resolution of 4608x2592. That's a lot of pixels....the spatial error of half a pixel at that resolution is going to be less than the spatial error associated with some 1280p image. Thanks for the deepcharuco reference. It's a project that I will follow, though likely won't fold in over the near-term. edit: I'm going to go ahead and mark this as closed. If you have any additional questions it would be better to raise it as a discussion just to keep the threads of conversation better sorted for posterity/future reference. Thanks for your feedback on this project. |
App doesnt seem to detect any points on my charuco board. Board wasn't created by this app but follows 4x4_250 charuco dictionary with A0 dimensions and 10x14 grid. I've tried with two different cameras, just to make sure that video file or colors weren't the issue. No points appear on the frames, clicking "add grid" button results in "Not enough points....grid not added..." error in the console. Autocalibration throws "Waiting for sufficient calibration boards to become populated at port 1" for each frame. I've verified that the board and video files are fine by writing my own simple test program, corners and markers are detected without any issues. What might be the issue here?
The text was updated successfully, but these errors were encountered: