1. A device for optical analysis of a quality of grains from crops, comprising: a feeder, which is arranged to feed a grain sample, which comprises at least one grain, to a place for optical measurement, an optical system, which is adapted to illuminate individual grains of the grain sample at the place for optical measurement and to detect illumination after its interaction with a surface of the individual illuminated grain, and an analyzer, which is adapted to receive the detected illumination and to process the same to determine a quality of said grain sample, wherein the analyzer is adapted to process the detected illumination to generate three-dimensional surface information of an individual grain of the grain sample and to analyse the three-dimensional surface information to determine the quality.