Lightweight, error-tolerant edge detection using memristor-enabled stochastic logics