![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1613656/image.gif)
Creating a depth map of a 3D surface
조회 수: 4 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (2개)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1613656/image.gif)
댓글 수: 2
Mohannad
2024년 2월 16일
Hi, prof. @George Abrahams
Could you please guide me on how to replace PROJECTION_MATRIX with a camera Intrinsics (K)?
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
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?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!