BlenderProc
BlenderProc copied to clipboard
The residual for the worst distorted pixel got unstable/stalled
Hello,
I render images by entering intrinsic and distortion parameters. When I enter over than 0.2 for k1 parameter (in distortion) it give me the following error.
The residual for the worst distorted pixel got unstable/stalled. The residual for the worst distorted pixel got unstable/stalled. The residual for the worst distorted pixel got unstable/stalled. The residual for the worst distorted pixel got unstable/stalled. The residual for the worst distorted pixel got unstable/stalled.
I don't want to change my parameters. How can I get over this?
Hey,
The reason why it gets unstable is likely because the gradient of the und2dis mapping search changes it radial direction, meaning that e.g. for a longer pixel distance to the main point, the angular distance w.r.t. the main axis of the camera reduces instead of increasing, which is not realistic with real lenses. This would generate void distorted image regions, which is not acceptable as an output for BProc. Hence your distortion parameters seem likely unsuitable. Most likely reasons are:
- you calibrated your camera with a calibration toolbox that makes it difficult to gather data in the whole image area (like opencv, as a comparison these are typical images for DLR CalLab) or
- you try parameters that has not been measured in a calibration.
Other parameters play a role, too. For instance, you cannot decrease the focal length too much because your angular field of view would increase and at that distance the radial distortion model might not be defined anymore.
A further possibility is a bug in the program: To distort, we typically generate an internal image with higher resolution in order for us to be able to crop the resulting distorted image down to the desired resolution without any void areas that would otherwise typically occur (similar to the black borders here but for distortion not undistortion). The parts of the image not being actually needed, which are discarded, have a high angular distance to the main axis and may be problematic. But this is very unlikely since these area regions are very small.
If you insist with these parameters (and have a good reason to), you can send us the data and we'll be happy to debug.
Hey,
did you use the main branch? Then this was a bug which is fixed here: https://github.com/DLR-RM/BlenderProc/commit/bae645d80a718a17d7377f7a6a10468f3bcd5155
It is not merged, yet.
Best, Max
Is merged now.