change output from image to text h*w with segmentIds
create txt file with edges between segments