{'fraction_non_alphanumeric': 0.03485716948599655, 'fraction_numerical': 0.011417121021482828, 'mean_word_length': 4.288319369147363, 'pattern_counts': {'":': 0, '<': 5, '<?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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Joint Point Cloud and Image Based Localization For Efficient Inspection in Mixed Reality

This paper introduces a method of structure inspection using mixed-reality headsets to reduce the human effort in reporting accurate inspection information such as fault locations in 3D coordinates. Prior to every inspection, the headset needs to be localized. While external pose estimation and fiducial marker based localization would require setup, maintenance, and manual calibration; marker-free self-localization can be achieved using the onboard depth sensor and camera. However, due to limited depth sensor range of portable mixed-reality headsets like Microsoft HoloLens, localization based on simple point cloud registration (sPCR) would require extensive mapping of the environment. Also, localization based on camera image would face the same issues as stereo ambiguities and hence depends on viewpoint. We thus introduce a novel approach to Joint Point Cloud and Image-based Localization (JPIL) for mixed-reality headsets that use visual cues and headset orientation to register small, partially overlapped point clouds and save significant manual labor and time in environment mapping. Our empirical results compared to sPCR show average 10 fold reduction of required overlap surface area that could potentially save on average 20 minutes per inspection. JPIL is not only restricted to inspection tasks but also can be essential in enabling intuitive human-robot interaction for spatial mapping and scene understanding in conjunction with other agents like autonomous robotic systems that are increasingly being deployed in outdoor environments for applications like structural inspection.


I. INTRODUCTION
The onset of portable mixed reality headsets like Google Glass and Microsoft HoloLens has enabled efficient human interactions with 3D information. These headsets are found to be suitable for on-site inspection [1], [2], due to their ability to visualize augmented geo-tagged holograms and measure 3D distances by virtue of gaze and gesture. Notably, before every inspection, the headset needs to be localized, preferably with onboard sensors, to establish a common frame of reference for 3D coordinates. As spatial mapping and understanding is key to mixed-reality, we can safely assume that the primary sensors would include at least a depth sensor and a camera. However, due to low form factor and portability, these sensors have limited range. Given a prior 3D model of the structure as a template, existing methods for simple point cloud registration (sPCR) [3], [4] can be employed on a spatial map generated on-site by the headset. These methods, however, require significant  overlap between the point clouds and thus would require the user to sufficiently map the structure on the order of 300m 2 surface area. Conversely, camera pose estimation using 3D-2D correspondences [5] lacks desired precision and depends on viewpoint due to stereo ambiguities.
In this paper, we introduce an efficient approach to Joint Point Cloud and Image-based Localization (JPIL) for marker-free self-localization of mixed-reality headsets that requires minimum on-site mapping time. JPIL can successfully register spatial map with significantly low overlap with a prior 3D model by combining additional information from camera image and headset orientation, which is simply available from the onboard camera, IMU and magnetometer sensors. Interestingly, it simplifies the problem to an extent that is critical for operation in symmetric environments. A small spatial map might resemble multiple structures on the prior 3D model, thus, a camera pose estimation (CPE) problem is solved, as a function of point cloud registration to differentiate between multiple candidates. The resulting localization accuracy is similar, albeit at significantly lower point cloud overlap. The contributions of this paper are: 1) We contribute a JPIL method (Section V) to use spatial map (Section III), camera image (Section IV) and headset orientation to localize mixed-reality headset with minimum mapping time.
2) A modified binary shape context based 3D point cloud descriptor with an efficient multiple-candidate descriptor matching algorithm (Section III-B). 3) We empirically show that JPIL method results in the successful registration of point clouds with overlap as low as 10m 2 and average 10 fold reduction in required surface area.
Finally, we provide software implementation 1 and hardware verification on a Microsoft HoloLens.

II. DIGITAL MODEL AND SETUP
A common frame of reference is required to report 3D coordinates that can be persistently used across multiple inspection sessions. While a global positioning system (e.g., GPS) can be used, instead, we use a digital 3D model (Fig. 2) M of the structure and report all 3D coordinates in its reference frame R. M has to be real scale and can be a partial or full representation of the structure. The source for M can be a computer-aided model or a map generated by other 3D reconstruction methods such as [6], [7]. If M of a structure does not exist prior to its inspection, then the user can scan the structure to build a map that can be used as M in future inspections. We choose a 3D triangular mesh as the format for M as ray casting on a mesh for measurement is accurate and computationally cheap due to the surface representation. In most cases, a mixed-reality headset would setup up a local frame of reference R and an arbitrarily defined origin x 0 for its operation. Let M define the triangle mesh generated by spatial mapping. Orientation q is estimated in Easting, Northing and Elevation (ENU) geographic Cartesian frame from the IMU and magnetometer for both the models. The models are thus aligned with the ENU frame.
Localization of the headset has to be performed only once per inspection session, where a transformation is established between R and R . Headset pose x t w.r.t R at time t is tracked by the headset itself. A normal inspection procedure under the proposed method would be to first map a small (∼ 5m 2 ) structural surface M and initiate JPIL with (M, M , x t , q t ), where t represents the time in that instance.

III. POINT CLOUD REGISTRATION
JPIL samples M and M meshes to generate corresponding point clouds for registration. Point cloud registration estimates a 4 × 4 transformation matrix A given M and M , such that M perfectly aligns with M when every point of M is transformed by A Fig. 3.
where p M i and p M i are corresponding points (homogeneous coordinates) in M and M respectively. A common framework consists of essentially the following steps: 1) Keypoint extraction, 2) Descriptor computation, 3) Descriptor matching, and 4) Transformation estimation. The models are aligned with ENU frame, thus, A will have negligible rotation component. We use binary shape context descriptor [8] for step 1 and 2 while we modify step 1 to incorporate the orientation information. The modified descriptor (tBSC) is now orientation specific. Finally, we propose an efficient algorithm for step 3 (subsection III-B). Thus, we discuss steps 1 and 3 in detail while briefly revising the other steps.

A. Keypoint extraction
Keypoint extraction complements the feature descriptors by providing points that are expected to have high feature descriptiveness and are robust to minor viewpoint changes. For each point p of a point cloud, we perform two separate eigenvalue decompositions on the covariance matrices M xy and M xyz .
The covariance matrices M xy and M xyz are constructed using p and its neighboring points within a supporting radius r (scale) , which is user defined. We used r (scale) = 0.4. The neighboring points q j (j = 1, 2, . . . , m) and p are denoted as N = {q 0 , q 1 , q 2 , . . . , q m }, where q 0 is the point p and m is the number of neighboring points. A new set of points N = {q 0 , q 1 , q 2 , . . . , q m } is generated from N with only the x and y component of those points. The covariance matrices M xyz and M xy are calculated as follows: The eigenvalues in decreasing order of magnitude {λ 1 , λ 2 , λ 3 } and {λ 1 , λ 2 }, along with the corresponding eigenvectors {e 1 , e 2 , e 3 } and {e 1 , e 2 } respectively, are computed by performing eigenvalue decompositions of M xyz and M xy respectively. Now, the point p is considered a keypoint if: • (λ 2 /λ 1 ) < k : Note, {λ 1 , λ 2 } are the eigenvalues computed from M xy , which in turn is formed from the 2D distribution of N in the x, y plane. This condition, thus, promotes points with well defined eigenvectors. • Highest curvature among its neighbors. The curvature c is defined by c = λ3 λ1+λ2+λ3 . For each keypoint, a local reference frame (LRF) is defined. An LRF imparts invariance in feature descriptors to rigid transformations. Descriptors are computed based on the LRFs, thus, it is critical for LRFs to be reproducible. In [8], the authors define an LRF by adopting p as the origin and e 1 , e 2 , e 1 × e 2 as the x-, y-, and z-axes, respectively, where × represents the cross product of vectors. However, the orientation of each eigenvector calculated by eigenvalue decomposition has a 180 • ambiguity. Therefore, there are two choices for the orientation of each axis and thus four possibilities for the LRF. They end up computing descriptors for all four possible LRFs and thus leading to reduced precision. This ambiguity is generally faced by all sPCR methods that use eigenvectors for LRF. In, contrast JPIL adoptsÊ,N ,Ê ×N as the x-, y-, and z-axes, respectively, whereÊ andN is a vector towards magnetic East and North respectively. Thus, the LRF is written as

B. Multiple Candidate Registration
Since, M would generally be very small as compared to M, the registration would have translational symmetry where desc is a user definable threshold. M contains set of matches that 1) belong to either one of the possible candidates, and 2) are outliers. We find a family of match sets O where a set represents a candidate. O is found based on geometric consistency with error margin of clust and clustering on M given by Algorithm 1. We used Subroutine RIGIDTRANSFORM(o) called by Algorithm 1 estimates the transformation matrix a from the corresponding 3D points using singular value decomposition. An alignment is evaluated based on how similar the two point clouds looks after alignment. M is transformed by a to get M a , and M is clipped to get M c using a box filter of dimension equivalent to the bounding box of M a . The idea is to compute two tBSC descriptors d 1 and d 2 , one each for M a and M c with radius equivalent to longest side of the bounding box, and keypoints p 1 and p 2 at the box centers respectively. Subroutine ALIGNCOST(a) return the alignment cost given by C desc (d 1 , d 2 ). 17: if e x + e y + ez < 3 × clust then return O, A, C

IV. IMAGE BASED CANDIDATE SELECTION
The motivation behind JPIL to use visual cues is the rich amount of information that is present in a single image. While the depth sensor on the headsets has a range of about 5m and about 70 • field of view (FOV), a spherical camera, can provide full 360 • horizontal and 180 • vertical field of view. Consider a particular candidate j: let its transformation matrix and alignment cost be a j and c j respectively. Since, the headset pose x t w.r.t M at time t is known (Section II). JPIL generates synthetic projection images I M t,j (q t , x t,j ) of M setting a virtual camera at position x t,j = a j × x t and headset orientation q t = {q Roll t , q Pitch t , q Yaw t } in ENU frame. If j is the correct candidate, then the camera image I t and synthetic image I M t,j should match better than those of the other candidates. Thus, implying x t,j to be the correct headset pose w.r.t R. We evaluate a match based on the distance metric described in Section IV-A.
We demonstrate JPIL with a spherical camera, however it is not a necessity. The user may use any camera with suitable FOV for their case. We however do recommend the use of spherical cameras as the localizability increases with FOV and we discuss the benefits of the same in the experiments.

A. 3D-2D Image Match Distance Metric
Given a 3D point cloud structure and a camera image, the estimation of the camera pose is a standard computer vision problem. We follow interesting articles [5], [9] from the literature that solves this problem. And use it as a framework to build upon our method that supports spherical image projection and a orientation constraint non-linear optimization for camera pose.
Since, I M t,j is generated by projecting M on a sphere, we can backtrack from a pixel coordinate (x, y) to the 3D points p x,y = f (I M t,j , x, y). The initial goal is to detect 2D-2D image correspondences between I M t,j and I t , and establish 3D-2D correspondences after backtracking from I M t,j Fig. 5. Let P x,y = {p|p = p x+ix,y+iy , i x ∈ [−n, n], i y ∈ [−n, n]} where n is kernel dimension. Standard deviation σ x,y = std(P x,y ). JPIL rejects a correspondence if σ x,y < σ , assuming the 3D point to be uncertain.
Let p k andp k be 3D point and image pixel respectively of k th correspondence. x t,j is the position of headset in M according to j th candidate. Using spherical projection, we can projectp k to a pointp s k on the projection sphere. Also, we can project every point p k to a point q α t − q < q α o < q α t + q where α is Roll, Pitch or Yaw angle and q is the allowed flexibility. We use Ceres solver [11] for the optimization. To evaluate the similarity of two images there are many distance metrics in the literature, like Hausdorff distance [12], photometric error [13] and homography consistent percentage inlier matches. Since, we have the 3D information of an image, we rather check for geometric consistency with the error in position given by C image :

B. Confident Positive Matches
The cost function C SnP is non-linear and due to noise in feature matching, the optimization might reach a false local minimum giving erroneous x o estimate. Therefore, C image metric is only good to determine if a match is confident positive L + given by: where + depends on the noise level and we used + = 1.5.

V. JOINT POINT CLOUD AND IMAGE BASED LOCALIZATION
To summarize, JPIL has as its inputs, a reference model M, a small 3D map of the structure scanned in the particular session M , headset position x t , headset orientation in ENU frame q t and spherical image I t at time t. The output of JPIL Algorithm 2 is A, the transformation of M to M, such that headset position x t = A × x t w.r.t R can be estimated. if L + (I t , I M t,j ) then 12: return A all [j] 13: i ← arg min(C) 14:

VI. EXPERIMENTAL RESULTS
We performed few experiments to evaluate the following: 1) Performance of CPE with orientation constraints and differentiability between candidates. 2) Tolerance of tBSC to error in orientation.
3) Relation of C image (I t , I M t,j ) to error in orientation and relative distance between the camera poses of the two images. 4) Relation of C image (I t , I M t,j ) to σ . 5) Reduction in minimum required surface area and mapping time. The experiments were performed on a Microsoft HoloLens headset with a Ricoh theta S 360 • camera Fig. 6. We used an off-board computer to process the data. The HoloLens uploaded M (∼ 10 MB), I t (∼ 700 kB for 1280 × 640 pixels), x t and q t to the server. M (∼ 1.2 GB) was already present in the server and an instance of JPIL was running to accept communication from the HoloLens and return back the transformation A. We used SPHORB [14] feature descriptors for the spherical images. We tested JPIL in real world as well as simulated environments. Real world data from HoloLens was collected from Charles Anderson bridge, Pittsburgh, PA, USA. We used a high precision Terrestrial Laser Scanner (TLS) to generate dense RGB M. The ground truth positions for the experiments were measured using a Electronic Distance Measuring (EDM) Survey equipment that can report the position of an EDM prism with millimeter accuracy. We manually calibrated the EDM measurement w.r.t R.
A. Performance of CPE with orientation constraints and differentiability between candidates.
The cost function (5) might have many local minimums due to erroneous feature matching that might get selected by RANSAC as inliers. We performed CPE for 22 image pairs with varying q and computed the average error and standard deviation for each q Fig. 7. We observed that errors increase drastically with q > 15 • as expected. We observed a slight decrease at q = 4 • , which can be credited to the flexibility that allowed optimization to minimize considering errors in q t estimate. We also evaluate how discriminative is CPE to candidate positions. We took a spherical image I t and generated multiple spherical images I M t at position with error increments of ±0.5m along the bridge. From Fig. 7 we observe that C image (I t , I M t,j ) becomes unstable with increasing error and thus the concept of confident positive matching works well to discriminate between candidates that are further away from nominal position. B. Tolerance of tBSC to error in orientation.
We added error in the orientation estimates along X, Y and Z axes individually in an increment of ±1 • . We, then performed tBSC registration and selected the candidate with transformation estimate closest to the ground truth transformation. The results in Fig. 8 shows a minimum tolerance of ±5 • for error within 0.6m. It indicates the rotation specificity of LRF as well as robustness to error in sensor values. C. Relation of C image (I t , I M t,j ) to error in orientation. I M t,j (q t , x t,j ) is generated as a function of (q t , x t,j ). We wanted to evaluate how error in CPE C image (I t , I M t,j ) is affected by error in q t . So, we added errors in q t = q t +q e and performed CPE for each pair of I t and I M t,j (q t +q e , x t,j ). We observe that CPE is tolerant to error in orientation estimates up to ±10 • Fig. 9. Fig. 10 shows an example synthetic spherical image and a heatmap visualization of σ x,y at each of its pixel. σ x,y gives the uncertainty measure of 3D-2D correspondence. Correspondences with high σ x,y value might result in more erroneous CPE, while a generous threshold would promote the number of inliers the can constrain the camera pose. We performed CPE with varying σ on an image pair. From Fig. 11 we can observe that the variance of C image (I t , I M t,j ) certainly increases, however relative number of inliers increase too.   JPIL is targeted towards enabling accurate localization for very low overlap point clouds that requires significantly less user time. In sPCR, a user would need to walk on-site while mapping the structure to build a sufficiently large map. We simulated random walks in the vicinity of point clouds generated by the HoloLens. As the walk distance increased, more parts of the HoloLens point cloud were included for registration. We wanted to evaluate tBSC and BSC as a function of surface area mapped. Thus, we generated a cumulative density function of minimum surface area required by these methods for successful localization on 15 real datasets Fig. 12. We observe an average reduction of 10 times the surface area required by sPCR. For one dataset, we achieved a reduction from 465.50m 2 to 13.226m 2 and the time difference was ∼ 20 minutes. Finally, performing JPIL over 12 datasets with EDM ground truth, we observe an average accuracy of 0.28m for tBSC registration and 1.21m for CPE Fig. 13. The surface area was calculated by remeshing the point clouds and summing up the area of each triangle. The surface also included parts of the environment other than the structure, thus the required surface area in practice would be less than the values shown.

VII. RELATED WORKS
While we have covered the related works in the above text, here we emphasize on few other point cloud registration methods that uses visual cues. Dold [15] uses planar patches from image data to refine a point cloud registration whereas Men et al. [16] uses hue as fourth dimension (x,y,z,hue) and search for correspondence in 4D space. Similarly, authors of [17], [18] use 2D image features in a tightly coupled framework to direct point cloud registration. These requires accurate calibration between the Lidar scans and camera images and work well for dominantly planer structures without stereo ambiguities. When accounted for errors in sensor calibration, stereo ambiguities and complex 3D environments, local image features tend to fail and thus decrease the robustness due to the their tightly coupled nature.

VIII. CONCLUSION AND FUTURE WORK
We have presented a marker-free self-localization method for mixed-reality headsets and emphasized that data from three onboard sensors: a depth sensor, a camera and an IMU unit are critical for efficient localization. Our method is robust against errors in orientation estimation unto ±5 • , which is generous for most sensors. Localization accuracy of 0.28m, is comparable to that of sPCR while requiring 10 fold less surface area on average. Our method does not evaluate the user's selection of M . Practically, the user should generate M from well defined structures with minimum symmetry, and which also exists in M. In future, we would like to explore the 3D information from time series image data to further enhance the efficiency and robustness of this method.