[vtkusers] Build depth map of a 3D model
David Doria
daviddoria at gmail.com
Mon May 7 10:26:34 EDT 2012
On Mon, May 7, 2012 at 10:24 AM, Wenlong Wang <scc.wwl at gmail.com> wrote:
> Hi, David
>
> Thank you for your reply. The error is gone now. But it turns out the result
> image is just a black one.
>
> Here is what I do,
> The outcoming image is a 512x512 black image. I'm not sure which part of the
> code cause such a problem. Please correct me.
Perhaps the Z buffer is between 0 and 1? In which case, you'll want to
scale it *before* converting it to unsigned char:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageShiftScale
If you scale it to 0-255, it should produce the image you're looking for.
David
More information about the vtkusers
mailing list