**Andrzej Anders \*, Dariusz Choszcz, Piotr Markowski, Adam Józef Lipi ´nski, Zdzisław Kaliniewicz and Elwira Slesicka ´**

Department of Heavy Duty Machines and Research Methodology, University of Warmia and Mazury in Olsztyn, Olsztyn 10-957, Poland; choszczd@uwm.edu.pl (D.C.); pitermar@uwm.edu.pl (P.M.);

adam.lipinski@uwm.edu.pl (A.J.L.); arne@uwm.edu.pl (Z.K.); elwira.slesicka@uwm.edu.pl (E.S.) ´

**\*** Correspondence: andrzej.anders@uwm.edu.pl; Tel.: +48-089-523-4534

Received: 24 April 2019; Accepted: 14 May 2019; Published: 16 May 2019

**Abstract:** The aim of the study was to build numerical models of cucumbers cv. *Sremski ´* with the use of a 3D scanner and to analyze selected geometric parameters of cucumber fruits based on the developed models. The basic dimensions of cucumber fruits–length, width and thickness—were measured with an electronic caliper with an accuracy of *d* = 0.01 mm, and the surface area and volume of fruits were determined by 3D scanning. Cucumber fruits were scanned with an accuracy of *d* = 0.13 mm. Six models approximating the shape of cucumber fruits were developed with the use of six geometric figures and their combinations to calculate the surface area and volume of the analyzed agricultural products were identified. The surface area and volume of cucumber fruits calculated by 3D scanning and mathematical formulas were compared. The surface area calculated with the model combining two truncated cones and two hemispheres with different diameters, joined base-to-base, was characterized by the smallest relative error of 3%. Fruit volume should be determined with the use of mathematical formulas derived for a model composed of an ellipsoid and a spheroid. The proposed geometric models can be used in research and design.

**Keywords:** 3D scanner; geometric model; reverse engineering; fruit; cucumber

#### **1. Introduction**

Advanced measurement techniques and software supporting complex simulations of selected technological processes are required to introduce new products and technologies on the market and to improve product quality. Models of agricultural products should account for the designed technological processes and should accurately reflect the products' shape [1]. A 3D model that accurately describes a product's geometric and physical parameters can be used in the design process. A traditional approach to modeling relies on the assumption that agri-food products are homogeneous and isotropic, and the modeled objects are assigned regular shapes (e.g., cylinder, sphere, cone, etc.) Computer-Aided Design (CAD) and Computational Fluid Dynamics (CFD) software can be applied to simulate complex processes that occur during the processing of agri-food products [2]. The development of a model that closely approximates the shape of the original agricultural product and can be used in computer simulations poses the key challenge in the research and design of food processing equipment. Numerical modeling based on traditional methods is a laborious and difficult task, in particular when the studied objects have irregular shape [3]. In the process of measuring fruits and seeds, many researchers rely solely on image analysis tools and measuring devices such as calipers and micrometers [4,5]. In the literature, traditional methods have been used to determine the geometric parameters of soybeans (*Glycine max* L. Merr.) [6], sunflower seeds (*Helianthus annuus* L.) [7], oilseed rape seeds (*Brassica napus* L.) [8,9], mustard seeds (*Sinapis alba*) [10] and flax seeds (*Linnum usitatissimum* L.) [11]. In small objects such as seeds, only basic dimensions can be measured with a

caliper or a micrometer. In larger products such as fruits and vegetables, the analyzed parameters can be measured with a caliper or a micrometer at any point on the object's surface.

In the literature, traditional and advanced measuring techniques have been deployed to accurately render the shape of the analyzed products. Erdogdu et al. [12] relied on a machine vision system designed by Luzuriaga et al. [13] to determine the geometric parameters of shrimp cross-sections and to develop mathematical models of the thermal processing of shrimp. Crocombe et al. [14] analyzed the surface of meat pieces by laser scanning to develop a numerical model and simulate meat refrigeration time. Jancsok et al. [15] used a machine vision system to build numerical models of pears cv. Konferencja. Borsa et al. [16] performed computed tomography scans and calculated the radiation dose absorbed by the examined food products. Sabliov et al. [17] proposed an image analysis method for measuring the volume and surface area of axially symmetric agricultural products. Zapotoczny [18] developed a test stand for measuring the geometric parameters of cucumber fruits with the use of digital image analysis. The cited author registered changes in the shape and size of greenhouse-grown cucumbers during storage. Scheerlinck et al. [19] relied on a machine vision system to develop a 3D model of strawberries and a thermal system for disinfecting fruit surfaces. Du and Sun [20] and Zheng et al. [21] developed an image analysis technique for measuring the surface area and volume of beef loin and beef joints. Kim et al. [22] generated 3D geometric models of food products with a complex shape with the use of computed tomography. Goni et al. [23] modeled the geometric properties of the studied objects with the involvement of magnetic resonance imaging. Siripon et al. [24] analyzed chicken half-carcasses with a 3D scanner (Atos, GOM, Germany) and used the results to simulate cooking processes. Mieszkalski [25,26] developed computer models of carrots, apples cv. Jonagored and chicken eggs. The shape of biological objects was described with Bézier curves. The resulting mathematical models were used to generate 3D figures that accurately rendered the shape and basic dimensions of the studied products. Balcerzak et al. [27] modeled the geometric parameters of corn and oat kernels in the 3ds Max environment. Images of kernel cross-sections were used to acquire geometric data, generate meshes and determine nodal coordinates. Ho Q. T. and others used multiscale modeling in food engineering. Multiscale models support evaluations of the phenomena occurring inside agricultural raw materials on a micro and macro scale. The authors relied on X-ray tomography to generate multiscale models [28]. The volume of agricultural raw materials can also be determined by water displacement. However, this method cannot be applied to materials that easily absorb water [29].

The majority of methods require complex and expensive measuring devices and software. A thorough knowledge of various imaging techniques is required to model irregularly shaped objects. Models that accurately render the shape of the analyzed products can be developed with the use of a 3D scanner. This technique is considerably simpler, but it is not yet widely used. 3D models can be used to analyze the shape of whole products or their fragments [30,31].

The dimensions and basic geographic parameters of agricultural materials have been long determined with the use of simple measuring devices, including analog and digital calipers, micrometers and dial indicators. The main limitation of conventional measuring techniques is that they investigate only characteristic points in the examined objects, and the measured values can be used to calculate selected parameters, such as surface area and volume, with mathematical formulas [29]. In contrast, indirect methods rely on the acquisition of images of the investigated object and digital image analysis. The advances made in digital technology and computing power have contributed to the widespread popularity of indirect measuring methods. Indirect measurements produce linear dimensions as well as images of the analyzed surfaces. The main advantage of indirect methods is that measurements are rapid, whereas the main limitation stems from the fact that measurements are performed along the contours of the acquired image, which are projected onto a plane [9]. A relatively new method has been proposed for registering the shape of a sample as a cloud of points. The location of every point in the modeled sample is determined with the use of 3D scanners, which register the position of the laser beam, a structured light source. The points registered by a 3D scanner support the development

of a numerical model, which can be used in metrological analyses. The development of a numerical model with the described method is time-consuming, but the results can be stored in computer memory [32,33].

The presented methods for measuring the geometric properties of objects produce highly similar results, provided that the required precision thresholds are met. However, the time and conditions of measurement can vary. Approximation formulas are widely applied to calculate volume and area. The main problem is the selection of the optimal model for determining the above parameters with the required accuracy. The aim of this study was to compare selected geometric parameters of cucumber fruits acquired from 3D models and models based on basic geometric figures and direct caliper measurements.

### **2. Materials and Methods**

The experiment was performed on cucumber fruits cv. *Sremski ´* stored indoors at a constant temperature of 18.1 ◦C and 60% humidity. Cucumbers were purchased from the Pozorty Production and Experimental Station in Olsztyn. Fifty whole cucumber fruits without visible signs of damage were randomly selected for the experiment. Cucumbers were purchased on five occasions in the second half of August 2018, and 10 cucumbers were purchased each time. The length, width and thickness of cucumber fruits were measured with an electronic caliper with an accuracy of *d* = 0.01 mm. Each fruit was additionally measured with an electronic caliper at the points presented in Figure 1. Cucumbers were scanned with the Nextengine 3D scanner with a resolution of 15 points per mm2. Scanning precision was 0.13 mm. Cucumbers were mounted on a turntable. Individual images were combined in the ScanStudio HD PRO program [34]. The developed numerical models were used to determine the surface area and volume of cucumber fruits. The above parameters were measured in the MeshLab program [35].

**Figure 1.** Shape of a selected cucumber fruit: *L*—length (mm), *W*—width (mm), *T*—thickness (mm), *L1*—length of the middle section (mm), *W1*, *W2*—width of the terminal section (mm), *T1*, *T2*—thickness of the terminal section (mm).

The measured dimensions were used to build six geometric models whose shape resembled the shape of cucumber fruits. The surface area and volume of fruits were calculated from the developed models. Geometric models were built based on basic geometric figures, including an ellipsoid, cylinder, hemisphere, truncated cone and a combination of selected figures. The analyzed geometric models are presented in Figure 2.

**Figure 2.** Models of cucumber fruits: M1—ellipsoid, M2—spheroid, M3—cylinder, M4—truncated cone and two hemispheres, M5—cylinder and two hemispheres, M6—two truncated cones and two hemispheres.

Mathematical formulas were derived for every geometric model and were used to calculate the surface area and volume of cucumbers [36,37]:

ellipsoid model (M1):

$$A\_{M1} = 2 \cdot \pi \cdot \left( \left(\frac{L}{2}\right)^2 + \frac{\frac{T}{2} \cdot \left(\frac{L}{2}\right)^2}{\sqrt{\left(\frac{W}{2}\right)^2 - \left(\frac{L}{2}\right)^2}} \cdot F(\Theta, m) + \frac{T}{2} \cdot \sqrt{\left(\frac{W}{2}\right)^2 - \left(\frac{L}{2}\right)^2} \cdot E(\Theta, m) \right) \tag{1}$$

where:

$$m = \frac{\left(\frac{L}{2}\right)^2 \cdot \left(\left(\frac{T}{2}\right)^2 - \left(\frac{L}{2}\right)^2\right)}{\left(\frac{T}{2}\right)^2 \cdot \left(\left(\frac{M}{2}\right)^2 - \left(\frac{L}{2}\right)^2\right)} = \frac{L^2 \cdot T^2 - L^4}{T^2 \cdot W^2 - L^2 \cdot T^2} \tag{2}$$

$$\Theta = \arcsin\left(\sqrt{\frac{\sqrt{W^2 - L^2}}{|W|}}\right) \tag{3}$$

and where *F*(Θ,*m*) and *E*(Θ,*m*) are incomplete elliptic integrals of the first and second kind [37].

$$V\_{M1} = \frac{\pi \cdot T \cdot \mathcal{W} \cdot L}{6} \tag{4}$$

spheroid model (M2), when: *<sup>L</sup>* <sup>2</sup> <sup>&</sup>gt; *dz* <sup>2</sup> , then:

$$A\_{M2} = 2 \cdot \pi \cdot \left(\frac{d\_z}{2}\right)^2 \cdot \left(1 + \frac{\frac{l}{2}}{\frac{d\_z}{2} \cdot \varepsilon} \cdot \arcsin(\varepsilon)\right) = \frac{4 \cdot \pi \cdot d\_z^2 + \pi \cdot L \cdot d\_z \cdot e \cdot \arcsin(\varepsilon)}{8} \tag{5}$$

where:

$$\varepsilon = \sqrt{1 - \frac{d\_z^2 \cdot L^2}{16}}\tag{6}$$

$$V\_{M2} = \frac{\pi \cdot d\_z^2 \cdot L}{6} \tag{7}$$

cylinder model (M3):

$$A\_{M3} = \pi \cdot d\_z \cdot L + 2 \cdot \pi \cdot \left(\frac{d\_z}{2}\right)^2\tag{8}$$

$$V\_{M3} = \frac{\pi \cdot d\_z^2 \cdot L}{4} \tag{9}$$

model combining a truncated cone and two hemispheres (M4)

$$A\_{M4} = \frac{\pi}{2} \cdot \left(d\_{z1}^2 + d\_{z2}^2\right) + \pi \cdot \sqrt{\left(\frac{d\_{z1}}{2}\right)^2 + L\_1^2} \cdot \left(\frac{d\_{z1}}{2} + \frac{d\_{z2}}{2}\right) \tag{10}$$

$$\mathcal{V}\_{M4} = \frac{\pi}{12} \cdot \left( d\_{z1}^3 + d\_{z2}^3 + L\_1 \cdot \left( d\_{z1}^2 + d\_{z1} \cdot d\_{z2} + d\_{z2}^2 \right) \right) \tag{11}$$

model combining a cylinder and two hemispheres (M5)

$$A\_{M5} = \pi \cdot d\_w \cdot \left(\frac{d\_w}{2} + \frac{d\_{\rm av}}{2} + L\_1\right) \tag{12}$$

$$V\_{M5} = \pi \cdot d\_w^2 \cdot \left(\frac{d\_w}{6} + \frac{L\_1}{4}\right) \tag{13}$$

model combining two truncated cones and two hemispheres (M6)

$$A\_{M6} = \frac{(\pi \cdot d\_{z1} + \pi \cdot d\_z) \cdot \sqrt{d\_{z1}^2 + L\_1^2} + 2 \cdot \pi \cdot d\_{z1}^2 + (\pi \cdot d\_{z2} + \pi \cdot d\_z) \cdot \sqrt{d\_{z2}^2 + L\_1^2} + 2 \cdot \pi \cdot d\_{z2}^2}{4} \tag{14}$$

$$V\_{M6} = \frac{2 \cdot \pi \cdot d\_{z2}^3 + \pi \cdot L\_1 \cdot d\_{z2}^2 + \pi \cdot L\_1 \cdot d\_z \cdot d\_{z2} + 2 \cdot \pi \cdot d\_{z1}^3 + \pi \cdot L\_1 \cdot d\_{z1}^2 + \pi \cdot L\_1 \cdot d\_z \cdot d\_{z1} + 2 \cdot \pi \cdot L\_1 \cdot d\_z^2}{24} \tag{15}$$

In models M2, M3, M4, M5 and M6, geometric mean diameter was calculated with the following formulas:

$$d\_w = \frac{W\_1 + W\_2 + T\_1 + T\_2}{4} \tag{16}$$

$$d\_z = \frac{\mathcal{W} + T}{2} \tag{17}$$

$$d\_{z1} = \frac{W\_1 + T\_1}{2} \tag{18}$$

$$d\_{z2} = \frac{W\_2 + T\_2}{2} \tag{19}$$

every cucumber fruit was weighed on the Radwag WAA 100/C/2 electronic scale to the nearest 0.001 g. The significance of differences between the mean values of the measured parameters was determined in the Kruskal-Wallis test with multiple comparisons of mean ranks. The aim of the analysis was to identify homogeneous groups. The results were processed statistically in the Statistica 13.3 PL program at a significance level of α = 0.05.

#### **3. Results and Discussion**

Cucumber fruits (*Cucumis sativus* L.) cv. *Sremski ´* are botanical berries with a more or less elongated shape, varied size, smooth or spiny skin. Cucumbers are filled with seeds, and their color ranges from dark green to yellow. At harvest maturity, cucumbers are cylindrical in shape, without a neck, with a gently tapering end at the flower base and a small seed chamber. The smallest of the examined cucumbers weighed 43.05 g, and the largest123.70 g. The surface area of cucumbers determined in the 3D scanner ranged from 74.84 cm<sup>2</sup> do 145.38 cm2, with an average of 111.25 cm2. Based on the generated 3D images, the volume of cucumbers was determined in the range of 46.65 cm3 to 127.38 cm3, with an average of 77.26 cm3 (Table 1). Exemplary 3D models of cucumber fruits are presented in Figures 3 and 4.


**Table 1.** Geometric parameters of cucumber fruits.

**Figure 3.** 3D model of a cucumber fruit with a texture overlay.

**Figure 4.** 3D model of a cucumber fruit represented by a triangle mesh.

The mean dimensions, surface area and volume of the analyzed cucumber fruits are presented in Table 1.

The significance of differences between the mean surface area and mean volume of cucumbers was determined in the Kruskal-Wallis nonparametric test. The significance of differences between the parameters acquired by 3D scanning and the parameters calculated with mathematical formulas is presented in Tables 2 and 3. The mean surface area of cucumber fruits calculated from the 3D model did not differ significantly from the mean surface area calculated from the spheroid model (M2—formula 5) and the model combining two truncated cones and two hemispheres with different diameters (M6—formula 14).

The mean volume of cucumber fruits calculated from the 3D model did not differ significantly from the mean volume calculated from the ellipsoid model (M1—formula 4), spheroid model (M2—formula 7) and the geometric model combining two truncated cones and two hemispheres with different diameters (M6—formula 15).



Values marked with the same letters in columns do not differ significantly; a,b,c,d (*p* ≤ 0.05).


Values marked with the same letters in columns do not differ significantly; a,b,c (*p* ≤ 0.05).

M6 50 9393.00 187.86 81.27 <sup>a</sup>

The distribution of surface area values computed from the 3D model and the proposed geometric models is presented in Figure 5. The distribution of volume values computed from the same models is presented in Figure 6.

**Figure 5.** Parameters of normal distribution of cucumber surface area.

**Figure 6.** Parameters of normal distribution of cucumber volume.

If we assume that fruit dimensions acquired from 3D scans are burdened by a small error, these parameters can be used as a reference to compare the results of caliper measurements and to describe the shape of cucumber fruits with selected geometric figures. The relative error between the values acquired from 3D scans and direct measurements was regarded as the error of the method. The data presented in Figure 7 indicate that the error in direct measurements of cucumber surface area was smallest for the model combining two truncated cones and two hemispheres with different diameters (M6) where it did not exceed 3%. The error was estimated at 5% when model M2 and formula 4 were used. The data presented in Figure 8 indicate that the error in direct measurements of cucumber volume was smallest for the ellipsoid model (M1), the spheroid model (M2), and the model combining two truncated cones and two hemispheres with different diameters (M6). The error did not exceed 6% when ellipsoids were used, and it was estimated at 6% when model M6 was used.

**Figure 7.** Relative error of cucumber surface area determined with geometric models and the 3D model.

**Figure 8.** Relative error of cucumber volume determined with geometric models and the 3D model.

The results of this study were compared with the findings of other authors. Zapotoczny (2002) investigated the geometrical parameters of greenhouse-grown cucumbers under laboratory conditions with the use of image analysis methods. The cited author analyzed 2D images of 27 greenhouse-grown cucumbers and determined their average length at 163.17 mm, average width at 32.00 mm, and average projected area at 51.20 cm2. The multiscale modeling approach deployed by Ho et al. (2013) supports the description of the phenomena occurring inside agricultural raw materials. Multiscale models consist of interconnected sub-models that describe the behavior of raw material in different spatial scales. This approach supports the prediction of processes and phenomena occurring inside raw materials. However, multiscale modeling is relatively complex, and not widely used. Rahmi and Ferruh (2009) described the applicability of 3D models for processing agricultural raw materials and for food production. The presented models were generated based on 3D scans of selected materials, including chicken egg, pear fruit, strawberry fruit, banana and apple. The authors modeled the cooling process in pear fruit and compared the results with experimental findings. Cucumber fruits have never been analyzed in studies on modeling and determination of geometrical parameters of agricultural raw materials.

#### **4. Conclusions**


**Author Contributions:** A.A. developed the concept and design of the study; A.A., P.M. and Z.K. conducted the experiments; A.A., Z.K., P.M. and E.S. contributed to the literature study; D.C., P.M., Z.K., A.A. and A.J.L. analyzed ´ the data and made final calculations; A.A., Z.K. and P.M. wrote the paper; A.A., P.M. and Z.K. critically revised it.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflict of interest.
