The camera intrinsic [cx] and [cy] is useless in this demo.
The camera intrinsic [cx] and [cy] is useless in this demo.
It is used in the intrinsic, see the K matrix in this function, for instance: https://github.com/pablospe/render_depthmap_example/blob/dbd53b33ae13a78514b8307416bd7d4651d38cb5/visualization.py#L133
Or what do you mean exactly?
它用于内在函数,参见此函数中的 K 矩阵,例如:
https://github.com/pablospe/render_depthmap_example/blob/dbd53b33ae13a78514b8307416bd7d4651d38cb5/visualization.py#L133
或者你到底是什么意思?
I mean , the (.capture_depth) or (capture_screen) is still using the intrinsic [ width, height, fx, fy , width/2 , height/2], not the [ width, height, fx, fy , cx , cy].
Here is the same issue : [https://github.com/isl-org/Open3D/issues/3079]
Do you mean this: https://github.com/pablospe/Open3D/blob/0728214089c2f149e522b3b81006067753a899ad/cpp/open3d/visualization/visualizer/ViewControl.cpp#L172-L173 ?
intrinsic.intrinsic_matrix_(0, 2) = (double)window_width_ / 2.0 - 0.5;
intrinsic.intrinsic_matrix_(1, 2) = (double)window_height_ / 2.0 - 0.5;
I mean the following code block:
https://github.com/pablospe/Open3D/blob/0728214089c2f149e522b3b81006067753a899ad/cpp/open3d/visualization/visualizer/ViewControl.cpp#L196
if (!allow_arbitrary && (window_height_ <= 0 || window_width_ <= 0 ||
window_height_ != intrinsic.height_ ||
window_width_ != intrinsic.width_ ||
intrinsic.intrinsic_matrix_(0, 2) !=
(double)window_width_ / 2.0 - 0.5 ||
intrinsic.intrinsic_matrix_(1, 2) !=
(double)window_height_ / 2.0 - 0.5)) {
utility::LogWarning(
"[ViewControl] ConvertFromPinholeCameraParameters() failed "
"because window height and width do not match.");
return false;
}
the flag "allow_arbitrary" doesn't change the camera intrinsic value about "cx" and "cy". As a result, the function (.capture_depth) 或 (capture_screen) is still using the intrinsic [ width, height, fx, fy , width/2 , height/2].
Hi @pablospe ! I met with the same problem.
If I change the cx or cy of intrinsic_matrix in view_point.json, the rendered image doesn't change with cx or cy. Logically, when I increase cx, the rendered image should shift to the right by the according pixel distance. However, the open3D returned the same images with different cx.
It means that the visualizer of open3D still uses the intrinsic [ width, height, fx, fy , width/2 , height/2] instead of [ width, height, fx, fy , cx , cy] that I specify.
One would need to debug the Open3D viewer to find the problem and see where is set to width/2 , height/2.
I had some problems with Open3D viewer so I tried to replicate this code using pyvista (VTK backend), in this branch: https://github.com/pablospe/render_depthmap_example/tree/pyvista Maybe you want to give a try to this branch to avoid flighting with Open3D viewer.
Another alternative: https://github.com/cvg/raybender (see the demo: https://github.com/cvg/raybender/blob/main/examples/demo.py)
Thank you for your prompt response. I will give it a try ! :smiley: