Fixed the segment script
Only export the largest contour when exporting masked images
Scale input images based on their perimeter