Update analyze.cpp

added threshold on analysis instead of grayscale.