Creating a depth map of a 3D surface

15 ビュー (過去 30 日間)
Ben
Ben 2014 年 3 月 13 日
コメント済み: George Abrahams 2024 年 2 月 28 日
I want to create a depth map of a 3D object (ie some 3D object like a sphere or cube plotted with surf or mesh) from an arbitrary perspective. I could write a primary ray-tracing algorithm but this seems like a lot of overhead. Is there any pre existing function to do something like this?

回答 (2 件)

George Abrahams
George Abrahams 2024 年 2 月 10 日
Hi @Ben. My 3D Rendering Toolbox on File Exchange will easily handle this, assuming that you want a perspective projection. For example, you can see the toolbox generating a depth map in the figure below.
  2 件のコメント
Mohannad
Mohannad 2024 年 2 月 16 日
Could you please guide me on how to replace PROJECTION_MATRIX with a camera Intrinsics (K)?
George Abrahams
George Abrahams 2024 年 2 月 28 日
Hi @Mohannad. I've just published an update to the ProjectionMatrix class to convert an intrinsic matrix to a projection matrix, which is required to perform rendering with the toolbox. The syntax is:
obj = ProjectionMatrix(intrinsicMatrix, imageSize, near, far)
As with everything else, there's detailed documentation about the inputs and so on in the code.

サインインしてコメントする。


Walter Roberson
Walter Roberson 2014 年 3 月 13 日
Would this be like projecting perpendicular to the perspective and then taking the point by point max() of the resulting z values?

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by