{'fraction_non_alphanumeric': 0.03427257935380563, 'fraction_numerical': 0.011725509439809913, 'mean_word_length': 4.805967911231069, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Automatic Recognition and Digital Documentation of Cultural Heritage Hemispherical Domes using Images

Advancements in optical metrology has enabled documentation of dense 3D point clouds of cultural heritage sites. For large scale and continuous digital documentation, processing of dense 3D point clouds becomes computationally cumbersome, and often requires additional hardware for data management, increasing the time cost, and complexity of projects. To this end, this manuscript presents an original approach to generate fast and reliable semantic digital models of heritage hemispherical domes using only two images. New closed formulations were derived to establish the relationships between spheres and their projected ellipses onto images, which fostered the development of a new automatic framework for as-built generation of spheres. The effectiveness of the proposed method was evaluated under both laboratory and real-world datasets. The results revealed that the proposed method achieved as-built modeling accuracy of around 6mm, while improving the computation time by a factor of 7, when compared to established point cloud processing methods.


Significance of digital documentation for heritage hemispherical domes
Hemispherical domes are common geometric elements found in the historical developments of many civilizations, including the Persians, Greeks, Romans, and Assyrians [12,34]. Figure 1a shows an artistic impression of typical hemispherical domes in urban developments pertaining to the surroundings of the central Iranian desert (Kavir) dating back to the medieval era. Such old cities still exist, accommodate a considerable population, and in some cases -due to their cultural and historical values as well as their urban planning and architectural aspects-are recognized as important cultural heritage sites by the UNESCO [39]. We have witnessed the destruction of such cultural heritage sites many times in history as a result of either natural disasters, such as the earthquake in Bam [3], or man-made disasters, such as wars. Let's assume that as a consequence of such disasters, the front part of the city is destroyed. If an up-to-date digital twin model [4,15] of these domes exists (Figure 1b), the destructed part can be revived and redeveloped to its original form -e.g., using a combination of computational topological optimization methods and lightweight spatial structure [26] construction techniques -as schematically depicted in Figure 1c. In fact, the lightweight reconstruction of the outer shell of heritage domes has also shown to be instrumental in minimizing long-term and excessive building settlements [11]. Hence, the first step to create a workable and up-to-date digital twin for sustainable and lightweight redevelopment is to propose a solution for frequent 3D as-built digital documentation of these domes, specifically the outer shell, which will be the primary focus of this study. The as-built 3D model together with the material properties (transfer and mechanical properties) and other relevant information can then be used to generate digital twins of these domes.

As-built digital documentation of hemispherical domes using point clouds
Recent advancements in photogrammetry [1,33], and laser scanning has enabled the collection of accurate 3dimensional (3D) point clouds of cultural heritage sites [28,30,38]. The coordinates of the points -and where appropriate color or intensity information-must then be utilized to detect and generate the semantic digital (a) (b) (c) models of these hemispherical domes [15,19,24,27]. Figure 2 illustrates a typical process for the semantic digital model generation of a hemispherical dome using a network of overlapping images [19]. To acquire the point cloud, a process, called structure-from-motion (SfM) [35], is commonly adopted. SfM starts by automatically detecting and matching scale-invariant features [14] between different images so as to determine the exterior orientation parameters (EOPs) of each image (position and orientations shown with red prisms in Figure 2a), along with the camera's interior orientation parameters (IOPs) [9]. The EOPs and IOPs from the SfM are then used to generate dense 3D point clouds (Figure 2b). The dense point clouds can of course also be acquired through other means, such as laser scanning. The points representing the hemispherical domes must then be segmented and modeled to generate the as-built digital model (red in Figure 2c) [19,24,27]. The latter can be performed either manually, or automatically. Manual processing of point clouds is time consuming [15] and subject to human-error [19,24,36]. Therefore, recent research has focused on the development of solutions to automatically process point clouds and generate semantic digital models. The latter is sometimes referred to as scan-to-building information model (BIM) in the construction and building informatics literature [5].
While much research has been successfully carried out to provide solutions for automatic generation of semantic as-built digital models from point clouds [15,18,24,31,32,36], the methods can become computationally expensive, the faster heuristic processing methods are typically biased to specific types of scenes or noise levels, and supervised learning methods require a large library of pre-classified point clouds [17,18,24]. As such, this manuscript formulates the scientific bases to propose a robust solution for as-built digital modeling of hemispherical domes at a fraction of the computation time of reliable point cloud processing methods using only one pair of images. The method is extendable to the detection and modeling of any spherical object, and consequentially can also be utilized for other important applications, such as calibration and metric scale definition of photogrammetric point clouds using spherical targets.

Manuscript objective and scope
The main research aim is to develop a solution for large-scale semantic 3D digital documentation and model generation of hemispherical domes. This study provides a simple, reliable, and computationally efficient original solution for detecting and semantic 3D modeling of these domes using only a pair of images. To this end, new methods were developed for: (i) closed formulation of the projection of spheres onto images; (ii) detection of spherical ellipses in images; (iii) matching of the detected ellipses between images; (iv) modeling of the parent sphere using the set of matched ellipses between the images; and (v) detection of the best pair of images from a network of overlapping images. The study does not consider the detection and digital modeling of nonhemispherical or geometrically damaged hemispherical domes.

Methodology
In this section, the proposed method to achieve the objectives outlined in Section 1.3 are presented. The section is divided into two sub-categories, namely, "closed formulation of sphere reconstruction in images", and "automatic as-build modeling of spherical structures". In the first sub-category, a set of closed formulations are derived to represent the relationships between spheres and the corresponding projected ellipse onto one image. Using these formulations, a set of mathematical corollaries and propositions are made to establish the necessary and sufficient conditions to reconstruct object space spheres using ellipses in images. These findings are then combined into an algorithm, which inputs matching ellipses from two or more images, to generate the as-built model of the parent spheres. The second sub-category focuses on the full automation of the as-built modeling process developed in the former sub-category using only a pair of images. As such, the newly developed process for the automatic detection and matching of spherical ellipses between images, along with the method of selection of the best pair of images is explained.

Closed formulation of sphere reconstruction in images
The projection of a sphere onto an image is an ellipse. This is since the sphere and the camera's center create a cone, whereby the cone's vertex and base are the camera center and locus of points tangential to the sphere, respectively. The intersection of this cone with the intersecting image plane forms an ellipse. To provide a visual perspective, Figure 3a depicts a typical sphere, the cone that is tangential to the sphere, the plane intersecting the cone and the projected ellipse. In this section, the goal is to establish the closed form relationships between the original sphere parameters (center and radius) and the projected ellipse parameters, given the camera projective matrix (IOPs and EOPs). The ellipse parameters = ( , , , ) are the center, semi-major length, semi-minor length, and the angle between the major axis and the horizontal axis [21].

Preliminaries: camera projective matrix
The camera projective matrix, , establishes the relationship between a point in space and its projection onto an image [9]. For the case shown in Figure 3b, the relationship between a point and its projection is = . In the camera coordinate frame, i.e., --, the relationship can be formulated using the camera's focal length, , and principal point, = � , � , as depicted in Figure 3b-right: where is referred to as the camera calibration matrix, representing the IOPs. If the world coordinate system is represented in the coordinate system of ′, where and ′ are separated by a rigid body transformation with rotation, , and translation, , the camera projective matrix changes to the general form of: = [ 3×3 | 3×1 ]. The camera coordinate frame is a coordinate system where the camera center, , is at the origin and the image plane's normal (principal axis) is parallel to the axis. To transform the world coordinate system to the camera coordinate frame, one must, hence, use the transformation matrix = � 0 � 1 �, representative of the EOPs. For ease of formulation and without loss of generality, the equations derived in the following are performed in the camera coordinate frame.

Projected ellipse parameters from original sphere
Using tangent balls [8], Dandelin showed that the intersection of a plane and a cone produces an ellipse. The centers of the two tangential Dendelin spheres (see Figure 3c), and the major axis of the generated ellipse, lie on a plane (∆ 1 2 ) whose normal vector is parallel to the minor axis of the ellipse. Figure 3c shows the arrangement of Figure 3a together with the Dandelin's spheres, projected onto the plane ∆ 1 2 . It can be observed that the line segment ���� passes through and the centers of the Dandelin spheres, 1 and 2 . The projection of the line segment ���� onto the image plane represents the major axis direction of the projected ellipse. This is since the projection of 1 and 2 onto the image plane are the two foci of the projected ellipse, 1 and 2 , respectively. By extension, the major axis also passes through the projection of the camera center, , onto the image plane, . Therefore, the camera's perspective center, , lies on the major axis of the projected ellipse. Using this information together with the formulations provided in Figure 3b and eq. 1, the direction of the major axis of the ellipse, ����⃗ , shown in Figure 3d, and the angle between the major axis and the horizontal axis, , are determined as follows: Image Plane : camera center : projected ellipse's center : camera's principal point : ellipse major points : tangents from to the sphere ( = 1,2) : projection of onto image plane : sphere center : major axis of ellipse : camera focal length : sphere radius : image plane normal where = ( , , ) is the center of the sphere in the camera's coordinate frame (Figure 3d). Using the major points, 1 and 2 , the semi-major length of the ellipse, , and the ellipse center, , are calculated as follows: Using the triangles ∆ 2 , and ∆ 1 , line segments Using the triangles ∆ 1 , and ∆ , together with eq. 2, the angles and , respectively, are calculated: Substituting eq. 5 into 4 and then into 3 will provide the following simplified formulas: The last consideration is the semi-minor length, which is derived directly from the formulations presented in [8] using the Dendelin spheres ( Figure 3c) as follows: From eq. 1, eq. 6 and eq. 7, one proposition and three corollaries are derived, which are explained in the following.

Proposition 1.
The coordinates of the center of one sphere in the camera coordinate system can be derived using a single image of the sphere from a calibrated camera up to an arbitrary scale factor.
Proof. Since the camera is assumed calibrated, the camera calibration parameters, , and are known. In practice, camera calibration can be performed using laboratory pre-calibration practices [20]. Since the projection of a sphere onto an image is an ellipse, a reliable method for ellipse detection from images [22] can be deployed to determine the ellipse's geometric parameters = ( , , , ). From eq. 7, the following relationships are derived: Substituting from eq. 8 into = ( , ) in eq. 6 provides: Therefore, , and can be determined as a function of , , and and linearly dependent on a scale factor equal to . Corollary 1. , and are derived in real-world scale if the real-world radius of the sphere is known.
Proof. The proof follows from the correlation of , and with, , in eq. 8 and eq. 9. Corollary 2. The radius of a sphere is determined using a single image of the sphere from a calibrated camera if and only if the distance of the center of the sphere, projected onto the image's principal axis in the camera's coordinate frame, , is known.
Proof. Re-arranging eq. 8 gives: Similarly, eq. 9 may also be used to estimate the radius of the sphere if either of , or in the camera's coordinate frame were known. The radii calculated using the latter formulations, however, become indeterminate when → or → . On the other hand, eq. 10 suggests that knowledge of provides the necessary and sufficient conditions to calculate the radius since the function is deterministic in ℝ 3 . Corollary 3. The 3D reconstruction of the centers of multiple spheres using a single image of the spheres from a calibrated camera is possible up to a similarity ambiguity (arbitrary scale) if and only if the real-world ratio between the radii of the spheres is known.
Proof. The proof follows from eq. 8 and eq. 9, where the center and radius are correlated; hence, in the case of ≥ 2 spheres, the center of the spheres can be determined with consistent scale (i.e., similarity reconstruction) if and only if − 1 unique real-world ratios between the spheres' radii are known a-priori.
Corollary 1 and Corollary 2 show that real-world information from either the radius or center of a sphere is required to recover the sphere's equation in the camera's coordinate frame using a single calibrated image. When only one sphere is present in the image's field of view, Proposition 1 suggests that the equation of one sphere is recoverable up to an arbitrary scale. For multiple spheres captured from a single image, however, Corollary 3 shows that the similarity reconstruction is only possible if the relative radii between the spheres in real-world are known a-priori. Ideally, automated digital documentation of spherical objects warrants a process that requires minimal a-priori knowledge from the real-world. In the following, the recovery of the sphere's equation using multiple image views without a-priori information is discussed.

Recovery of sphere equation in multi-view imagery
Given ≥ 2 images from a sphere, this sub-section provides a process to calculate the original sphere's center and radius up to a scale ambiguity. This is accomplished by, first, determining the projected sphere's center, , in each image independently, and second, triangulating [9] the ellipse centers to determine the 3D center of the sphere, . The calculated center of the sphere is then subjected to rigid body transformation to find the center in each image's coordinate frame. The latter transformed center is used within eq. 10 to calculate the radius of the sphere. In the presence of random measurement errors, the final radius -using least squares minimization-turns out to be the average of the radii obtained from each image.
The projected sphere's center in each image, , is calculated by substituting eq. 8 and eq. 9 into eq. 2, where is derived as the function of the projected ellipse parameters and the camera's IOPs as follows: Using at least two images of the sphere with known projective matrices -see eq. 1-the center of the sphere in world coordinates is determined up to a similarity ambiguity using triangulation [9]. Given that the equations provided in the previous sub-section were derived in the camera coordinate frame, the following rigid body transformation is applied to to derive the sphere's center in each image's coordinate frame: where , , and , are the projective matrix, rotation, and translation for image ( ∈ {1 … }), respectively, and = ( , , ) is the sphere's center in the coordinate frame of image . The radius in each image frame is then estimated using eq. 10: where is the semi-minor length of the ellipse corresponding to the sphere in image frame , and is the radius of the sphere using the projected ellipse in image frame . An over determined system of equations exists when more than one image frame is considered ( ≥ 2). In the absence of measurement errors, the radius of the sphere, , can be calculated deterministically using only one of the image frames via eq. 13. In the presence of random measurement errors, however, the optimal solution for the overdetermined system can be estimated using least squares adjustment, which becomes the average of the radii obtained from eq. 13: where ( ) is the least squares function, and ( ) represents the partial derivative of ( ) with respect to variable . In case each observation is assigned a different weight (e.g., weighted based on measurement precision of the estimated image EOPs), the solution to eq. 14 becomes the weighted average of the radii estimated from each image. The process is summarized in Algorithm 1.

ALGORITHM 1: Equation of Sphere from Multi-view Imagery
Inputs: Cameras' projective matrices ( ∈ 1 … ), best fit geometric parameters of the ellipse corresponding to the same sphere in each image, ( , , , , ) . Output: Parameters of the parent sphere: i.e., center, , and radius, . for each image in inputs, do calculate the projected center of the sphere in each image, , using eq. 11 end triangulate the centers, , using the camera's projective matrices to determine the center of the sphere, for each image in inputs, do calculate = ( , , ) by transforming to the camera's coordinate frame using eq. 12 calculate the radius of the parent sphere for image , , by substituting into eq. 13. end calculate the average of (eq. 14) to determine the radius of the parent sphere,

Metric scale definition using one sphere with known radius
Using Algorithm 1, the spheres' parameters (center and radius) are calculated up to a scale ambiguity. In case of multiple spheres, the scale remains consistent between different spheres, unlike the case with a single image (see Corollary 3). Hence, if the real-world radius of only one of the spheres in the scene is known a-priori, the equations of all spheres can be determined in real-world scale. This provides the opportunity to add as few as one spherical object (e.g., target) with a known radius into the scene to determine the equation of all spheres in real scale. In other words, if the real-world radius of the spherical object with 3D reconstructed radius of (from Algorithm 1) is , the metric scale factor becomes = . In case the ground truth radii of multiple spheres ( ≥ 2) are known, the scale in the over-determined system of equations -in terms of least-squares minimizationcan be calculated using the following equation, adopted from [10,24]: where and represent the real-world and estimated radius (Algorithm 1) for sphere . The metric scale, , can now be applied to both the centers and radii of the remaining spheres in the scene to determine the sphere's equations in real-world scale.
Algorithm 1 requires the knowledge of: (i) the cameras' projective matrices (i.e., the IOPs and EOPs); (ii) the ellipses corresponding to spheres in each image (spherical ellipses); and (iii) the matching of ellipses corresponding to the same sphere between images. In the following sections, the strategies to automatically derive each of the required inputs are discussed and treated.

Automatic as-built models of spherical structures
Given a set of ≥ 2 images acquired from a spherical structure, the proposed solution for automatic generation of as-built digital documentation using images consists of the following steps ( Figure 4): 1. Find the EOPs and IOPs of the images (Figure 4a). 2. Select the best pair amongst all images. 3. Detect the spherical ellipses in the image pair (Figure 4b). 4. Match the corresponding ellipses (Figure 4c). 5. For each matched ellipse, perform Algorithm 1 to estimate the center and radius of the parent sphere (Figure 4d). Here, the proposed solution is designed to only use two out of images. It is also possible to use all images to reconstruct the sphere; however, this requires ellipse detection and matching between all images, which may become time consuming for larger number of images (as will be discussed in Section 4.1). Each step is explained in more detail in the following.

Deriving Camera EOPs and IOPs
Given a set of overlapping images subjected to rigid body motion (rotation and translation), the sequential SfM process is commonly adopted to automatically estimate both the EOPs and IOPs of the images (Figure 2a and Figure 4a) [2,24]. In this study, COLMAP, a reliable and open-source sequential SfM software was used to perform the coarse reconstruction [35].

Selecting the best pair of images in the network
Two established metrics were utilized to select the best pair of images. The first is the average convergence angle between two images, , introduced in [35]. The second metric is the network overlap of an image, , introduced in [24]. Best practices suggest that both metrics must be as large as possible to provide accurate 3D reconstruction. To account for this, the objective function, , between images and is defined: where is the average of the convergence angle between two images and , is the maximum of the convergence angle between all pair of images, is the network overlap of image and is the maximum network overlap in all images. The pair of images achieving the maximum of are chosen as the best pair. Since the best practices also suggest that the average convergence angle between images must be greater than 20° [35], only pair of images with >20° will be considered.

Detecting spherical ellipses
Detecting spherical ellipses requires: (i) an efficient method for ellipse detection from images; and (ii) a reliable procedure for elimination of ellipses that do not represent projections of spherical objects. To detect ellipses from images, the robust ellipse detection method of [22] is utilized. To eliminate the unwanted ellipses (cyan coloured ellipses in Figure 4b), the relationship between the major and minor axis of the spherical ellipses, derived in Section 3.1.2, are exploited. This relationship can be derived in closed form by substituting eq. 8 and eq. 9 into eq. 6: Therefore, any ellipse which represents a projection of spheres onto an image must follow the relationship derived in eq. 17. In the absence of random measurement errors, the equality is exact. In practical settings with random measurement errors, however, a margin of error exists. This margin can, however, be analytically estimated to a first order error term using the law of variance propagation [13]. As such, for each detected ellipse the following equations are calculated: where is the Jacobian matrix of with respect to the relational variables, is the partial derivative of function with respect to variable , Σ is the covariance matrix of the variables, Σ and Σ are the covariance matrices of the best fit ellipse parameters ( , , , ), and IOPs ( , , ), respectively, and is the standard deviation of the defined function . For spherical ellipses, according to eq. 17, = 0. To accommodate for the random measurement errors, the following condition is used: In this study, = 2 is used to accommodate for 95% confidence under the normality assumption. To estimate in eq. 18, the covariance of the geometric parameters of the ellipse, Σ , are estimated using Algorithm 4 of [37], and the covariance of the camera's IOPs, Σ 3×3 , are derived from the bundle adjustment during the SfM process [20]. Here, since the IOPs are estimated within the SfM process (see Section 2.2.1) and the ellipse geometric parameters are estimated in each image independent from the IOPs, their variances are considered uncorrelated. The latter is represented by the zero matrices within Σ , eq. 18. The closed formulation for is provided in Appendix A.

Matching spherical ellipses
Once the spherical ellipses of the selected pair of images are automatically detected, the ellipses corresponding to the same sphere must be matched. Therefore, a two-step process is devised. For each ellipse in the first image, first, the ellipses in the second image, whose corrected center satisfy the epipolar [9] constraint are recognized. Here, the parameter-less epipolar constraint presented in Algorithm 2 (step 4) of [20] is adopted. The ellipse in the first image is then used together with each of the possible matching candidates from the second image to estimate the center and radius using Algorithm 1. The estimated sphere is then used within eq. 6 and eq. 7 to estimate the reprojected geometric parameters of the ellipses. The ellipse whose distance between the original ellipses and the corresponding reprojected geometric parameters are the smallest is considered as the matching spherical ellipse. The process is summarized in Algorithm 2.
ALGORITHM 2: Information Modeling of Spheres using Images Inputs: Set of overlaping images from spherical objects. Output: Radius and center of the parent spheres. perform structure-from-motion and calculations for each image = 1: in inputs, do determine scale invariant features using SIFT calculate the network overlap, end for images = 1: − 1 in inputs, do for images = 2: in inputs, do match determined features between images and perform sequential reconstruction and bundle adjustment and estimate the EOPs and IOPs calculate average convergence angle between the two images, calculate the objective function (eq. 16) end end find the two images, and which maximize in eq. 16 for each of the selected images and , do detect spherical ellipses using the robust ellipse detection and fitting method of [21,22] retain only ellipses satisfying the sphere condition of eq. 19 end for each ellipse in image , do for each ellipse in image , do estimate the radius and center of the hypothesized parent sphere using Algorithm 1 rotate the center of the estimated sphere into each images' coordinate frame using eq. 12 estimate the parameters of the reprojected ellipses from the sphere parameters using eq. 6 and eq. 7 calculate the distance between the parameters of the original ellipses from those of the reprojection select the matching ellipse as that obtaining the smallest ellipse parameter distance end end

Experimental design and calculation
Two sets of experiments under both laboratory and real-world conditions were designed. The first was the laboratory experiment, which investigated the effectiveness of the proposed method in detection and 3D modeling of spherical black and white targets. The second consisted of two sets of the real-world experiments, which verified the effectiveness of (i) the method for metric scale definition of photogrammetric point clouds of a heritage column; and (ii) as-built modeling of two separate heritage hemispherical domes. The summary of the designed experiments, along with the type of data and the experiment's purpose are given in Table 1. The data related to the experiments are also demonstrated in Figure 5 and will be explained in more detail in the following.

Method of validation of results
In each experiment, the effectiveness of the radius and center estimated using Algorithm 2 were compared to a ground truth. The following generic steps were taken for each experiment to validate the results: 1. Ground truth radius and center estimation: 1.1. Perform dense 3D reconstruction (Figure 2b) using COLMAP. 1.2. Detect the spherical objects from the 3D point clouds using the robust method of [23]. 2. Calculate the percentage of root mean squared error (P-RMSE) as follows: where is the root mean squared error between the estimated (Algorithm 2) vs. the ground truth of the sphere's parameters (radius and center), and is the ground truth radius. 1 The P-RMSE is adopted here to normalize the accuracy results for datasets with domes of different radii. 3. Compare the computation time between Algorithm 2 and the ground truth. Some of the experiments also contained specific steps for the analysis of the results which will be discussed in more detail in the following.

Laboratory experiment
The objective of this experiment was to validate the correctness of the method for sphere detection and modeling, presented in Algorithm 2, as the number of image views increased. For this, nine white spherical Styrofoam balls, attached onto a black cardboard background, were used as the subject of the experiment (Figure 5a-left). Thirty (30) 4K images using the iPhone 11 were acquired from the targets (Figure 5a-middle). The impact of increasing the number of images on the P-RMSE of the center and radius of the parent spheres was examined. Given that Algorithm 2 only considers the best pair of images, to accommodate for the increasing number of image views, the best pair is replaced by a random set of = 2 … 30 images using the following steps: 1. Calculate the number of simulations, = min (50, � 30 �).
2. Randomly select unique sets of images out of 30 images. 3. For each set of images, perform Algorithm 2. 4. Calculate the accuracy of the center and radius (P-RMSE; Section 4.1). 5. Record the mean, maximum and minimum of the P-RMSE of all sets of images.

Scale definition using spherical targets
The goal of this experiment was to verify the effectiveness of the proposed method for automatic metric scale definition of photogrammetric networks using spherical targets (Algorithm 2 together with Section 2.1.4). One dataset comprised of thirty (30) 4K iPhone 11 images were taken from one of the external columns of the Großherzogliche Grabkapelle cathedral in Karlsruhe, Germany. Two spherical Styrofoam balls similar to the previous laboratory experiment were used to define metric scale for the network. Using the estimated scale, the RMSE of the dimensions of the column in the photogrammetric point cloud with respect to the ground truth dimensions were reported, and the following steps were performed: 1. Ground truth pre-processing: 1.1. Perform the robust column detection of Maalek [25] on collected laser scanner point clouds, acquired using the Leica BLK360. The robust rectangular column of [25] is comprised of the robust planar classification and segmentation of Maalek [17], followed by a rule-based semantic column detection based on the direction of the majority columns' plane normal vectors. 1.2. Model the rectangular column [25], and record the planar patches for the three observable sides (cyan coloured patches in Figure 6b).

As-built modelling of hemispherical domes
Two datasets from hemispherical heritage domes were used in this study. The first dataset consisted of 100 4K images of the Orangerie in Karlsruhe, Germany (Figure 5c), acquired using the iPhone 11. The second dataset included 66 images taken from the Chunakhola Masjid in Bagerhat, Bangladesh (Figure 5d) using the DJI Phantom 4 Pro drone. The second dataset was collected by CyArk and is publicly available at the Open Heritage 3D project [6]. For both datasets, the P-RMSE and computation time using the best pair of images were reported.  Figure 7. First, Figure 7a shows that the accuracy of the estimated center and radius improved as the number of images increased. The uncertainty region between the minimum and maximum (confidence region) also reduced as the number of image views increased due to the improved redundancy and network geometry [16,20]. The second observation was that the parameter estimation error using the best pair was consistent with the expected value (average) of the errors obtained using eight image views. This particularly signifies the advantage of adopting the proposed best image pair selection criteria (eq. 16) compared to random sampling. The last observation was related to the average computation times shown in Figure 7b. It can be observed that the computation time increased as the number of image views increased. The best pair using Algorithm 2 achieved parameter estimation accuracy consistent with eight randomly selected image views, whereas the average computation time using eight image views was approximately 50 times that using two images.

Scale definition using spherical targets
In this experiment, the effectiveness of Algorithm 2 in modeling spherical targets for the purpose of metric scale definition in photogrammetric point clouds was examined. Two spherical black and white targets were used to first define the metric scale automatically. The scale was then used to calculate the RMSE of the heritage column of the Großherzogliche Grabkapelle cathedral in Karlsruhe, Germany. The results of the spherical ellipse detection and final modelling of the spherical targets using Algorithm 2 are shown in Figure 8a and Figure 6, respectively.
(a) (b) The targets are in two different sizes with real-world radii of 10cm and 6cm. Using eq. 15, the real-world radii and the radii obtained using Algorithm 2, the scale of the overdetermined set of radii was determined. The precision of the scale definition (the RMSE of the spheres' radii after applying the scale factor) was 0.03mm. As described in Section 3.3.1, the scale was applied to the whole point cloud and the RMSE of the point cloud to the automatically generated as-built model was calculated. The accuracy of the automatically generated as-built model (modelled as three planar surfaces as demonstrated in Figure 6) from the laser scanner was around 0.5mm. Figure 8b shows the heatmap of the distance of the scaled inlier photogrammetric point clouds to the asbuilt model of the heritage column. The RMSE of the photogrammetric point clouds from the model (the average of the distances observed in Figure 8b) was 3.1mm, which is consistent with the precision of photogrammetric measurements [24]. Figures 9 and 10 illustrate the results of the best selected pair of images along with the modeled sphere, corresponding to the hemispherical domes at the Orangerie (Karlsruhe), and Chunakhola Masjid (Bagerhat), respectively. The P-RMSE of the estimated spherical dome's parameters (compared to ground truth parameters) were 0.64% and 0.61% for the Orangerie and the Masjid, respectively. Consistent with the laboratory experiments, the results suggest that if the ground truth radius of the domes were 1m, the center and radius of the dome are estimated with 6.4mm and 6.1mm accuracy for the Orangerie and the Masjid, respectively.  Table 2 shows the results of the computation time using Algorithm 2 and the ground truth method (step 1 of Section 4.1). It can be observed that for both real-world hemispherical domes, Algorithm 2 was approximately 7 times faster. To provide some perspective, around 9 domes of the Orangerie in Karlsruhe can be automatically modelled in one day using Algorithm 2, whereas the same 9 domes will take approximately a week using the current best practices. We conclude that the proposed method is promising particularly for the large-scale monitoring and modeling of hemispherical domes.

Conclusions
A new method for detecting and automatic modeling of spherical objects, applicable to as-built model generation of hemispherical domes, was presented. To this end, the closed-form solutions to the projection of spherical objects onto perspective cameras were derived. Using these original formulations, the proposed method only required two images from a network of images to provide accurate parameter estimation of the parent sphere, while maintaining computational efficiency. The effectiveness of the proposed method was investigated under both laboratory and real-world conditions. It was observed that the proposed method, which uses a selection criterion to choose the best pair of images, performed as good as the case when eight random images were selected, while achieving around 50 times faster computation time.
In the real-world experiments, the proposed method for scale definition using spherical targets achieved an accuracy of 3.1mm (within the expected measurement uncertainty of the photogrammetric point clouds using smartphones), when compared to modeled heritage columns using laser scanner point clouds. In the digital modeling of spherical domes experiment, it was observed that the proposed method achieved consistent P-RMSE between both real-world and laboratory (0.62% on average). Furthermore, it was revealed that the real-world domes were processed approximately 7 times faster than the current best practice, which utilizes point cloud processing from dense 3D reconstructed point clouds. This latter is a difference between modeling several domes in one day vs. one week. This reduction of time is not only convenient for the timely accessibility of data for the project's stakeholders (e.g., the public, decision makers, ministries, and etc.), but it will also reduce costs and resources related to computational infrastructures (e.g., cloud computing services, servers, and etc.). We conclude that the proposed method provides a practical solution for the large-scale monitoring and digital documentation of spherical objects, such as hemispherical domes. The authors hope that the methodology and results presented (a) (b) in this study will encourage other researchers in the broader domain of construction informatics to search for alternative and simpler approaches to object detection and digital twin generation problems, before resorting to more advanced and computationally expensive point cloud processing methods.