The automatic shape control of deformable objects is a challenging (and currently hot) manipulation problem due to their high-dimensional geometric features and complex physical properties. In this study, a new methodology to manipulate elastic rods automatically into 2D desired shapes is presented. An efficient vision-based controller that uses a deep autoencoder network is designed to compute a compact representation of the objects infinite-dimensional shape. An online algorithm that approximates the sensorimotor mapping between the robots configuration and the objects shape features is used to deal with the latters (typically unknown) mechanical properties. The proposed approach computes the rods centerline from raw visual data in real-time by introducing an adaptive algorithm on the basis of a self-organizing network. Its effectiveness is thoroughly validated with simulations and experiments.