An intelligent system for sorting pistachio nut varieties