An extended four-dimensional version of the traditional Petitot–Citti–Sarti model on contour completion in the visual cortex is examined. The neural configuration space is considered as the group of similarity transformations, denoted as M=SIM(2). The left-invariant subbundle of the tangent bundle models possible directions for establishing neural communication. The sub-Riemannian distance is proportional to the energy expended in interneuron activation between two excited border neurons. According to the model, the damaged image contours are restored via sub-Riemannian geodesics in the space M of positions, orientations and thicknesses (scales). We study the geodesic problem in M using geometric control theory techniques. We prove the existence of a minimal geodesic between arbitrary specified boundary conditions. We apply the Pontryagin maximum principle and derive the geodesic equations. In the special cases, we find explicit solutions. In the general case, we provide a qualitative analysis. Finally, we support our model with a simulation of the association field.