detect corners using max distances from other points