In this paper we consider the problem of computing globally minimal continuous curves and surfaces for image segmentation and 3D reconstruction. This is solved using a maximal flow approach expressed as a PDE model. Previously proposed techniques yield either grid-biased solutions (graphbased approaches) or sub-optimal solutions (active contours and surfaces). The proposed algorithm simulates the flow of an ideal fluid with a spatially varying velocity constraint derived from image data. A proof is given that the algorithm gives the globally maximal flow at convergence, along with an implementation scheme. The globally minimal surface may be obtained trivially from its output. The new algorithm is applied to segmentation in 2D and 3D medical images and to 3D reconstruction from a stereo image pair. The results in 2D agree remarkably well with an existing planar minimal contour algorithm and the results in 3D segmentation and reconstruction demonstrate that the new algorithm is free fr...