Conversion of Rect to SDoublePlane and edge detection