# An Algorithm for Obtaining 3D Egg Models from Visual Images
## 4 Results and Discussion
It can be assumed that for different  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Stage** & **Description** & **Pseudocode** \\ \hline A & Loading an image & i = imread(img) \\ \hline B & RGB-HSV conversion & i1 = rgb2 hsv(i) \\ \hline C & Extract the S (HSV) & i2 = i1(:,:,2) \\  & color component & \\ \hline D & Balck and white conversion & i3 = im2 bw(i2,0.8) \\ \hline E & Remove holes in the image & i3 = imfill(i3, holes’) \\ \hline F & Filtering an image with a ’Disk’ & h = fspecial’(disk’, 5); \\  & type filter & i3 = imfilter(i3,h) \\ \hline G & Obtain basic egg sizes (object in image) and coordinates of & c = regionprops(i3,’all’); \\  & mass center & D = cat(1, c.MajorAxisLength); \\ \hline  & & d1 = cat(1, c.MinorAxisLength); \\  & & cc = cat(1, c.Centroid) \\ \hline H & Determination of h1, h2, \(\alpha\), \(\beta\) & h1 = sqrt(abs(d1.2-rxl.1)2)))))))))))))))))))))))(((((((h2 species of birds, it would be more appropriate to apply a model for spherical eggs and those with a more rounded shape. Moreover, the ovoid model would be appropriate if the eggs examined are more conical. Figure 4 shows the images of eggs from three bird species and their 3D forms. The filled contour of the egg obtained by an image processing algorithm and the contour described by a model is visualized. The small axis, large axis, perimeter, and area of the egg were determined. The deviation from the dimensions of the major and minor axes measured with a caliper and the proposed algorithm was 0.5-1.5 mm. Figure 5 shows the basic forms of eggs and those of sparrow, mallard, quail. The data presented are for the function \(c=f(\beta/\alpha)\). It can be seen that the coefficient '\(c\)' can be used to distinguish eggs from the three species of birds tested. Clearly distinguished are eggs from Mallard, which have a tendency to be elpesoid. Sparrow and quail eggs are close in value \((\beta/\alpha)\), but differ by a factor of '\(c\)'. When analyzing the residuals, there is a lack of systematic deviation of the actual data from the theoretical data, which is a sign of their normal distribution. Residuals analysis shows that the model is adequate. The analysis of the standardized coefficients shows that the relationship between angles \(\alpha\) and \(\beta\) influence in predicting the '\(c\)' coefficient. The coefficient of the determination of the proposed model  
Figure 4: (a) Sparrow, (b) mallard, and (c) quail eggs and their 3D forms. Figure 3: Basic 3D egg shapes. is \(R^{2}=0.96\). The standard error is SE = 0.08. All of the results show \(p\)-value of the model, less than \(\alpha=0.05\). It can be considered that the prerequisites of the regression analysis are fulfilled. The proposed algorithm was applied to create 3D egg shapes that were not used in the previous calculations. The resulting error was up to 9%. This shows that in the test, the algorithm had an accuracy of 91%. The results obtained in this paper improve the assumption of [PERSON] et al. [10] that the use of algorithms to determine the shape of eggs strongly depends on those of the bird species studied. Mallard eggs have a more elliptical shape and correspondingly lower values of coefficient '\(c\)' (\(c\) = 1.55-4.96). In sparrow eggs (\(c\) = 9.55-11.19) and quail (\(c\) = 11.71-13.11), the form tends to ovoid. In the present work it is proven that the proposed methods and algorithm for 3D geometric transformations of color digital images of eggs is suitable for application in technical systems, because the accuracy is above 90%. It can be assumed that for different bird species, the correction factor '\(c\)' may not correspond to the values indicated in this paper. This may be due to defects in the shell of the egg, abnormal shape, or immature eggs. An advantage of the algorithm proposed here is that the human operator does not need to select points in the image, as is the case with some of the algorithms developed so far [4; 7]. The problem with the orientation of the egg in the image remains unresolved. This problem was pointed out by [PERSON] et al.