Using Bayesian approach, early-vision tasks can be formulated into a statistical regularization problem. With the help of a Markov random field (MRF) description, an posterior energy function is defined on the image. Using MAP (maximum a posteriori) criterion, the restoration process becomes equivalent to the minimization of the non-convex energy. Stochastic methods offer a general framework to solve such difficult problems. We concentrate on image restoration preserving discontinuities, and on the so called Geman's energy function characterizing it. This energy is defined upon a continuous intensity field in interaction with a binary line process, allowing for sharp edges in the restoration. We propose an algorithm and hardware solutions for performing video rate stochastic minimization through a dedicated optoelectronic VLSI retina. The operation of the stochastic algorithm we present is twofold. On one hand, thermal equilibrium in the continuous field comes from a deterministic minimization perturbed by a quasi-static noise process. Quasi-static meaning that the noise process is constant during the minimization. The binary field, on the other hand, is updated using a Gibbs sampler technique. Next we propose a VLSI implementation of this algorithm. It features an asynchronous analogue stochastic resistive network implementing the thermal equilibrium of the continuous field, and a parallel array of synchronous stochastic processing elements providing Gibbs sampling of the binary line field. An optoelectronic VLSI efficient random number generator provides the retina with the massive amount of random numbers required for video rate operation.