A nonlinear circuit for coupled image restoration and edge detection