PixelinSegments Sorting pixels in each segment of a segmented image The novel algorithm here is called "Two Pixel Reference". Details could be found in this paper: https://eartharxiv.org/ysa3m/