Comprehensive Characterization of Date Palm Fruit ‘Mejhoul’ ( Phoenix dactylifera L.) Using Image Analysis and Quality Attribute Measurements

: An in-depth determination of date fruit properties belonging to a given variety can have an impact on their consumption, processing, and storage. The objective of this study was to characterize date fruits of the ‘Mejhoul’ variety using (i) objective and non-destructive image-analysis features and (ii) measurements of physicochemical parameters. Based on images acquired using a digital camera, more than 1600 texture parameters from the individual color channels L , a , b , R , G , B , X , Y , and Z , and 40 geometric characteristics (including linear dimensions and shape factors for each fruit), were determined. Additionally, pomological features, water content, water activity, color parameters ( L* , a* , b* ), total soluble solids (TSS), reducing sugars, and total sugars were measured. As a main result, the application of machine vision allowed for the correct detection of ‘Mejhoul’ dates and the determination of the image features. The differences in the values of the histogram’s mean (HMean texture) for individual color channels were determined. The ‘Mejhoul’ date fruit images in color channel a (aHMean equal to 145.88) and color channel b (bHMean: 145.49) were the brightest, and in channel Z they were the darkest (ZHMean: 4.23). Due to the determination of the elliptic shape factor ( W 1 ) of 1.000 and the circular shape factor ( W 2 ) of 0.110, the elliptical shape of the fruit was conﬁrmed. On the other hand, ‘Mejhoul’ dates were characterized by a length of 47.3 mm, a diameter of 26.4 mm, ﬂesh thickness of 6.25 mm, total soluble solids of 62.1%, water content of 28.0%, water activity of 0.652, hardness of 694 g, reducing sugars of 13.8%, and total sugars of 58.8%. Due to the determination of many image features and other parameters, this paper presents the ﬁrst comprehensive characterization of ‘Mejhoul’ date fruits using a non-destructive imaging technique linked to some physicochemical quality attributes.


Introduction
The date palm (Phoenix dactylifera L.) is one of the most valuable domesticated fruit trees because of its ritual significance in human societies, health benefits, productive capacity, and range of subsistence products from its fruits and other parts of the large palm [1].The size of the date crop is increasing rapidly throughout the world, and the production of date fruits was about 9.5 million tons in 2020 [2].Date fruits are rich with numerous therapeutic bioactive and functional compounds such as polyphenols, dietary fiber, carotenoids, vitamins, amino acids, carbohydrates, and mineral elements, making them one of the most nourishing natural foods [3,4].
The determination and evaluation of date-fruit quality can be based on microstructural properties [5]; biochemical parameters such as water content; total soluble solids; reducingsugar content; phenolic content; organic compounds; and water activity [6], and on the basis of textural parameters.Moreover, deep learning and traditional computer vision are used actually to evaluate the quality of fresh, stored, and dried fruit and vegetables.
The optical, textural, and geometric parameters, including linear dimensions and shape factors, can be determined using image analysis [7,8].Non-destructive measurements and fast image processing allow for the extraction of useful image features for building objective models for the discrimination of samples and the evaluation of object quality using machine learning [7,9].It can be of great practical importance for varietal discrimination, the detection of species, disease, or the evaluation of plant quality [10].Features determined using image analysis can be useful to evaluate fruit quality.Color properties computed from images were used to differentiate varieties, sort and grade date fruits, and distinguish between acceptable and damaged or immature fruits [11,12].Date fruit color, as well as texture, shape, and size extracted from images, were used for fruit classification based on ripeness [13].The physical (e.g., dimensions, shape, texture, seed/weight ratios, total color changes, total soluble solids, and firmness), nutritional (e.g., total phenolic content, glucose and fructose content, and DPPH antiradical activity), biological (nitric oxide (NO) scavenging, NO inhibition), and microbial (e.g., total viable count) parameters are considered as quality attributes of date fruit [14,15].The physicochemical properties, such as moisture content, dimensions, weight, volume, tannin content, total soluble solids, and reducing sugars can be a determinant of date-fruit maturity.However, some changes may be not statistically significant important [16].It was also reported that moisture, sugar, and ash content may be commercially important varietal characteristics of date fruit [17].Differences in the properties of date fruits of individual varieties may also affect the quality and physicochemical parameters of their products [18,19].Therefore, an in-depth determination of the properties of a given variety can have an impact on the consumption and processing of date fruits.
Thus, this research aimed to use an innovative approach, based on objective nondestructive image analysis, for a more comprehensive characterization of date fruit of the 'Mejhoul' variety.The characterization of date fruit involved the determination of more than 1600 textures of images from different color channels R, G, B, L, a, b, X, Y, Z, and 40 geometric parameters, including linear dimensions and shape factors.Additionally, water content, water activity, color, and chemical properties were determined.Due to such a large number of features, this is the first extensive report on the 'Mejhoul' date-fruit variety that uses a novel approach based on image analysis for determining the quality attributes of this noble variety.The scope of the study exceeds the information on the 'Mejhoul' variety available in the literature.By applying a non-destructive, fast, inexpensive, and objective approach to the in-depth characterization of date palm fruit 'Mejhoul', the study makes a huge contribution to fruit-quality monitoring.The simultaneous determination of the image features and the quality attribute determined by other methods provides the opportunity to develop models for estimating the physicochemical features of the fruit based on the image parameters, which will be a unique value for assessing the quality of the 'Mejhoul' variety.

Materials
Samples of the 'Mejhoul' date-fruit variety were collected, at the Tamar stage of maturity, from a well-known cold unit in the Southern east of Morocco.Date-fruit samples were collected randomly with no preference with regard to size, color, appearance, or firmness.The collected fruits were cleaned and then placed into aerated cartons and left at +4 • C for 24 h at the Laboratory of Food Technology of the Regional Center of Agricultural Research of Errachidia, Morocco.

Image Analysis
Ninety mature fruits were subjected to imaging.The images were obtained using a cell phone camera (Samsung Galaxy S10+, Samsung Group, Suwon, Republic of Korea) with Optical Zoom, f/1.9 aperture, optical image stabilization, and a flash as a light source.The distance of a cell phone camera from the date palm fruit samples was 300 mm.The imaging was carried out using a white background.Five images, with eighteen fruits in each one, were acquired.The images were characterized by the resolution (pixels) of 2200 × 3300.In total, the images of ninety 'Mejhoul' date fruits were used for processing to calculate geometric features, including linear dimensions, shape factors, and texture parameters from the individual color channels as numerical data from fruit images [7,20].The first step included image conversion to the BMP format, changing the background to black, and the segmentation of each image to separate individual fruit from the black background and overlaid regions of interest (ROIs).The brightness threshold was applied for the image segmentation into the black background with a pixel brightness intensity of 0 and lighter date palm fruits characterized by a brightness intensity greater than 0. Image processing and feature extraction (segmentation, ROI determination, texture, and geometric parameters computation) were carried out using Mazda software (Łódź University of Technology, Institute of Electronics, Poland) [21][22][23].The sample image, including date fruits with overlaid ROIs, is presented in Figure 1.

Image Analysis
Ninety mature fruits were subjected to imaging.The images were obtained using a cell phone camera (Samsung Galaxy S10+, Samsung Group, Suwon, Republic of Korea) with Optical Zoom, f/1.9 aperture, optical image stabilization, and a flash as a light source.The distance of a cell phone camera from the date palm fruit samples was 300 mm.The imaging was carried out using a white background.Five images, with eighteen fruits in each one, were acquired.The images were characterized by the resolution (pixels) of 2200 x 3300.In total, the images of ninety 'Mejhoul' date fruits were used for processing to calculate geometric features, including linear dimensions, shape factors, and texture parameters from the individual color channels as numerical data from fruit images [7,20].The first step included image conversion to the BMP format, changing the background to black, and the segmentation of each image to separate individual fruit from the black background and overlaid regions of interest (ROIs).The brightness threshold was applied for the image segmentation into the black background with a pixel brightness intensity of 0 and lighter date palm fruits characterized by a brightness intensity greater than 0. Image processing and feature extraction (segmentation, ROI determination, texture, and geometric parameters computation) were carried out using Mazda software (Łódź University of Technology, Institute of Electronics, Poland) [21][22][23].The sample image, including date fruits with overlaid ROIs, is presented in Figure 1.color channels are shown in Figure 2.For each ROI considered as a whole surface of date fruit, 1629 image textures were determined, including 181 textures for each of the 9 color channels.Textures were computed based on the histogram (9 texture parameters), co-occurrence matrix (132 texture parameters), gradient map (5 texture parameters), Haar wavelet transform (10 texture parameters), run-length matrix (20 texture parameters), and autoregressive model (5 texture parameters) [21].

Geometric Features
Forty-three geometric features, including linear dimensions and shape factors, were computed for each date palm fruit 'Mejhoul'.The calibration was performed using a caliper.The determined linear dimensions included the minimal Feret diameter (Fmin); the maximal Feret diameter (Fmax); the horizontal Feret diameter (Fh); the vertical Feret diameter (Fv); the total object-specific area (Ft); the length of the skeletonized object (Lsz); the

Determination of Physicochemical Properties
The measurements of total soluble solids (TSS), water activity (aw), and moisture content (%) were carried out according to AOAC analysis methods in triplicate [24].
For Hunter lab color (L*, a*, and b*), two readings per fruit were taken on opposite checks of the date palm using a Hunter Lab portable spectrophotometer (Mini Scan EZ 4500, Reston, VA, USA).
A texture analysis was performed at room temperature, using a CT3 Brookfield texture analyzer (AMETEK, Middleborough, MA, USA) equipped with a puncture probe characterized by a diameter equal to 7 mm.A compression test with a 5 mm target value was selected, and the moving speed of the probe was 0.5 mm/s.Maximum forces (N) during the punching were determined as the firmness of the date texture [25].Ten fruits of the 'Mejhoul' variety were used to measure both color and texture as outlined by Hazbavi et al. [25].
For pomological features, twenty date fruits were selected randomly, and each fruit, representing one replicate, was subjected to physical measurements.The length and diameter of the 'Mejhoul' fruits were recorded, and then a micrometer caliper was used to measure the flesh thickness [26].
The measurements of the reducing sugars and total sugars were performed as described by Houmy et al. [27].

Statistical Analysis
The mean values and standard errors of the selected image texture parameters from each color channel, as well as the linear dimensions and shape factors, were computed using the STATISTICA (StatSoft Inc., Tulsa, OK, USA) software.Additionally, the STATISTICA was used to determine the surface chart 3W of the textures.The charts were created for three textures from the color space RGB, three textures from the color space Lab, and three textures from the color space XYZ.

Image Parameters of 'Mejhoul' Date Fruits
The values of the histogram's mean (HMean) for individual color channels L, a, b, R, G, B, X, Y, and Z are presented in Table 1.It was found that there are differences in values of HMean texture depending on the color channel.The highest values were observed for channels a (145.88) and b (145.49).The images in Figure 2 confirm that the 'Mejhoul' date fruits in these channels are the brightest, whereas the lowest values of HMean (4.23) and at the same time the dark images of date fruits were observed in the case of channel Z (Figure 2).The surface chart 3W of three textures from the color space RGB (Figure 3a), three textures from the color space Lab (Figure 3b), and three textures from the color space XYZ (Figure 3c) is presented.The values of linear dimensions of 'Mejhoul' date fruit are presented in Table 2, and the shape factors are presented in Table 3.The 'Mejhoul' fruit was characterized by a mean object-specific area of 1402.63 mm 2 .The elliptic shape factor (W1) was equal to 1.00, and the circular shape factor (W2) was 0.110, which indicated the elliptical shape of the fruit.The values of linear dimensions of 'Mejhoul' date fruit are presented in Table 2, and the shape factors are presented in Table 3.The 'Mejhoul' fruit was characterized by a mean object-specific area of 1402.63 mm 2 .The elliptic shape factor (W 1 ) was equal to 1.00, and the circular shape factor (W 2 ) was 0.110, which indicated the elliptical shape of the fruit.)); W 13 -roundness (S max /F); W 14 -roundness (F/S max 3 ); W 15 -roundness (4F/(π S min S max )); SigR-standard deviation of all radii; R H -Haralick ratio; R B -Blair-Bliss ratio; R M -Malinowska ratio; R F -Feret ratio (F h /F v ); R Ff -Feret ratio (F max /F min ); R c -circularity (R c1 /R c2 ); R c1 -circularity (2 √ (F/π)); R c2 -circularity (U g /π); S max -maximal diameter; and S min -minimal diameter.

Pomological, Rheological, and Biochemical Quality of 'Mejhoul' Date Fruits
The pomological, rheological, and biochemical characteristics of 'Mejhoul' fresh dates are presented in Table 4.As shown in Table 4, the pomological parameters of the 'Mejhoul' date fruits are about 47.3 mm, 26.4 mm, and 6.25 mm for length, diameter, and flesh thickness, respectively.These values are higher than the other date-fruit varieties and -cultivars grown in Algeria [28] and Tunisia [29].However, the pomological characteristics found in this study are similar to those reported by Noutfia et al. [6] for 'Mejhoul' variety.
For TSS content, an average of 62.1% was noticed for 'Mejhoul'.For the same variety, this value was slightly higher than that reported (58.5%) by Noutfia et al. [6] but similar to the average (about 62%) reported by Harrak et al. [30].These differences can be attributed to the harvest stage and cultivation region.
In the case of water content and water activity, this study showed a respective average of 28% and 0.652 for 'Mejhoul'.Regarding water content, the obtained value was in conformity with that mentioned by Harrak et al. [30] but higher than those reported by Al-Harrasi et al. [31] for 22 date-palm (Phoenix dactylifera) varieties growing in the Sultanate of Oman, which ranged from 13 to 21%.For water activity (aw), a study performed on 11 date varieties of Morocco showed that aw content ranged from 0.55 to 0.84 for all of the varieties and from 0.61 to 0.71 for 'Mejhoul', which is almost similar to our results [32].
For color, expressed in the scale of L* (lightness), a* (redness), and b* (yellowness), the mean values obtained for 'Mejhoul' in this study were, respectively, 30.8, 10.8, and 9.58.These results are comparable to the reported variation in the color of several date varieties grown and/or commercialized in Emirates, Morocco, and USA [6,[33][34][35].The range of variation reported by these authors was 12-47 for L*, 1.35-15.3for a*, and 0.86-35.1 for b*.
Moreover, 'Mejhoul' hardness was about 694 g; such a value is higher than the range of 200-480 g reported by Kamal-Eldin et al. [36].This difference can be explained by the tissue structure, hardness of epicarp, and chemical composition of the date fruit, mainly the water content and the ratio of sucrose to reducing sugars.
The obtained results can be very important in assessing the quality of dates.In the present study, the application of machine vision allowed for the correct detection of 'Mejhoul' date fruit and the determination of the texture parameters and geometric features, including the linear dimensions and shape factors, in a fast, objective, and precise manner.The developed procedures can be of great practical application.Image features can be used to build models for the classification of fruit.The detection of fruits and their precise classification in terms of various aspects can contribute to the determination of their economic value.For example, fruit-classification systems can be useful for supporting the buying process by associating the fruit with its quality, dietary value, price, and other information and advice.The automated inspection allows for fruit classification; quality assurance; and the alleviation of bias, expense, and labor manual quantification [37].There are many types and varieties of dates with different shapes, colors, tastes, importance, and prices.A lot of consumers cannot distinguish date types.The implementation of an automated computer-vision-based date classification system may be extremely important for improving the entire date industry.Using imaging can eliminate the need for physical measurements or composition-based techniques in the quality-monitoring of dates [38].Using a machine-vision system date fruit can also be categorized in terms of the maturity stages.It is very useful in making decisions related to optimal harvesting time [39].Lee et al. [40] proposed an automated system for the evaluation of Medjool date maturity and surface-defect detection using color mapping.The systems using RGB images can be used to date fruit grade and sort based on external quality features such as size, shape, and defects [41].The Tamar stage (fully ripped and ready to be harvested and consumed) of a Medjool date was detected by Pérez-Pérez et al. [42].Besides fresh dates, imaging systems based on featured extracted from RGB images can also be used to classify processed, e.g., dried, fruit.This may be important for date-quality monitoring based on hardness [43].The image features of date fruit can also be used in practice to distinguish varieties [12] or estimate the sugar content of different date varieties [44].The Medjool variety was distinguished from others by Khayer et al. [45] based on image features.The authors reported a similarity (almost the same shape) of the Medjool variety to another one, which may cause a problem regarding consumers' buying dates.The results of previous own studies confirmed the possibility of the estimation of chemical properties of fruit and grain based on image texture parameters [46,47].Furthermore, the combination of image processing and machine learning can allow for the monitoring of fruit quality during storage [48,49] and the evaluation of plants grown under different conditions [50].The literature data indicate the possibility of using the results obtained with the use of image analysis and suggest new research directions.

Conclusions
This study is the first report on 'Mejhoul' date palm fruit using important image features with the highest discriminative power selected from such a large dataset.Thus, more than 1600 textures of 'Mejhoul' date images in different color channels L, a, b, R, G, B, X, Y, and Z, and 40 geometric parameters, including linear dimensions and shape factors, which are novelties for the characterization of the 'Mejhoul' variety, were determined.Using image analysis, among others, the values of texture parameters of fruit in the range of 4.23 for ZHMean to 145.88 for aHMean were determined, and the elliptical shape was confirmed by the elliptic shape factor (W 1 ) of 1.000.In addition, the physicochemical parameters of the date palm variety in Morocco were elucidated.
The developed procedures and the obtained results, especially for 'Mejhoul' image analysis, can be useful in practice for several purposes related to post-harvest treatment and for valorization issues.Further research will be focused on distinguishing 'Mejhoul' date fruit produced in several countries and from other varieties, linking the itinerary technique of this variety and its quality attributes, determining the date of harvest based on image features, determining changes in quality during storage and processing, and predicting the physicochemical parameters of fruit based on image features.

Figure 1 .
Figure 1.The original image of 'Mejhoul' date palm fruit (a) and image with overlaid regions of interest (ROIs) (b).

2. 2 . 1 .
Image Texture Parameters Before the texture-parameter computation, the date fruit images were converted to individual color channels L, a, b, R, G, B, X, Y, and Z.The sample fruit images in different

Figure 1 .
Figure 1.The original image of 'Mejhoul' date palm fruit (a) and image with overlaid regions of interest (ROIs) (b).

2. 2 . 1 .
Image Texture Parameters Before the texture-parameter computation, the date fruit images were converted to individual color channels L, a, b, R, G, B, X, Y, and Z.The sample fruit images in different color channels are shown in Figure 2.For each ROI considered as a whole surface of date fruit, 1629 image textures were determined, including 181 textures for each of the 9 color channels.Textures were computed based on the histogram (9 texture parameters), co-occurrence matrix (132 texture parameters), gradient map (5 texture parameters), Haar wavelet transform (10 texture parameters), run-length matrix (20 texture parameters), and autoregressive model (5 texture parameters) [21].

Table 1 .
Mean values of selected image texture parameters of 'Mejhoul' date fruit.

Table 1 .
Mean values of selected image texture parameters of 'Mejhoul' date fruit.

Table 2 .
Mean values of selected linear dimensions of 'Mejhoul' date fruit.

Table 2 .
Mean values of selected linear dimensions of 'Mejhoul' date fruit.F min -minimal Feret diameter; F max -maximal Feret diameter; F h -horizontal Feret diameter; F v -vertical Feret diameter; F t -total object-specific area; L sz -length of the skeletonized object; FE-area of circumscribing ellipse on the object; S pol -equivalent circular area diameter; U g -object-boundary-specific perimeter; U w -convex perimeter; Ul-profile-specific perimeter; M min -Martin's minimal radius; M max -Martin's maximal radius; D 1 -radius of circumscribing circle; D 2 -radius of circumscribing circle; and Fd 2 -area of circumscribing circle.

Table 3 .
Mean values of selected shape factors of 'Mejhoul' date fruit.

Table 4 .
Mean values of main quality parameters of 'Mejhoul' date fruit.