<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">3D Reconstruction of the Human Colon from Capsule Endoscope Video ⋆</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author role="corresp">
							<persName><forename type="first">Pål</forename><forename type="middle">Anders</forename><surname>Floor</surname></persName>
							<email>floor@ntnu.no</email>
							<affiliation key="aff0">
								<orgName type="department">Department of Computer Science</orgName>
								<orgName type="institution">Norwegian University of Science and Technology (NTNU)</orgName>
								<address>
									<addrLine>Teknologivegen 22</addrLine>
									<postCode>2815</postCode>
									<settlement>Gjøvik</settlement>
									<country key="NO">Norway</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Ivar</forename><surname>Farup</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Department of Computer Science</orgName>
								<orgName type="institution">Norwegian University of Science and Technology (NTNU)</orgName>
								<address>
									<addrLine>Teknologivegen 22</addrLine>
									<postCode>2815</postCode>
									<settlement>Gjøvik</settlement>
									<country key="NO">Norway</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Marius</forename><surname>Pedersen</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Department of Computer Science</orgName>
								<orgName type="institution">Norwegian University of Science and Technology (NTNU)</orgName>
								<address>
									<addrLine>Teknologivegen 22</addrLine>
									<postCode>2815</postCode>
									<settlement>Gjøvik</settlement>
									<country key="NO">Norway</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">3D Reconstruction of the Human Colon from Capsule Endoscope Video ⋆</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">13C9777B884007BD88CBC14597DEB339</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-23T19:50+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>3D reconstruction</term>
					<term>capsule endoscopy</term>
					<term>structure from motion</term>
					<term>SLAM</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>In this paper we investigate the possibility of constructing 3D models of longer sections of the human colon using image sequences obtained from wireless capsule endoscope (WCE) video to provide enhanced viewing for gastroenterologists. As images from WCE contain severe distortions and artifacts non-ideal for 3D reconstruction algorithms, the problem is difficult to attack. However, recent developments of virtual graphics-based models of human gastrointestinal system, where most of the distortions and artifacts can be enabled or disabled, makes it possible to determine how each factor disturbs such algorithms individually. In this paper we disable distortions and artifacts in order to determine if longer sections of the human intestinal environment is at all feasible to reconstruct. Though simulation we show that this is possible using structure from motion and simultaneous localization and mapping (SLAM).</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>Severe diseases in the gastrointestinal (GI) system like Chron's disease, inflammatory bowel disease, and cancer, are reducing many peoples quality of life. One way to detect such diseases at an early stage, making them more likely to combat, is to make screening of the GI system a common procedure beyond a certain age. However, fear of pain and difficulties caused by endoscopy is a major factor limiting the number of people screening themselves without clear symptoms <ref type="bibr" target="#b0">[1]</ref>.</p><p>The wireless capsule endoscope (WCE) <ref type="bibr" target="#b1">[2]</ref>, which is a pill-sized capsule that the patient swallows, is a good alternative for preventive screening, as it avoids the above mentioned problem and is capable of reaching all parts of the GI system. The WCE carries one-or several cameras on board, recording video while travelling through the GI system. However, current standard WCE's have significantly lower resolution and frame rate than typical endoscopes, and the images contain more severe noise and distortions. Further, the video is usually over eight hours long, making it challenging for gastroenterologists to detect pathologies in the intestinal wall. With increasing demand on intestinal screening, tools that make the gastroenterologists workload less demanding, and thereby reduces time-use per patient, are needed.</p><p>One method that can help gastroenterologists is a 3D model enhancing pathologies in the intestinal wall, making them easier to detect. A 3D model may also prove useful for planning of treatment. The inspiration for this approach comes from the positive feedback of using 3D reconstruction in gastrointestinal endoscopy <ref type="bibr" target="#b2">[3]</ref>. Currently, 3D models are obtained through CTscanning, which is expensive and may expose the patient to unnecessary radiation. Therefore, we will investigate the construction of 3D models based solely on WCE images.</p><p>There are at least two methods that may be applied in order to reconstruct the 3D structure of a scene based on WCE images: 1) Direct methods, like shape from shading (SFS), which recovers 3D structure based on geometric reasoning on how light is reflected of relevant surfaces <ref type="bibr" target="#b3">[4]</ref>, here the GI wall. 2) Feature-based methods like structure from motion (SfM), which recovers 3D shapes from features captured in multiple views of the same scene <ref type="bibr" target="#b4">[5]</ref>. SfS can reconstruct 3D shapes from only one image, while SfM needs at least two images.</p><p>With many images of the same (rigid) scene available, SfM can provide accurate 3D reconstruction. However, this is not necessarily easy to obtain for WCE from WCE images for the following reasons: i) Sometimes only one image is available due to rapid movement of the WCE, or debris in the intestine. ii) SfM assumes rigid motion, which is sometimes violated due to muscle contractions and peristalsis. iii) Sometimes the WCE position does not change enough from frame to frame to avoid degeneracies. In case i) single image techniques, like SfS, have to be applied <ref type="bibr" target="#b5">[6]</ref>. In case ii) one can apply non-rigid SfM (NR-SfM) <ref type="bibr" target="#b6">[7,</ref><ref type="bibr" target="#b7">8]</ref> taking non-rigid scene movement into account. In case iii) a simultaneous localization and mapping (SLAM) <ref type="bibr" target="#b8">[9,</ref><ref type="bibr" target="#b9">10]</ref> approach may be applied.</p><p>SLAM uses the fact that both camera position and 3D structure are obtained from SfM, and applies SfM locally among so-called key frames, which are frames with significantly different poses. Therefore, SLAM is potentially able to detect and ignore frames that may lead to degeneracies.</p><p>Another problem is that WCE images are are highly corrupted. Examples are debris in the intestinal fluids, specular reflections, motion blur, heavy lens distortion, chromatic aberrations, compression artefact etc. All of these factors makes it hard, if at all possible, to design algorithms for accurate 3D reconstruction as it is difficult to single out how each of these corruptions affect the reconstruction individually. However, with recent developments of virtual graphicsbased models of human GI system, where most of the distortion and artifacts can be enabled and disabled, it is possible to dissect the problem and determine how each factor disturbs the reconstruction individually. One such model is VR-CAPS <ref type="bibr" target="#b10">[11]</ref>, which is a realistic looking artificial GI system built from CT scans of humans, where also most corruptions in the WCE imaging process is modelled. Further, their GI-model can easily be exported and dissected in 3D modelling applications like blender<ref type="foot" target="#foot_0">1</ref> , thereby providing a ground truth for evaluation of 3D reconstruction algorithms, something which is hard to obtain for real WCE.</p><p>In this paper we conduct a feasibility study using SfM and SLAM for 3D reconstruction of longer sections of human colon in an ideal situation where most of the distortions mentioned above are turned off. We will use typical WCE image resolution and frame-rate. This enables us to conclude if 3D reconstruction using a feature based approach is at all possible for the unusual and repetitive geometry of a typical colon. If the conclusion is negative, there is no point in pursuing this problem further. We will first investigate SfM to gain basic knowledge, then use this knowledge to investigate a SLAM approach, named ORB-SLAM <ref type="bibr" target="#b9">[10]</ref>, which is a fast and accurate approach for monocular cameras.</p><p>In Section 2 the problem formulation is given and the existing methods we apply for our experiments are described. In Section 3, which contains the novel results of this paper, we experiment with SfM and ORB-SLAM to obtain 3D models of human colon segments generated in VR-CAPS. Summary, conclusion and future research ideas are given in Section 4.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Problem Formulation and Methods</head><p>Direct methods usually rely on accurate radiometric information, whereas feature based methods rely on image features. As the WCE is continuously adapting its camera response, accurate radiometric information is hard to obtain over image sequences. Therefore we consider feature based approaches here.</p><p>We will assume that lens distortion and other non-linearities have been compensated for so that we have a pinhole model. We will also assume that typical distortions seen in pillcam images, like specs on lens, motion blur etc., are taken care of through pre-processing.</p><p>Generally, we assume that the image capturing process is some mapping between 3D projective space P 3 and 2D projective (image) plane P 2 . Points in space are described in homogenous world coordinates as X = [𝑋, 𝑌, 𝑍, 𝑊 ] 𝑇 and image point are in homogenous image coordinates x = [𝑥, 𝑦, 𝑤] 𝑇 (𝑊, 𝑤 ∈ R + are some unspecified scaling factors) <ref type="bibr">[5, p. 7]</ref>. For 3D points in a point cloud, we denote the i'th point as X 𝑖 , 𝑖 = 1, • • • , 𝑁 , and its image x 𝑖 . With a pinhole camera model the relation between a point in world coordinates and image coordinates is a mapping 𝑃 : P 3 → P 2 . Then, for M views (images) of a given point, X 𝑖 , in the point cloud, the imaging process of the j'th view is given by [5, p. 154]</p><formula xml:id="formula_0">x 𝑗 𝑖 = 𝑃 𝑗 X 𝑖 , 𝑗 = 1, • • • , 𝑀, 𝑖 = 1, • • • , 𝑁,<label>(1)</label></formula><p>where 𝑃 𝑗 is the 3 × 4 camera matrix for the j'th view given by <ref type="bibr">[5, p. 156</ref>]</p><formula xml:id="formula_1">𝑃 𝑗 = 𝐾[𝑅 𝑗 |t 𝑗 ]. (<label>2</label></formula><formula xml:id="formula_2">)</formula><p>𝑅 𝑗 is a 3 × 3 rotation matrix and t 𝑗 is a 3 × 1 translation vector, both in P 3 . With WCE, the same camera captures all views, and so the calibration-or intrinsic matrix, K, is the same for all views, given by <ref type="bibr">[5, p. 156</ref>]</p><formula xml:id="formula_3">𝐾 = ⎡ ⎣ 𝑓 𝑚 𝑥 𝑠 𝑝 𝑥 𝑚 𝑥 0 𝑓 𝑚 𝑦 𝑝 𝑦 𝑚 𝑦 0 0 1 ⎤ ⎦ ,<label>(3)</label></formula><p>where 𝑓 is the focal length, 𝑝 𝑥 , 𝑝 𝑦 is the principal point, 𝑠 is the skew and 𝑚 𝑖 is the number of pixels per unit distance. The 𝑚 𝑖 -factors in 𝐾 makes Eq. ( <ref type="formula" target="#formula_1">2</ref>) a transformation from world coordinates to pixel coordinates. Skew is normally zero for pillcams, therefore we set 𝑠 = 0 in what follows. The other parameters can be found through a calibration procedure <ref type="bibr">[5, p.226</ref>].</p><p>We assume that the first view of any image sequence is taken by the camera when located at the world origin, i.e., 𝑃 1 = 𝐾[𝐼 3×3 |0], with 𝐼 3×3 the 3 × 3 identity matrix. That is, camera coordinates of the first view in the sequence are equivalent to world coordinates.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.">Structure from Motion (SfM)</head><p>SfM recovers both 3D structure and individual camera poses. For two, three, or four views one can solve the SfM problem using tensors named fundamental matrix (FM), trifocal tensor and quadrifocal tensor, respectively <ref type="bibr" target="#b4">[5]</ref>, which generate multi-linear relationships among the coordinates of image measurements, providing closed form mathematical relations in terms of camera matrices. For 𝑀 &gt; 4 views one has to deal with the problem through bundle adjustment (BA).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.1.">Two views and fundamental matrix (FM)</head><p>Take Eq. ( <ref type="formula" target="#formula_0">1</ref>) with 𝑀 = 2. Then any two points x 1 𝑖 , x 2 𝑖 , being the images of X 𝑖 in the two views, have to be related by the epipolar constraint <ref type="bibr">[5, p.245</ref>]</p><formula xml:id="formula_4">(x 2 𝑖 ) 𝑇 𝐹 x 1 𝑖 = 0, ∀𝑖,<label>(4)</label></formula><p>with F, the FM, a 3 × 3 rank 2 matrix given by 𝐹 = [e 2 ] × 𝑃 2 (𝑃 </p><formula xml:id="formula_5">𝑎 32 = 𝑒 2</formula><p>1 . 𝐹 can be numerically estimated from common features in two images. Typically, SIFT, SURF, Eigen-or ORB features are generated in the two images and matches between them are searched. With 𝑛 ≥ 8 such matches the normalized 8-point algorithm can estimate 𝐹 <ref type="bibr">[5, p. 282</ref>]. With significant noise in the image, outliers can be problematic. These can be dealt with by the RANSAC <ref type="bibr" target="#b11">[12]</ref> algorithm. With 𝐹 estimated, assuming that the camera center of the first view is at the world origin, the two camera matrices are found by</p><formula xml:id="formula_6">𝑃 1 = 𝐾[𝐼|0] and 𝑃 2 = [[e 2 ] × 𝐹 |e 2 ] [5, p.256].</formula><p>With 𝑃 1 , 𝑃 2 determined, one can find 3D point X 𝑖 for the correspondence x 1 𝑖 ↔ x 2 𝑖 , satisfying the constraint (4), by a triangulation method <ref type="bibr">[5, p. 311</ref>]</p><formula xml:id="formula_7">X 𝑖 = 𝜏 (x 1 𝑖 , x 2 𝑖 , 𝑃 1 , 𝑃 2 ).<label>(5)</label></formula><p>A common method is to use the fact that x 𝑗 𝑖 × x 𝑗 𝑖 = x 𝑗 𝑖 × 𝑃 𝑗 X 𝑖 = 0. For two corresponding points 𝑗 = 1, 2, this generates four linearly independent equations contained in matrix 𝐵. To find X 𝑖 one solves 𝐵X 𝑖 = 0 numerically (see <ref type="bibr">[5, pp. 312-313]</ref>). Typically, one minimizes the reprojection error <ref type="bibr">[5, p. 314</ref></p><formula xml:id="formula_8">], 𝐶(x 1 𝑖 , x 2 𝑖 ) = 𝑑(x 1 𝑖 , x ˆ1 𝑖 ) 2 + 𝑑(x 2 𝑖 , x ˆ2 𝑖 ) 2 , subject to (4), with 𝑑(•, •) some distance measure.</formula><p>With 𝐾 and 𝐹 known it is shown in <ref type="bibr">[5, p. 272-273</ref>] that the 3D scene can be reconstructed up to a similarity transform, i.e, a Euclidean reconstruction with an unknown scaling factor. The exception is the degenerate case which can occur when the camera centers and X 𝑖 are co-linear, or in a practical noisy case, close to co-linear. Also, under pure rotation about the camera center, the degenerate case 𝐹 = 0 occur. For WCE, degeneracies can occur due to both of these cases.</p><p>With 𝐾 known, one can estimate the Essential Matrix (EM) 𝐸 = 𝐾 𝑇 𝐹 𝐾 [5, p. 257], instead of the FM, which is simpler to compute.</p><p>To obtain metric reconstruction one will need additional information about the known length of some object in the scene, which is hard to obtain in the GI-system. One effort dealing with this issue is <ref type="bibr" target="#b12">[13]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.2.">Multiple Views and Bundle Adjustment (BA)</head><p>For three and four views the trifocal-and quadrifocal tensors provide relations in a similar way as the FM did for two. However, the relations are more general. One example is the possibility of transfer. That is, with a point correspondence between two views, the point in the third (or forth) will be determined. For 𝑀 &gt; 4 views, the problem has to be dealt with numerically through bundle adjustment (BA), which is a minimization problem on the form <ref type="bibr">[5, p. 434</ref>]</p><formula xml:id="formula_9">min 𝑃 ^𝑗 ,X ^𝑖 ∑︁ 𝑖,𝑗 𝑑 (︀ 𝑃 ˆ𝑗X ˆ𝑖, x 𝑗 𝑖 )︀ , 𝑗 = 1, • • • , 𝑀 𝑖 = 1, • • • , 𝑁,<label>(6)</label></formula><p>with 𝑑(•, •), some distance measure, typically Euclidean norm. That is, BA is the reprojection error over all views and 3D points. BA needs a good initial estimate, 𝑃 ˆ𝑗, X ˆ𝑖, of camera poses and 3D points, which is typically obtained by computing the FM (or trifocal tensor) sequentially over pairs (or triplets) of neighboring images until all views in the sequence are covered <ref type="bibr">[5, p.453</ref>].</p><p>The main problem with BA is that it is very costly to compute for large 𝑀 <ref type="bibr">[5, p. 435</ref>]. This problem is addressed by some SLAM algorithms (like ORB-SLAM) by using BA locally over sub-sets of key frames.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2.">ORB-SLAM</head><p>Performing 3D reconstruction on hundreds or even thousands of images, can be necessary for WCE video streams. Then a pure SfM approach is inconvenient both due to computational complexity and the difficulty of keeping track of which features are visible in a given view. For this a SLAM approach is more convenient. As WCE video is a sequences of monoculus images, we consider an approach known to be efficient for that case, namely ORB-SLAM <ref type="bibr" target="#b9">[10]</ref>.</p><p>ORB-SLAM performs SfM (using FM and BA) locally among key frames, which can be seen as structures (or objects) connected in a co-visibility graph. That is, a weighted graph where each node is a key frame with all relevant information included (like number of features, their strength, and all necessary adjacency information). There are edges among key-frames with common features, where the weight corresponds to the number of features they share. The local computation of camera poses and 3D geometry greatly reduces computational cost. A global optimization is also performed to optimize the position of camera poses. ORB-features, are used throughout as they are significantly faster to compute than SIFT or SURF features.</p><p>ORB-SLAM is done in three steps in addition to an initialization procedure. We provide a brief summary here and refer to <ref type="bibr" target="#b9">[10]</ref> for details. 0) Initialization: One out of two methods are chosen based on the scene in question: i) A homography if the scene is plane, or if the parallax is low. ii) A FM if the scene is not plane and with sufficient parallax. With 𝐾 known, the EM, 𝐸 = 𝐾 𝑇 𝐹 𝐾, is estimated. Solutions are chosen based on <ref type="bibr">[5, p. 257-260]</ref>. The choice between the two cases are done automatically using a heuristic <ref type="bibr">[10, p.1151]</ref>. A detection of low parallax case is also included and will refuse the initialization as this leads to a bad reconstruction.</p><p>1) Tracking: Localizes the pose of each frame w.r.t. the first view, which is assumed to be at the world origin (𝑃 1 = 𝐾[𝐼|0]), by matching ORB-features. It also decides if a given frame should be inserted as a key frame in the co-visibility graph. The poses are then optimized using BA (6) over the 𝑃 𝑖 's only. If tracking is lost a place recognition module is used in a global re-localization procedure.</p><p>2) Local Mapping: Processes new key frames and performs local BA to obtain a sparse 3D reconstruction in the surroundings of the relevant pose/frame. New correspondences for unmatched ORB-features are searched in key frames directly connected in co-visibility graph to triangulate new 3D points. If a key frame is found to be redundant, i.e., if it does not change enough compared to other key frames, or if it lacks high quality point matches, it is discarded.</p><p>3) Loop Closure: With every new key frame the algorithm searches for loops (i.e., when the camera re-visits a previous part of the scene). When a loop is detected it is possible to estimate drifts in the data, like drift in scale and position. This is the essential step to remove or minimize such errors.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3.">VR-CAPS</head><p>VR-CAPS is a virtual environment for WCE <ref type="bibr" target="#b10">[11]</ref> which is publicly available in github <ref type="foot" target="#foot_1">2</ref> . The environment is based on Unity, which is a game-platform developed by Unity Technologies <ref type="foot" target="#foot_2">3</ref> . The environment simulates a range of organ types, capsule endoscopy designs, normal and abnormal tissue conditions as well as many other features detailed in <ref type="bibr" target="#b10">[11]</ref>. It is also possible to emulate non-rigid movements like peristalsis. Therefore, VR-CAPS enables testing of medical imaging algorithms both for current and future WCE designs.</p><p>The standard setup in VR-CAPS is a virtual colon model which is built from CT scans of a real human colon and covered with realistic looking textures. A section of this colon is depicted in Fig. <ref type="figure" target="#fig_1">1</ref>(a) and an example image captured by the WCE inside this segment is depicted in Fig. <ref type="figure" target="#fig_1">1(b</ref>). Many pillcam models can be built, but the default is a standard-sized pill with one camera and a spot-light with conical beam, emulating several point-lights surrounding the lens often seen in standard WCE's. We will use the standard setup for our experiments.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Simulation setup and Experiments</head><p>We run the VR-CAPS simulator through several subsets of the colon-segment shown in Fig. <ref type="figure" target="#fig_1">1</ref>. These subsets can be seen in Figs. <ref type="figure" target="#fig_3">2(a</ref>), 4(a), 5(a) and serve as ground truth for the example 3D reconstructions. We set image size to 512 × 512, framerate to 20 fps, focal length 𝑓 𝑚 𝑖 = 163 and principle point 𝑝 𝑥 𝑚 𝑥 = 𝑝 𝑦 𝑚 𝑦 = 163 (in pixel units). Further, all distortion effects are disabled as default. However, we will enable some distortions in turn to evaluate the impact on the reconstruction. The WCE is controlled in VR-CAPS by key buttons and mouse. A steady movement is difficult to obtain, therefore the resulting WCE trajectory becomes irregular and ragged, especially through sharp bends. However, this movement appears quite similar to that of a real WCE, and will therefore test the ORB-SLAM's ability to cope with quite a realistic movement.  We first consider SfM on a short sequence of images to gain insight into what distortions the algorithm is sensitive to. This knowledge will be useful in deciding suitable pre processing for ORB-SLAM.</p><p>We evaluate the reconstruction mainly trough geometric inspection, visually comparing the resulting 3D point cloud models to the ground truth in Figs. <ref type="figure" target="#fig_3">2(a</ref>), 4(a) and 5(a). For more exact evaluation, a numerical comparison to ground truth is needed, which can be obtained by computing the average distance between all reconstructed points and ground truth. However, this is not straight forward to obtain as one has to exclude all parts of the colon from the ground truth not captured by the camera over long image sequences, as well as triangulate the reconstructed point cloud in an optimal way. This is currently work in progress.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1.">Structure from motion</head><p>We consider two cases: 2-view and 6-view SfM. Since 𝐾 is known, we estimate the EM, 𝐸 = 𝐾 𝑇 𝐹 𝐾. SURF features are used to estimate 𝐸 (and thereby 𝑃 𝑖 ) and 3D points, whereas Eigen features are used to compute dense point clouds once 𝐸 is known. For 𝑀 = 6 views, an initial reconstruction is made by sequentially computing the EM for pairs of consecutive frames (as in Algorithm 18.3 in [5, p. 453]) followed by BA. All relevant computation and estimation methods for our purposes are found in Matlab's computer vision toolbox <ref type="foot" target="#foot_3">4</ref> .</p><p>Based on experimentation on images obtained from VR-CAPS we concluded that the following pre-processing is needed: One has to remove specs on lens and specular reflections as they tend to confuse the feature detection algorithm. Motion blur causes similar problems, particularly in conjunction with rapid rotations and panning caused by rapid movements of the WCE from image to image. Lens distortion makes the assumption of pinhole camera fail, and therefore leads  to very sparse and inaccurate 3D point clouds. As the WCE has a spotlight source, lighting will vary hugely across the image. Due to dim lighting, particularly in fields imaging deeper parts, contrast enhancement is essential to detect stable features. Due to the variation in brightness we applied adaptive histogram equalization.</p><p>The colon segment we aim to reconstruct is shown in Fig. <ref type="figure" target="#fig_3">2</ref>(a). The image seen by view 1 is depicted in Fig. <ref type="figure" target="#fig_1">1(b)</ref>. This view is the reference for the 3D computation. The 2-view reconstruction is depicted in real color from the front and side in Figs. <ref type="figure" target="#fig_3">2(b</ref>) and 2(c) respectively, with the position of camera 1 included. The 6-view reconstruction is shown in Fig. <ref type="figure" target="#fig_3">2(d</ref>) from the side. The reconstruction is quite convincing, even with two images, but clearly more noisy than the 6-view case. The 6-view case is more restrictive and accurate as it rules out some outliers. Therefore, the point cloud may be somewhat less dense. Note in particular that the overall "cylindrical" geometry of the colon in Fig. <ref type="figure" target="#fig_3">2(a</ref>) is reconstructed quite well, indicating that the algorithm eliminates perspective distortion.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.">ORB-SLAM</head><p>For longer segments than the one in Fig. <ref type="figure" target="#fig_3">2</ref>(a) a large number of views may be necessary. Then ORB-SLAM is needed.</p><p>Algorithm for Densification: As ORB-SLAM is optimized for fast computation and and accurate localization, it produces a sparse point cloud only containing those 3D points of high accuracy needed to optimize camera localization. To make a denser point cloud for the purpose of GI inspection, we use the camera poses and co-visibility graph obtained by ORB-SLAM, then traverse the graph computing dense SfM over sub-sets of key-frames as detailed in Algorithm 1 below. Simulation Setup: In initialization step 0) (see section 2.2) we force the algorithm to choose a FM model as plane scenes never occur in the GI-system. Due to the WCE movement, initialization may fail due to low parallax. If the initialization is rejected, we skip to the next frame and re-start the algorithm until the initialization succeeds. Loop closure (Step 3) should be disabled as loops never occur when the WCE travels through the GI system. The repetitive geometrical structure of the colon also tend to confuse the ORB-SLAM algorithm, mis-interpreting these for being potential loop closure candidates. Without loop closure one has to expect inaccuracies as both scale and position will drift, particularly over longer segments. In sharp bends of the colon this will be most noticeable due to large rotations or panning of the camera. Here we try to avoid huge scaling errors by running ORB-SLAM several times over different colon segments. In a real scenario, one would likely make 3D models only in segments of the colon surrounding pathologies. However, if longer segments are needed, one may concatenate several reconstructed segments after estimating some scale factors. One may then use the fact that the colon can be approximately described as a tube with radius being contained within certain boundaries.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Algorithm 1. Densification of ORB-SLAM point cloud</head><formula xml:id="formula_10">Input: i) Tracking data from ORB-SLAM, 𝑃 𝑖 = 𝐾[𝑅 𝑖 |t 𝑖 ], for all key-frames 𝑖 = 1, • • • , 𝑁 𝐾𝐹 . ii) Co-</formula><p>ORB-features are detected under SLAM. However, SURF and eigen features are applied to compute dense reconstruction in Algorithm 1 as they appear to produce more reliable features for typical colon geometry and texture. We assume the same pre-processing as for SfM. The textures of the colon walls as well as its geometry are both crucial to obtain enough features to obtain a decent reconstruction. This leads to feature detection over a range of scales. To cover all relevant scales, 8 pyramid levels in the feature detection is needed. Further, all frames with significant motion blur are removed manually as they make the algorithm fail due to lack of ORB-feature matches.</p><p>Experiments: We consider three scenarios of colon segments that a 3D reconstruction algorithm should be able to handle: 1. Nearly straight short segments. 2. Longer sections bending slowly. 3. Shorter segments with sharp bends.</p><p>A version of ORB-SLAM has been implemented by the MatLab community <ref type="foot" target="#foot_4">5</ref> . We build on and extend this example for our purposes here.</p><p>Scenario 1: The colon segment under consideration is given in Fig. <ref type="figure" target="#fig_4">3</ref>(a) and is the same as in the SfM case. 68 images were generated of this segment in VR-CAPS, and 49 key-frames was chosen by the ORB-SLAM algorithm for reconstruction. Notice that the reconstruction is less noisy and denser than what was the case for pure SfM in Fig. <ref type="figure" target="#fig_3">2</ref>. It also appears to be a better reconstruction which fits quite well with the colon model as shown in Fig. <ref type="figure" target="#fig_4">3(d)</ref>. This indicates that ORB-SLAM copes with colon geometry, providing better accuracy than pure SfM.</p><p>Scenario 2: The colon segment under consideration is given in Fig. <ref type="figure" target="#fig_5">4</ref>(a). 996 images were generated of this segment in VR-CAPS, and 445 key-frames was chosen by the ORB-SLAM algorithm for reconstruction. The estimated camera poses, i.e., the movement of the camera through the relevant segment, as well as the corresponding sparse point cloud is shown in Fig. <ref type="figure" target="#fig_5">4(b)</ref>. "Optimized trajectory" refers to a global optimization over all key-frame camera poses after ORB-SLAM. The "ragged" trajectories fits with the simulated movement obtained through VR-CAPS. The sparse cloud seems to capture the overall shape of the colon segment. The dense reconstruction in Figs. <ref type="figure" target="#fig_5">4(c</ref>) and 4(d) shows a clearer outline of the reconstruction, and appears to have quite similar shape to the relevant segment. Note in particular that the narrowing of the colon is captured quite well. However, there is quite some noise in the cloud, particularly around the sharpest bend as well as close to the end of the segment, which is expected due to lack of loop closure. Overall, the result is quite promising.</p><p>Scenario 3: The colon segment under consideration is given in Fig. <ref type="figure" target="#fig_5">4</ref>(a). 1173 images were generated of this segment in VR-CAPS, and 332 key-frames was chosen by the ORB-SLAM algorithm for reconstruction. The movement of the camera through the relevant segment, as well as the corresponding sparse point cloud is shown in Fig. <ref type="figure" target="#fig_7">5(b</ref>). The sparse cloud again seems to capture the rough outline of the colon segment, and the "ragged" trajectory is inline with the simulated movement. The dense reconstruction in Figs. <ref type="figure" target="#fig_7">5(c</ref>) and 5(d) shows a clearer outline of the reconstruction, and appears to have quite similar shape to the relevant segment. However, there is even more noise than in Scenario 2, especially after the sharp bend, which is expected due to scale-and position drift. Also, we can see that the cloud is denser on the outer side of the bend, whereas it is very sparse, or lacking completely, on the inner side. The reason is that the camera is mainly facing outwards while it moves throughout the bend. A real WCE has a fisheye lens with a much larger viewing angle, and so one may expect this effect to be less severe (but still present). Anyway, the results seem quite promising, especially given the fact that the results are not yet optimized and fully (post-) processed.</p><p>As ORB-SLAM copes quite well with all three scenarios, even sharp bends, it seems that 3D reconstruction of the human colon is indeed possible. As mentioned earlier, for further evaluation and post-processing we first need a numerical comparison to ground truth.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Summary and Conclusions</head><p>In this paper we have investigated the possibility for 3D reconstruction of the human colon from WCE images using structure from motion and ORB-SLAM. To generate data sets, we used a virtual graphics-based environment emulating both the human colon as well as the WCE's movement through it. Experimental results in this paper indicate that 3D reconstruction of human colon is possible. Future research should aim at optimizing the 3D reconstruction process and find suitable post-processing methods to improve the resulting point cloud. Extensions to more realistic scenarios include non-rigid motion as well as enabling of distortions and artefact seen in real WCE images, all of which can be emulated in VR-CAPS. Then, with suitable pre-processing algorithms based on what we have learned through experiments in place, a study on real WCE videos will be possible. One should also combine or merge methods studied here with single image techniques, like the effort in <ref type="bibr" target="#b5">[6]</ref> using shape from shading, to cope with a broader scenario. Lastly, one may eliminate drifts due to lack of loop closure in ORB-SLAM through additional  information available. The WCE emits electromagnetic radiation received by several on-body sensors that can be used to track its position quite accurately <ref type="bibr" target="#b13">[14]</ref>, or compute the path length traveled <ref type="bibr" target="#b14">[15]</ref>. This can help to correct for drift in position.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: (a) Section of colon from VR-CAPS applied for 3D reconstruction in this paper. (b) Example image taken by WCE inside the colon section in (a).</figDesc><graphic coords="7,111.41,97.35,200.64,150.64" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Figure 2 :</head><label>2</label><figDesc>Figure 2: Structure from Motion (SfM) 3D reconstruction (a) Relevant colon segment (ground truth) (b) Reconstruction from 2 views seen from the front. (c) Reconstruction from 2 views seen from the side. (d) Reconstruction from 6 views seen from the side.</figDesc><graphic coords="8,98.06,288.86,156.56,116.58" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Figure 3 :</head><label>3</label><figDesc>Figure 3: ORB-SLAM 3D reconstruction, scenario 1: (a) Relevant colon segment (ground truth) (b) Dense point cloud from the side. (c) Dense point cloud in front. (d) 3D Point cloud (red) with 𝛼-shape triangulation overlayed ground truth colon segment</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_5"><head>Figure 4 :</head><label>4</label><figDesc>Figure 4: ORB-SLAM 3D reconstruction, scenario 2: (a) Relevant colon segment (ground truth) (b) Estimated camera poses with sparse point cloud. (c) Dense point cloud from the side. (d) Dense point cloud at slightly different vantage point.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_7"><head>Figure 5 :</head><label>5</label><figDesc>Figure 5: ORB-SLAM 3D reconstruction, scenario 3: (a) Relevant colon segment (ground truth) (b) Estimated camera poses with sparse point cloud. (c) Dense point cloud from the side. (d) Dense point cloud at opposite side.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head></head><label></label><figDesc>visibility graph of key-frame objects. Initialization: i) Point cloud array ii) Max number of views, 𝑀 𝑉 , used in dense 3D reconstruction Algorithm: for 𝑖 = 1 to 𝑁 𝐾𝐹 i) Determine number of key-frames, 𝑁 𝐶𝑉 , with strong co-visible features shared with keyframe 𝑖 for frames 𝑗 &gt; 𝑖 ii) if 𝑁 𝐶𝑉 &lt; 𝑀 𝑉 , set 𝑀 𝑉 to 𝑁 𝐶𝑉 iii) if 𝑀 𝑉 = 0, set point cloud to zero and jump to i) for next key frame iv) else Perform 𝑀 𝑉 -view SfM (as in Section 2) with dense features, given 𝑃 𝑗 , 𝑗 = 𝑖, • • • , 𝑖 + 𝑀 𝑉 − 1, with key frame 𝑖 as reference view v) Rule out degeneracies: If unproportionately large values exist in point cloud, set it to zero and jump to i) for next key frame vi) Denoise point cloud and store in point cloud array end vii) Concatenate all point clouds using available position data, 𝑃 𝑖</figDesc><table /></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">https://www.blender.org/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1">https://github.com/CapsuleEndoscope/VirtualCapsuleEndoscopy (31/10-21)</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2">https://unity.com/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_3">https://se.mathworks.com/products/computer-vision.html(10/11-21)   </note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_4">https://se.mathworks.com/help/vision/ug/monocular-visual-simultaneous-localization-and-mapping.html (20/11-21)</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Acknowledgments</head><p>We would like to give our appreciation to Anuja Vats for bringing our attention to the VR-CAPS environment.</p></div>
			</div>


			<div type="funding">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>⋆ Funding was provided by the Research Council of Norway under the project CAPSULE no. 300031.</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Improving uptake of colorectal cancer screening</title>
		<author>
			<persName><surname>Editorial</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">The Lancet Gastroenterology &amp; Hepatology</title>
		<imprint>
			<biblScope unit="volume">2</biblScope>
			<date type="published" when="2017">2017</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Wireless capsule endoscopy</title>
		<author>
			<persName><forename type="first">A</forename><forename type="middle">T C</forename></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Gastrointestinal Endoscopy</title>
		<imprint>
			<biblScope unit="volume">78</biblScope>
			<biblScope unit="page" from="805" to="815" />
			<date type="published" when="2013">2013</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Three-dimensional upper gastrointestinal endoscopy: A clinical study of safety and an ex vivo study of utility in endoscopic submucosal dissection</title>
		<author>
			<persName><forename type="first">K</forename><forename type="middle">N</forename></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Gastrointestinal Endoscopy</title>
		<imprint>
			<biblScope unit="volume">87</biblScope>
			<date type="published" when="2018">2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">The variational approach to shape from shading</title>
		<author>
			<persName><forename type="first">B</forename><surname>Horn</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Brooks</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Computer Vision, Graphics, and Image Processing</title>
		<imprint>
			<biblScope unit="volume">33</biblScope>
			<biblScope unit="page" from="174" to="208" />
			<date type="published" when="1986">1986</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<monogr>
		<title level="m" type="main">Multiple View Geometry in Computer Vision</title>
		<author>
			<persName><forename type="first">R</forename><forename type="middle">I</forename><surname>Hartley</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Zisserman</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2004">2004</date>
			<publisher>Cambridge University Press</publisher>
		</imprint>
	</monogr>
	<note>second ed</note>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">3d reconstruction of gastrointestinal regions from single images</title>
		<author>
			<persName><forename type="first">B</forename><surname>Ahmad</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">A</forename><surname>Floor</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Farup</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Colour and Visual Computing Symposium (CVCS)</title>
				<meeting><address><addrLine>Gjøvik, Norway</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2022">2022</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">A benchmark and evaluation of non-rigid structure from motion</title>
		<author>
			<persName><forename type="first">S</forename><surname>Jensen</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">International Journal on Computer Vision</title>
		<imprint>
			<biblScope unit="volume">129</biblScope>
			<biblScope unit="page" from="882" to="899" />
			<date type="published" when="2021">2021</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Neural dense non-rigid structure from motion with latent space constraints</title>
		<author>
			<persName><forename type="first">V</forename><surname>Sidhu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Tretschk</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><surname>Golyanik</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Agudo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Theobalt</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">European Conference on Computer Vision (ECCV)</title>
				<imprint>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Parallel tracking and mapping for small ar workspaces</title>
		<author>
			<persName><forename type="first">G</forename><surname>Klein</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Murray</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">6th IEEE and ACM International Symposium on Mixed and Augmented Reality</title>
				<imprint>
			<date type="published" when="2007">2007. 2007</date>
			<biblScope unit="page" from="225" to="234" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Orb-slam: A versatile and accurate monocular slam system</title>
		<author>
			<persName><forename type="first">R</forename><surname>Mur-Artal</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">M M</forename><surname>Montiel</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">D</forename><surname>Tardós</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">IEEE Transactions on Robotics</title>
		<imprint>
			<biblScope unit="volume">31</biblScope>
			<biblScope unit="page" from="1147" to="1163" />
			<date type="published" when="2015">2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">Vr-caps: A virtual environment for capsule endoscopy</title>
		<author>
			<persName><forename type="first">K</forename><surname>Incetan</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Medical Image Analysis</title>
		<imprint>
			<biblScope unit="volume">70</biblScope>
			<date type="published" when="2021">2021</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<analytic>
		<title level="a" type="main">Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography</title>
		<author>
			<persName><forename type="first">M</forename><forename type="middle">A</forename><surname>Fischler</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><forename type="middle">C</forename><surname>Bolles</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Commun. of the ACM</title>
		<imprint>
			<biblScope unit="volume">24</biblScope>
			<biblScope unit="page" from="381" to="395" />
			<date type="published" when="1981">1981</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">Endoscopic single-image size measurements</title>
		<author>
			<persName><forename type="first">G</forename><surname>Dimas</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Bianchi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">K</forename><surname>Iakovidis</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Karargyris</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Ciuti</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Koulaouzidis</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Measurement Science and Technology</title>
		<imprint>
			<biblScope unit="volume">31</biblScope>
			<biblScope unit="page" from="9" to="15" />
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<analytic>
		<title level="a" type="main">On localisation accuracy inside the human abdomen region</title>
		<author>
			<persName><forename type="first">B</forename><surname>Moussakhani</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">T</forename><surname>Flåm</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Støa</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Balasingham</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Ramstad</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">IET Wireless Sensor Systems</title>
		<imprint>
			<biblScope unit="volume">2</biblScope>
			<biblScope unit="page" from="9" to="15" />
			<date type="published" when="2012">2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">On path length estimation for wireless capsule endoscopy</title>
		<author>
			<persName><forename type="first">A</forename><surname>Bjørnevik</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">A</forename><surname>Floor</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Balasingham</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">12th International Symposium on Medical Information and Communication Technology (ISMICT)</title>
				<imprint>
			<date type="published" when="2018">2018</date>
			<biblScope unit="page" from="1" to="5" />
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
