Depth-wise layering of 3d images using dense depth maps: a threshold based approach