An improved algorithm based on machine vision for detection of natural bruises in apple surface