A double-layer CNN for image restoration and edge detection