New Shape Detection Algorithm