Fruit and vegetable sorting using computer vision is routine. That's why commercial produce is so consistent - it's been pre-sorted. The existing technologies are so fast that it's routine to inspect and sort peas, and possible to sort grains of rice.
Most of the cost and complexity in the commercial machines is in the material handling. There are conveyors and devices to get the individual items lined up. Cleaning and washing stations are usually part of the line. Commercial machines have to be built sturdily so they survive continuous use, and have to be cleanable with high-pressure soapy water. The little unit that does machine vision is a minor part of the processing line.
AI techniques are routinely used. Support vector machines are popular. One Indian system uses fuzzy logic. ANNs have been tried but are not yet popular.
The systems generally measure user-defined features - length, width, curvature, color, flaws - which then go into a simple grading algorithm. They're not trying to match human decisions.
[1] https://www.youtube.com/watch?v=5DCpOx-q_yo [2] http://www.aweta.nl/en/produce/cucumber.html