implemented some rectangle detection for eventual automatic box pickup