A computer vision/image processing method generates a depth map useful in producing
a foreground depth mask for 2D/3D image editing. The method uses image data from
a plurality of scenes. Feature points on each of the vertical scan lines in each
of the scene images are used to search for corresponding feature points on the
corresponding vertical lines in other images. The corresponding feature-point search
is performed by using a bipartite match network with a feature-point-ordering constraint
and a disparity-limit constraint, and produces an individual feature-point depth
map for each input image. A sparse feature-point depth map of the scene is obtained
after applying a consistency test to all the individual depth maps. A complete
feature-point depth map is produced by applying a color property assisted depth
propagation process to the sparse feature-point depth map. Foreground and background
separation is then conducted in the depth domain by using the order statistics
of the depth data extracted the feature-point depth map. A foreground feature-point
depth map is obtained from the separation operation. The final foreground depth
mask is generated by applying a color aided eight-nearest-neighbor LMS interpolation
process to the foreground feature-point depth map.