alicevision / Meshroom

3D Reconstruction Software
http://alicevision.org
Other
10.99k stars 1.07k forks source link

Calibrating multiple cameras (chessboard) #480

Open hargrovecompany opened 5 years ago

hargrovecompany commented 5 years ago

I'm using 50+ pi cameras in my rig....I'm assuming that the manufacturing process was not high precision and there's probably quite a bit of variation in the radial distortion from lens to lens, as well as variation in positioning of lens to sensor. I see a node that can be added that allows chessboard calibration. Is it possible to loop the workflow so that I can manually calibrate all of my pi cameras?

fabiencastan commented 5 years ago

There is a node for that which is not yet included in the release (as it requires other dependencies, i.e. the opencv library), but it will probably be included in the next release.

The other problem is that this node was dedicated for the CameraLocalization and has not been designed in a generic manner to be compatible with the SfM yet. So it needs some work to change the input/output file formats and add new inputs with calibration information to the CameraInit node.

Currently, it's still possible to manually copy/paste value or create a custom python node to convert results, etc. But that's not out-of-the-box yet. That's a simple development to do, and it would be a good subject for a first contribution if someone with development skills is interested!

hargrovecompany commented 5 years ago

I might be able to have one of my programmers do that....let me ask him about it. If I think he can handle it, i will make it happen

fabiencastan commented 5 years ago

If you decide to do it, we can setup a confcall to discuss how to do it when you are ready to start.

hargrovecompany commented 5 years ago

ok...I'll be chatting with him on Monday. I definitely would want him on the call....it's way out of my lane!

Just out of curiosity, is it possible (without asking the software to operate outside of it's intended use) to import/process a folder of images that have already been processed to remove lens distortion?

fabiencastan commented 5 years ago

Yes sure, if you keep the metadata in the process. The interpolation of the undistortion will introduce small smoothing/imprecision but it should not have any impact in practice.

fabiencastan commented 5 years ago

In that case, you should declare you intrinsics as "pinhole" cameras to avoid estimating distortion parameters again.

hargrovecompany commented 5 years ago

btw, I'll building a tool that adjusts color using a color card (building a correction/calibration profile). I can't think of any reason that anyone not using a rig with controlled lighting would need it but if you're interested in having my guys build it so that it can be included in your system let me know

fabiencastan commented 5 years ago

I'm definitely interested! We are looking at a solution to automatically detect color charts to calibrate colors in all images and generate final textures in a normalized colorspace.

hargrovecompany commented 5 years ago

wow.....perfect timing!

hargrovecompany commented 5 years ago

Hey Fabien- I spoke with one of my programmer today...he will be glad to chat with us by conference call an determine whether or not he thinks he is up to the task....just let me know when

hargrovecompany commented 5 years ago

Fabien- I think that I'm going to end up using Argyll to improve my color match and white balance match before I submit to Meshroom. It will require that I manually crop the color chart from the images that I want to calibrate against the master. The rest of the process is pretty much written into my master controller software and will be tested tomorrow. As far as identifying the chessboard.....maybe convert the image to black and white, tune the chessboard identification code in open cv to look for a specific type of card (Passport? Classic?). Get the coordinates, go back to the color image and copy the area and submit to Argyll? There's absolutely nothing that I can offer beyond just basic code to automate Argyll's capabilities....I'm not ashamed to say that you guys are way smarter than me. But I am really cool...lol!

I don't know if it would be of any value to you or your contributors, but my rig controller code is pretty decent. Let me know if you want a copy.

hargrovecompany commented 5 years ago

I guess I should ask....do you think that doing color chart correction will provide benefit? I'm not sure how Meshroom was able to match my images to the extent has, and obviously there's type of color correction in the system....I'm just curious if it is capable of coming close to providing the same level of improvement that color card matching can provide...?

natowi commented 5 years ago

@hargrovecompany I think colour chart based correction would be useful. I can be wrong, but from what I understand, Meshroom only adjusts the exposure and blends the images together for the final texture. If you wanted calibrated colours, you would need to correct the images beforehand. (there is also this #613 ) Just curious - will your programmer be working on this?

davesrocketshop commented 4 years ago

What is the current state of this? (incorporating calibration, not color matching)

I'm also looking at a rig of Pi's, and automating a lot of the process. I'm also an experienced coder so if I can help with this let me know.

natowi commented 4 years ago

@grandcrossgc Calibration is implemented, but could need some improvements and bug fixes (example https://github.com/alicevision/meshroom/issues/649). You are welcome to contribute.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.