PANDORE Version 6 GREYC-IMAGE

pgraylevel2depth



Converts gray levels to depth values.



Synopsis

pgraylevel2depth depthmax [-m mask ] [im_in|-] [im_out|-]

Description

pgraylevel2depth builds a 3D image from a 2D image, where the gray level are converted to depth. For example, the gray level 127 at coordinate (x,y) in the 2D image is copied along the 127 first slices at the same coordinate.

The parameter depthmax defines the depth of the output image im_out. All depths are normalized from that maximum depth.

The 3D image is built from the last slice. It means that clear objects occupy the first slices while dark objects occupy the last slices.

The algorithm is as follows:

for (y=0; y< normalize(im_in[x],depthmax); y++)
	im_out[y][x] = normalize(im_in[x],depth);

Parameters

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Builds the 3D image out.pan from the 2D image tangram.pan:

   pgraylevel2depth 50 tangram.pan a.pan

See also

Utility, pdepth2graylevel

C++ prototype

Errc PGraylevel2Depth( const Img2duc &im_in, Img3duc &im_out, long depthmax );

Version française

Construction d'une image de reliefs 3D à partir d'une image 2D.


Author: Jean-Marie Janik