Plant image classification and retrieval based on leaf margin features