By reordering the paths points, opencv draws a nicer mask than before.