Optimal Image Segmentation for Embedded Machine Vision