multithreaded edge detector written in c++