Grain sorting based on machine vision