surface. Compared to mechanical grading methods, the visual recognition type is an ideal non-destructive grading method. [PERSON] et al. [8] and [PERSON] et al. [9] developed a sorting system based on an artificial neural network with machine vision to grade red dates and pomegranates, respectively. The disadvantages of this method are low productivity and high cost.  
The grading of fresh goji berries needs to meet the requirements of low damage rate, high grading accuracy, and high productivity at the same time, and none of the above research results can be directly used to grade fresh goji berries. Combining previous research, we designed a variable gap-type fresh goji berry grading machine.  
The discrete element method (DEM) is a new numerical computational method for analyzing the laws of motion and mechanical properties of complex discrete systems. In recent years, with the continuous improvement of discrete element theories and related software, more and more scholars have applied the DEM to design and optimize agricultural machinery [10; 11]. [PERSON] et al. [12] carried out simulations using EDEM software to investigate the effect of the height, the mounting angle, and the number of guide blades on the threshing output of the combine harvester. [PERSON] et al. [13] developed a precision seeder for dry direct-seeded rice with film mulching. Based on the EDEM simulation results in different situations, the optimum working parameters were obtained.  
One crucial step to ensure the accuracy of the model is inputting accurate simulation parameters, including intrinsic parameters and contact parameters. The intrinsic parameters of the material (mainly bulk density, Young's modulus, and Poisson's ratio) can be measured directly by equipment, or values reported in the literature can be used [14]. However, the calibration of the contact parameters (mainly collision restitution coefficient, static friction coefficient, rolling friction coefficient) requires simulation in combination with DEM due to the differences in geometry and surface roughness between simulated and real particles [15]. A combination of physical experiments and simulation tests is commonly used for the calibration of the contact parameters. [PERSON] et al. [16] established a simulation model of mung beans using the Hertz-Mindlin with bonding model, conducted physical experiments and DEM simulation experiments, and calibrated the simulation parameters between mung bean seeds and two contact materials.  
The discrete element simulation parameters of bulk materials such as maize kernels [17; 18], rice [19], wheat [20], radish seeds [21], and peanuts [22], have been calibrated by domestic and foreign scholars. The parameters were also verified by field tests, and the results showed that the contact parameters varied significantly for different particles. However, the calibration of contact parameters for goji berries has rarely been reported.  
In this paper, we took fresh goji berry as the research object, established the simulation model of fresh goji berries using SFM-CMVS technology, and calibrated the discrete element modeling parameters required for the simulation based on its intrinsic parameters. The reliability and scientificity of the simulation model and simulation parameters was verified using field tests, thus providing a reference for the design and simulation study of the device.