use random threhold for pixel difference