add new method getEdges2 for better edge detection