abstract: In this study (joint work with Giovanna Citti) we propose to model the functional architecture of the primary visual cortex V1 as a principal fiber bundle where the 2-dimensional retinal plane is the base manifold and the secundary variable of orientation constitutes the vertical fibers over each point as a rotation group. The total space is equipped with a natural subriemannnian structure neurally implemented by long range horizontal connections. Image completion is achieved with mean curvature flow of the lifted image in the subriemannian manifold. The model shows what could be the deep structure for both boundary and figure completion and for morphological structures such as the medial axis of a shape.