An analogy can be established between image processing and statistical mech
anics. Just like the assignment of an energy function to a physical system
determines its Gibbs distribution, the assignment of an energy function to
an image determines its likelihood and, as a consequence, allows to model i
ts structure. Within this framework, related to the statistical concept of
a Markov Random Field, image restoration, image segmentation, motion detect
ion and some other low level operations can be expressed as the minimizatio
n of the corresponding energy function, or by the analogy, as finding the g
round state of the corresponding physical system. In practice, however, onl
y stochastic algorithms allow to solve this optimization problem for arbitr
ary energy functions. These techniques simulate thermal equilibrium under t
he posterior Gibbs distribution. When a gradual temperature reduction (anne
aling) is applied, the computation yields the maximum a posteriori (MAP) es
timate for the given image processing problem. This model provides excellen
t results but the computations required for the estimation are too heavy on
sequential computers for any practical interest. We propose stochastic opt
oelectronic integrated circuits (stochastic artificial retinas) able to per
form MAP estimates at video-rate. In our approach, thermal motion is implem
ented through noisy photocurrent sources created by speckle. The annealing
is provided by a reduction of the average intensity of the speckle and the
MAP estimation is performed by a stochastic gradient descent in the energy
landscape.