Tan-Binh Phan

Dinh-Hoan Trinh

Didier Wolf

Christian Daul
email: christian.daul@univ-lorraine.fr

Optical Flow-based Structure-from-Motion for the Reconstruction of Epithelial Surfaces

Keywords: 3D image mosaicing, Structure-from-Motion (SfM), Dense optical flow, Endoscopy, Dermatology

This paper details a novel optical flow-based structure from motion (SfM) approach for the reconstruction of surfaces with few textures using video sequences acquired under strong illumination changes. An original image search and grouping strategy allows to reconstruct each 3D scene point using a large set of 2D homologous points extracted from a reference image and its superimposed images acquired from different viewpoints. A variational optical flow scheme with a descriptor-based data term leads to a robust, accurate and dense homologous point determination between the image pairs. Thus, contrary to classical SfM usable for textured scenes, the proposed dense point cloud reconstruction algorithm requires neither a feature point tracking method nor any multi-view stereo technique. The performance of the proposed SfM approach is assessed on phantoms with known ground truth and on very complex patient data of various medical examinations and image modalities.

Introduction

Multiview 3D techniques aim to reconstruct scenes with an extended field of view (FoV) using sequences of 2D images with limited FoV. The intrinsic cam-3 era parameters are usually obtained either through a offline calibration or are directly estimated with the images used to reconstruct the scene [START_REF] Zhang | A flexible new technique for camera calibration[END_REF]. Multiview 3D techniques recover a scene in several steps. The acquired sequences are first preprocessed to correct image distortions or remove images with poor quality (e.g., blurred data). The 3D scene structure is reconstructed in the second step, referred to as structure-from-motion (SfM). According to the image contents, this step is among the most challenging in the whole process. In this SfM step, 3D geometrical structures are obtained using triangulation techniques applied on groups of homologous points seen (preferably) in numerous 2D images [START_REF] Hartley | Multiple View Geometry in Computer Vision[END_REF], the 3D point positions being refined by a bundle adjustment [START_REF] Agarwal | Bundle adjustment in the large[END_REF]. The performance of the determination of homologous points (matching) is a key issue in SfM. Almost all SfM methods in the literature determine homologous points using feature detection and matching algorithms (as SIFT [START_REF] Lowe | Distinctive image features from scale-invariant keypoints[END_REF] or SURF [START_REF] Bay | Speeded-up robust features (SURF)[END_REF]). The SfM step delivers sparse 3D point clouds since feature based methods detect a limited number of points in images of most of the scenes. Multi-view Stereo (MVS) techniques represent a classical step used to increase the density of the 3D point clouds. Patched-MVS [START_REF] Furukawa | Accurate, dense, and robust multiview stereopsis[END_REF], CMPMVS [START_REF] Jancosek | Multi-view reconstruction preserving weaklysupported surfaces[END_REF], and MVS [START_REF] Schönberger | Pixelwise view selection for unstructured multi-view stereo[END_REF] are state-ofthe-art MVS methods. In the next step, a mesh generation algorithm (as the Poisson surface algorithm in [START_REF] Kazhdan | Poisson surface reconstruction[END_REF]) uses the dense 3D point cloud to approximate surfaces with triangular facets. These meshes are usually refined to obtain the final surface [START_REF] Vu | High accuracy and visibilityconsistent dense multiview stereo[END_REF]. Finally, the superimposition of the 2D image textures onto the meshed surface leads to a visually coherent scene rendering [START_REF] Waechter | Let there be color! large-scale texturing of 3D reconstructions[END_REF].

Feature-based SfM methods were used to recover the surface of objects of a few centimeters of diameter up to one kilometer across (see [START_REF] James | Straightforward reconstruction of 3D surfaces and topography with a camera: Accuracy and geoscience application[END_REF]). SfM-based 3D reconstruction was also used to reconstruct large monuments [START_REF] Frahm | Building rome on a cloudless day[END_REF], or even complete city districts [START_REF] Crandall | SfM with MRFs: Discrete-continuous optimization for large-scale structure from motion[END_REF] with high accuracy. However, there is a class of medical scenes for which feature based-SfM approaches are an optimal solution.

Medical context

The epithelium (tissue that covers the external human body surface or that lines the internal wall of all hollow organs) is visualized by cameras in various medical examinations. In dermatology, in gastroenterology and in cystoscopy the epithelial surfaces (respectively corresponding to the skin, the inner stomach wall or the inner bladder wall) are scanned by a camera to search for lesions or to assess their evolution. All these medical applications have a common point: the images are acquired close to the tissue to ensure high image resolution.

Due to these acquisition conditions, the FoV of the images is very limited. Small FoVs do not facilitate the diagnosis since, on the one hand, cancerous lesions on the skin or in the bladder have to be completely seen and, on the other hand, an urologist or a gastroenterologist cannot mentally visualize the endoscope position in hollow organs. Extending the FoV using mosaicing algorithms favours a simultaneous visualization of complete lesions and of anatomical landmarks helping endoscopists to localize the instrument into the organ.

In the last two decades, 2D image mosaicing algorithms were proposed in endoscopy [START_REF] Behrens | Local and global panoramic imaging for fluorescence bladder endoscopy[END_REF][START_REF] Weibel | Graph based construction of textured large field of view mosaics for bladder cancer diagnosis[END_REF]. 2D mosaics increase the FoV, but have two major drawbacks.

On the one hand, the 3D organs are projected on a 2D plane defined by the image taken as a reference for the mosaicing. When moving away from this reference image in the mosaic plane, the projection distortions become strong and result both in a loss of image resolution and in an incorrect organ representation at the borders of the mosaics which remain of limited size. On the other hand, 2D mosaics are not in accordance with the 3D mental organ representation of endoscopists or dermatologists. Obtaining extended 3D FoV mosaics using SfM techniques can be of high interest in dermatology and endoscopy. However, in medical examinations both the acquisition conditions and the scene characteristics are significantly different from those of the applications for which SfM has been proven efficient. First, the reconstruction of 3D points is more accurate when homologous points can be acquired from very different viewpoints. In classical SfM applications (e.g., manufactured part or monument surface construction), the acquisition conditions are controlled in the sense that scene parts can effectively be acquired from very different viewpoints. In dermatology, and more particularly in endoscopy, the camera trajectory is quite difficult to control. Obtaining images of the same organ part from very differ- ent viewpoints is a difficult task. Secondly, images of natural scenes or manufactured parts usually include image primitives (corners, line segments, etc.), contrasted textures and/or a great variation in terms of colours. On the contrary, the color variations are very small in dermatology, while in gastroscopy most images are with very few and weakly contrasted textures and structures.

As shown in Fig. 1(a) for two pyloric antrum images, only few homologous points were found when associating the SIFT algorithm [START_REF] Lowe | Distinctive image features from scale-invariant keypoints[END_REF] to the RANSAC outlier rejection method [START_REF] Fischler | Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography[END_REF]. Besides the lack of textures, homologous point determination is also impeded by the strong illumination changes between two acquisitions and inhomogeneous lighting due to viewpoint changes. Specular reflections also favor false point correspondences. Such few and partially wrong matches are not appropriate for a 3D reconstruction using SfM approaches.

Scientific context

As shown in Fig. 1(b), the optical flow (OF) approach described in this work is usable for scenes with few textures and structures. Although dense optical flow (DOF) provides numerous homologous points between two images, DOF matching techniques have been rarely used in SfM up to now.

Let us consider the following situation to understand the reason for this.

Suppose that I i and I j (with j = i ± 1) are two non (temporally) consecutive video-sequence images that share a common scene part. If the images are well structured/textured, feature detectors and descriptor (e.g., SIFT) can effectively determine (both in quantity and quality) the homologous points between I i and I j . The advantage of the feature matching methods is that the points detected by detector (keypoints) and their descriptors are often invariant to geometric and photometric changes. Thus, point-tracks determined by feature matching often ensure a high accuracy (the key-points can be localized with a subpixel accuracy). In contrary, if an OF-based tracking method is used to find homologous points between I i and I j , flow fields F k,k+1 (with k = i, i+1, . . . , j -1) have to be computed for consecutive image pairs (I k , I k+1 ) from I i to I j .

With a starting point

A i in I i , the tracked sequence of points (A i , A i+1 , . . . , A j ) is determined, with A k = A k-1 + F k-1,k (A k-1
) and k = i + 1, . . . , j, and A j is defined to be the homologous point of A i . Two issues are related to this way to track homologous points: (i) even if a very accurate OF method providing a dense flow field between images is used, it is impossible to reach the subpixel accuracy of feature matching methods, and (ii) although the errors affecting the OF vectors linking points in consecutive images are weak, these errors accumulate themselves along the sequence and may become quickly large when the length of the point track increases. Therefore, A i and A j are often wrong homologous points when the temporal distance |j -i| is large. This lack of accuracy explains why DOF is rarely used in SfM approaches.

The proposed SfM approach is based on the fact that in the scenes where feature detectors are unusable, DOF may be the only option for point correspondance establishment. The global aim of this paper is to show that a DOFapproach can lead to an efficient surface reconstruction solution for scenes for which feature-based methods cannot be used. The described solution is based on two contributions. The paper shows first how a dense point correspondence can be established even in complexe scenes with few textures and strong illumination changes as in Fig. 1(b). Then, one proposes an image grouping strategy that leads to numerous and large homologous point sets enabling a robust surface reconstruction. Compared to the point tracking in consecutive images of a sequence, the proposed image grouping strategy avoids accumulated errors leading to inaccurate or false correspondences. Moreover, unlike feature-based SfM methods, the proposed DOF-based SfM method directly provides dense 3D point clouds and makes the implementation of a MVS method unnecessary.

Paper organization

Section 2 presents previous contributions relating to the reconstruction of medical scenes. Section 3 focuses on the two main contributions enabling SfM methods to be robust, namely the OF method for finding numerous homologous points between two images and the strategy for finding numerous 2D homologous image points for each 3D scene point to be reconstructed. Results are first given in Section 4 to compare the performance of a state-of-the-art SfM method based on feature detection (COLMAP [START_REF] Schönberger | Structure-from-motion revisited[END_REF]) with that of the proposed DOF-based SfM approach. Epithelial surface construction examples are then given for three medical examinations (gastroscopy, cystoscopy and dermatology) to show the large scene variability which can be handled by the proposed SfM scheme. A conclusion and perspectives are presented in Section 5.

Related work

A straightforward solution to tackle the issue relating to the lack of feature points would be to use active stereo-vision systems projecting light patterns on the surfaces to be reconstructed [START_REF] Shevchenko | A high resolution bladder wall map: Feasibility study[END_REF]. An active vision method was developed to show the feasibility of 3D bladder mosaicing [START_REF] Ben-Hamadou | Construction of extended 3D field of views of the internal bladder wall surface: a proof of concept[END_REF]. However, such a solution lead to too significant hardware changes for endoscope manufacturers who prefer passive vision solutions keeping the instruments unchanged. Moreover, active vision solutions are usually application dedicated.

Beside active vision systems, passive vision techniques based on shape from shading (SfS), SfM and simultaneous localization and mapping (SLAM) were proposed. A SfS technique was successfully used in endoscopy to reconstruct Lambertian surfaces of bone structures [START_REF] Wu | A multi-image shape-from-shading framework for near-lighting perspective endoscopes[END_REF]. However, SfS techniques alone are not appropriate for cystoscopic or gastroscopic scenes in which the illumination conditions drastically change with the viewpoint. Several works [START_REF] Kaufman | 3D surface reconstruction from endoscopic videos[END_REF][START_REF] Zhao | The endoscopogram: A 3D model reconstructed from endoscopic video frames[END_REF] have associated SfS with SfM methods in order to simultaneously exploit shading and feature information for the reconstruction of surfaces from endoscopic images.

All these works show the potential of SfM, SfM associated with SfS, and SLAM (SLAM [START_REF] Grasa | Visual SLAM for handheld monocular endoscope[END_REF] can be seen as a particular case of SfM) methods in endoscopy when homologous points can be robustly determined between images.

SfM methods were tested in the specific case of cystoscopy. In [START_REF] Soper | Surface mosaics of the bladder reconstructed from endoscopic video for automated surveillance[END_REF], the authors replaced the cystoscope by a non-standard system acquiring image sequences using an ultrathin fiber whose trajectory is controlled by a robotic steering system. The spiral shaped camera trajectory ensures numerous image overlaps which favors robust SfM. Surface reconstruction tests were successfully conducted on pig bladders. Although no test on human data was performed, the results obtained in [START_REF] Soper | Surface mosaics of the bladder reconstructed from endoscopic video for automated surveillance[END_REF] show the potential of SfM in cystoscopy. This potential was confirmed in [START_REF] Lurie | 3D reconstruction of cystoscopy videos for comprehensive bladder records[END_REF] on clinical data. However, the method in [START_REF] Lurie | 3D reconstruction of cystoscopy videos for comprehensive bladder records[END_REF] is based on the assumption that a significant amount of homologous points can be extracted and matched using SIFT features for almost all images. This assumption is not always true. On the one hand, there is no warranty to obtain contrasted textures since strong blur affect often images due to the difficulty of controlling the cystoscope speed and the distance between the instrument's distal tip and the inner epithelial surface. On the other hand, large image regions may be without textures due to surgical intervention for lesion removal for instance.

At the best of our knowledge, no solution was proposed in the medical field to build surfaces using textureless images as in gastroscopy.

Dense Optical Flow for SfM

This section begins by briefly describing a robust illumination-invariant OF method that delivers accurate correspondences even with weakly structured and textured images. Then, section 3.2 details the image grouping strategy which maximizes the sizes of the homologous point sets by uniquely computing the DOF between image pairs (i.e., without tracking homologous points along a sequence of more than two images). This image grouping strategy is intergraded in the incremental SfM pipeline given in [START_REF] Schönberger | Structure-from-motion revisited[END_REF] to generate 3D points of scene1 .

Optical flow estimation

Although numerous state-of-the-art OF methods have been proposed, OF estimation remains challenging in medical scenes. Learning-based OF methods (e.g., FlowNet [START_REF] Ilg | Flownet2.0: Evolution of optical flow estimation with deep networks[END_REF]) are difficult to apply to endoscopic images due to the lack of ground-truth data for training, while feature matching-based methods [START_REF] Bailer | Flow fields: Dense correspondence fields for highly accurate large displacement optical flow estimation[END_REF][START_REF] Hu | Efficient coarse-to-fine patchmatch for large displacement optical flow[END_REF] are often inoperative for weakly structured/textured scenes under strong illumination changes. As shown in [START_REF] Trinh | On illumination-invariant variational optical flow for weakly textured scenes[END_REF], the variational OF approach is the more appropriate for complex scenes as in endoscopy. Numerous studies on variational OF have been proposed, e.g. [START_REF] Álvarez | Reliable estimation of dense optical flow fields with large displacements[END_REF][START_REF] Bruhn | Lucas/kanade meets horn/schunck: Combining local and global optic flow methods[END_REF][START_REF] Sun | Secrets of optical flow estimation and their principles[END_REF].

The variational model for determining the flow field from source image I s to target image I t is defined as

min u [E reg (u) + λE data (I s , I t , u)] , (1)
where u (u x , u y ) denotes the flow field, E reg is a regularization term that assumes smoothness of solution u, E data is a data-term that measures the similarity of pixels in I s and I t , and λ > 0 is a parameter controlling the relative importance between the two terms.

In endoscopy, images are often affected by uncontrolled illumination variations and specular reflection (SR). Therefore, the data and regularization terms have to be appropriately designed. To this end, we follow the variational OF model given in [START_REF] Trinh | Mosaicing of images with few textures and strong illumination changes: Application to gastroscopic scenes[END_REF] where SR pixels and the saturated pixels surrounding SR regions are excluded from the OF estimation, while the illumination variations are controlled using an illumination-invariant descriptor in the data-term.

More precisely, SR regions in I s and I t are first segmented using the method described in [START_REF] Trinh | Mosaicing of images with few textures and strong illumination changes: Application to gastroscopic scenes[END_REF]. A binary mask M SR is then computed as follows:

M SR = (R Is ⊕ se) ∪ (R It ⊕ se) , (2)
where R I denotes a binary image in which R I (i, j) = 1 when (i, j) corresponds to coordinates of a SR pixel in image I, and ⊕ is the morphological dilation operator associated with a square structuring element se. Values at 1 in binary mask M SR correspond to pixels located either inside SR regions in I s or I t (pixels at 1 before dilation) or close to reflections (pixels at 1 after dilation).

After determining SR pixels and their neighbors, the data-and regularization terms in ( 1) are defined by:

E data = x∈Ω θ x D (P Is (x)) -D (P It (x + u x )) 2 2 , (3)
E reg = x∈Ω x ∈Nx θ x θ x ω x x u x -u x 1 , (4)
where Ω stands for the image domain and u x is the displacement vector from pixel x in source I s . L 1 -regularisation is used in (4) because it is known to better preserve discontinuities compared to L 2 -regularisation [START_REF] Brox | High accuracy optical flow estimation based on a theory for warping[END_REF]. Parameter θ x equals 0 for M SR (x) = 1, and θ x = 1, otherwise. This ensures that saturated pixels and their close neighbors are not involved in the OF determination. Symbol P I (x) denotes a small patch 2 centered on pixel x in image I, and D (P I (x)) is a descriptor vector computed with the colours of the pixels in P I (x). In (4), 2 The size of the descriptor patches relates to the illumination variation model detailed in [START_REF] Trinh | On illumination-invariant variational optical flow for weakly textured scenes[END_REF]. To sum up, illumination changes between two small homologous rectangular regions N x is the set of neighbor pixels x in a rectangular region centered on x, and ω x x is a weighting function which is used to define the mutual support between the pixels at positions x and x . The support-weight is computed based both on the color-similarities of pixels, and on their spatial distances:

ω x x = exp -x -x 2 2 γ 1 + -c Is (x) -c Is (x ) 2 2 γ 2 . ( 5
) Vector c Is (x) = [L(x), a(x), b(x)
] encodes the color of image I s at pixel x in the CIELab space [START_REF] Yoon | Adaptive support-weight approach for correspondence search[END_REF], while γ 1 and γ 2 are parameters controlling the importance of the colour similarity and the spatial distance.

The epithelial images as in Fig. 1

D(P I ) = V(P I ) V(P I ) 2 , (6)
with

V(P I ) = [K 1 ⊗ P g I , K 2 ⊗ P g I , . . . , K 12 ⊗ P g I ] T ∈ R 12
, where ⊗ denotes the convolution operator. In patches P g I , the central pixel (whose grey-level value is multiplied by 3) can be seen as the origin of a star shaped structure from which grey-level variations are computed along 12 directions. These grey-level variations encode the shape and sharpness of the local texture or intensity vari- ations. With or without illumination changes between images, two descriptors vectors D (P Is (x)) and D (P It (x + u x )) should have the same component values. In [START_REF] Trinh | On illumination-invariant variational optical flow for weakly textured scenes[END_REF] it was shown that a D is invariant to illumination changes when:

D(P I ) = D(a x P I + b x ), ∀a x ∈ R >0 , ∀b x ∈ R. (7)
As seen in Fig. 2, the sum of the coefficients is null in each convolution kernel

K d . It follows that the effect of additive term b x is compensated since K d ⊗ (a x P g I + b x ) = a x (K d ⊗ P g I ), ∀d = 1, 2, . . . , 12. (8)
This leads to V(a x P I + b x ) = a x V(P I ) and V(a

x P I + b x ) 2 = a x V(P I ) 2 .
Therefore, the effect of multiplicative term a x is also compensated:

V(a x P I + b x ) V(a x P I + b x ) 2 = a x V(P I ) a x V(P I ) 2 = V(P I ) V(P I ) 2 (9) ⇔ D(a x P I + b x ) = D(P I ), ∀a x ∈ R >0 , ∀b x ∈ R. (10)
Thus, vector D, as defined in [START_REF] Furukawa | Accurate, dense, and robust multiview stereopsis[END_REF], is an illumination-invariant descriptor.

In this work, the optimization problem defined by ( 1), ( 3) and ( 4) is solved using the projection-proximal point algorithm [START_REF] Chambolle | A first-order primal-dual algorithm for convex problems with applications to imaging[END_REF][START_REF] Drulea | Motion estimation using the correlation transform[END_REF]. Moreover, the wellknown coarse-to-fine multiscale warping strategy is also used to deal with large displacements. The size of structural element se in (2) was empirically set to 7 × 7, whereas the size of neighborhood N x in (4) was 5 × 5. The experimental approach described in [START_REF] Trinh | On illumination-invariant variational optical flow for weakly textured scenes[END_REF] was adopted to search the optimal values of parameters λ in (1),γ 1 and γ 2 in (5), as well as the value of the pyramid scale P y s in the coarse-to-fine strategy. The values of these parameters are constant and given in Section 4. When comparing Figs. 1(a) and 1(b), it appears that the DOF-approach can robustly determine homologous point-pairs.

Homologous point set determination for SfM

Suppose that the input of the SfM algorithm is a video-sequence S = {I 1 , I 2 , . . . , I N } of N temporally numbered images having a size of H × W pixels. Let Z = {1, 2, . . . , N } be the index set of S. The proposed matching method is based on the fact that if {A k } k∈Zi⊂Z is a group of 2D homologous points on images in sequence S, then A k ∈ j∈Zi I j , ∀k ∈ Z i . Therefore, to find homologous point groups, our idea is to first determine reference images, referred to as I ref i , which have an overlap with a maximum of other images. The set of images overlapping

I ref i is denoted by S i = {I k } k∈Zi ⊂ S. Then, if A ref 0 is a point in I ref i and A k (k ∈ Z i ) are corresponding points of A ref 0 in images I k with k ∈ Z i and i = k, then the set {A ref 0 , A k } k∈Zi is
defined as a group of homologous points or, in abbreviated form, as a HP-group (see Fig. 3).

The next three sub-sections successively present the method for determining overlapping image pairs in sequence S, the algorithm which determines the reference images I ref i as well as their corresponding sets S i , and the solution for generating HP-groups based on the DOF technique detailed in section 3.1.

Overlap estimation

Definition 1. Two images I i and I j are called τ -overlapped when their common area I i ∩ I j is greater than a given threshold τ in pixels.

When the acquisition distance is small (e.g., as in gastroscopy or cystoscopy where the endoscope distal tip is close to the tissue), the FoV is limited and the displacement field between consecutive images mainly consists of translation vectors. For this reason, simple translations can be used to represent the displacement between common scene parts approximated by rectangular subregions in the images.

The translation vector between two images I i and I j in S is denoted by

v i,j (v 1 i,j , v 2 i,j )
, where v 1 i,j and v 2 i,j are the vector components. Vector v i,j (v 1 i,j , v 2 i,j ) is determined with the DOF fields F t,t+1 between the consecutive images I t and I t+1 of sequence I i , I i+1 , . . . , I j-1 , I j . The motion vector at the central pixel

(W/2, H/2) of image I t to image I t+1 is denoted by c t,t+1 (c 1 t,t+1 , c 2 t,t+1
) with:

c t,t+1 (c 1 t,t+1 , c 2 t,t+1 ) = F t,t+1 W 2 , H 2 . ( 11
)
If two images I i and I j are consecutive (i.e., |i -j| = 1), then the translation vector between images pair (I i , I j ) is defined by:

v i,j (v 1 i,j , v 2 i,j ) = c i0,i0+1 (c 1 i0,i0+1 , c 2 i0,i0+1 ), (12)
with image index i 0 = min(i, j) making ( 12) valid for two cases: j = i -1 and

j = i + 1.
For two non-consecutive images I i and I j (i.e., |i -j| > 1), two image indexes are considered : i 0 = min(i, j) and j 0 = max(i, j). In this case, the translation between I i and I j is defined (both for i > j and i < j) by the sum of the translation vectors between consecutive images from I i0 to I j0 :

v i,j (v 1 i,j , v 2 i,j ) = j0-1 t=i0 c t,t+1 (c 1 t,t+1 , c 2 t,t+1 ). ( 13
)
Two images I i and I j with translation vector v i,j are τ -overlapped when the following condition is fulfilled:

         -W < v 1 i,j < W -H < v 2 i,j < H Area i,j = (W -|v 1 i,j |)(H -|v 2 i,j |) ≥ τ, (14)
where W and H are the width and height of the images, Area i,j is the overlap area in pixels, and τ (0 < τ ≤ W H) is the threshold parameter. The two first equations in [START_REF] Crandall | SfM with MRFs: Discrete-continuous optimization for large-scale structure from motion[END_REF] ensure that I i ∩ I j = ∅, whereas the third equation defines the area of the overlap region I i ∩ I j .

Reference images

The proposed algorithm determines the reference images given by [START_REF] Waechter | Let there be color! large-scale texturing of 3D reconstructions[END_REF].

I ref i ,
Initialization: Ω ref = ∅.
---------/* Part 1: Determination of sets S i : */ for i = 1 to N do

S i = {I i } for j = 1 to N do if (|i -j| = 1) then
Compute v i,j using [START_REF] James | Straightforward reconstruction of 3D surfaces and topography with a camera: Accuracy and geoscience application[END_REF].

end if if (|i -j| > 1) then
Compute v i,j using [START_REF] Frahm | Building rome on a cloudless day[END_REF].

end if if (j = i) and (I j τ -overlaps with I i ) then

S i ← S i ∪ I j end if end for end for G = {S 1 , S 2 , . . . , S N }. --------- /* Part 2: Reference image determination: */ while G = ∅ do • Ω ref ← Ω ref ∪ I i , where i satisfies |S i | ≥ |S k |, for all S k =i ∈ G.
• For all images I j ∈ S i , removing corresponding set S j from G:

G ← G \ j:Ij ∈Si S j . (15
Ξ ref i = A i,ref xy (xh, yh) | x, y ∈ N, x ≤ W h , y ≤ H h , (16)
where parameter h represents the distance between neighbor points on a grid visible in Fig. 1

(b). Then, from each point

A i,ref xy ∈ Ξ ref i in I ref i which is
not indicated as a specular reflection pixel (see mask M SR defined in (2)), one computes its corresponding points in images I j ∈ S i using the DOF fields F i,j :

A j xy = A i,ref xy + F i,j (A i,ref xy ), ∀j ∈ Z i . (17)
In the proposed SfM pipeline, not only pixels in SR regions (mask M SR ), but also those in occluded regions are excluded from the homologous point determination. The term "occluded" refers classically to scene parts visible only in one image. For non-occluded pixels, the forward OF from the first image should be the opposite of the backward OF at the corresponding pixels in the second violating at least one of the three constraints:

           A j xy = A i,ref xy + F s,t A i,ref xy A i,ref xy = A j xy + F t,s A j xy A i,ref xy -A i,ref xy 2 ≤ (18)
is marked as having an inaccurate flow field vector, where a weak threshold parameter value ensures an accurate pixel correspondence. Both occluded pixels and pixels with too inaccurate OF vectors are encoded in binary image M inac , where M inac (x) = 1 refers either to an occluded pixel (also detected with ( 18))

or a pixel without a very accurate OF vector (the latter pixels are not necessarily associated with a wrong OF vector, but they simply not lead to correspondences with a high accuracy). Binary mask M i,j defined as M i,j = M SR ∪M inac is used to mark pixels which will be excluded from the homologous point determination of two images I ref i and I j . An example of mask M i,j can bee seen in Fig. 4(d).

The flow field obtained using the proposed variational OF method for the tex- numerous HP-groups consisting each of a large amount of accurately matched points can be established. The number of HP-groups depends on the values of parameter h and of the overlap parameter τ . Moreover, HP-groups are robustly and accurately determined because no optical flow errors accumulate.

Results and discussion

This section successively quantifies the accuracy of the DOF-based SfM scheme (subsection 4.1), demonstrates the differences between feature and OF approaches when textures are missing (subsection 4.2), and highlight the robustness of the proposed method which can deal with very different scenes and acquisition conditions (subsection 4.3). The code (computation of homologous point groups usable as input by any SfM approach) and all data used in this section are given as supplementary material.

The proposed homologous point grouping method detailed in section 3.2 has three important parameters: overlap threshold τ in ( 14), cell size h in ( 16), and error threshold in [START_REF] Schönberger | Structure-from-motion revisited[END_REF]. The optimal values of these parameters are determined using a grid search method performed on the phantom data-sets. The quality criteria given in Section 4.1 were used to find the best values of triplet (τ, h, ). The optimal values of all parameters (including the OF parameters in Section 3.1) are summarized in Table 1. These parameter values were held constant for all experiments with the proposed SfM method. As in medical scenes where the acquisition is done close to the epithelial tissue, the camera/phantom surface distance was short so that each image only visualize a small object region. In these experiments, a state-of-the-art SfM method, namely COLMAP [START_REF] Schönberger | Structure-from-motion revisited[END_REF] which uses SIFT features [START_REF] Lowe | Distinctive image features from scale-invariant keypoints[END_REF], is placed in ideal conditions to find numerous correspondences. Thus, the accuracy of the proposed DOFbased SfM method can be evaluated through comparison with COLMAP3 . The parameters of COLMAP were set to the default values as given in [START_REF] Schönberger | Structure-from-motion revisited[END_REF]. Even published in 2016, COLMAP remains among the reference SfM methods in terms of accuracy and robustness. More recent publications, instead of improving strongly the accuracy and robustness, adapted the SfM principle to be, for instance, more suitable for different acquisition devices [START_REF] Nousias | Large-scale, metric structure from motion for unordered light fields[END_REF].

Skin surface phantom. The external cylinder surface with diameter D gt = 159.45mm is lined by skin images (see the left image in Fig. 5(a)). This phantom roughly simulates the shape of arm or leg parts. As in dermatology, the epithelium is on an external body surface and the camera which is close to the simulated tissues acquired a sequence of 621 images (two of the latter are shown on the right in Fig. 5(a)).

Internal hollow organ phantom. The inner surface of this phantom (see mm. A sequence of 265 small FoV images was acquired for this phantom.

Phantom reconstruction results

For the result evaluation, the 3D point clouds are first separated in two independent surface parts, namely the cylinder part and the sphere part. Then, a fitting technique is separately applied to each part to obtain the equations of the reconstructed cylinder and sphere surfaces. For each reconstruction, both the diameters of the cylinder and sphere surfaces (denoted by D and d, respectively), and information relating to inlier and outlier points are calculated.

A point of a reconstructed cloud is considered as an outlier when its distance to the estimated phantom surface is greater than 0.005.D (i.e., 0.5% of the cylinder diameter).

Four criteria are used to evaluate the accuracy of the reconstruction methods:

-The outlier rate (in %) corresponds to the ratio of the outlier number over the whole 3D point number of the cloud.

-The mean outlier error (in mm) gives the mean distance between outlier points and the fitted phantom surface.

-The 3D phantom shape accuracy is assessed by comparing the diameter ratio D/d of the reconstructed cylinder and sphere surfaces with their ground truth D gt /d gt . This criterion is defined by [START_REF] Shevchenko | A high resolution bladder wall map: Feasibility study[END_REF] in which p = 100% and p = 0% indicate a perfect and a completely wrong shape, respectively.

p = 1 - |D gt /d gt -D/d| D gt /d gt × 100%. (19)
-For COLMAP, the computation time criterion includes the total time of the SfM and MVS parts, while for the proposed method it only corresponds to the SfM part (it is recalled that COLMAP provides dense point clouds using the SfM step followed by the MVS step, whereas the proposed SfM method leads directly to dense point clouds). Experiments were performed on a HP Pavillion laptop with an Intel Core i5 1.60GHz and 16GB RAM and NVIDIA GeForce 940MX GPU.

Reconstruction accuracy for the skin surface phantom. For this test, the cloud computed by the proposed DOF-based SfM method includes 558397 3D points (see Fig. 6(b)). Among them, 20010 points are outliers (the outlier rate is 3.58%). The point cloud of COLMAP consists of 591126 points (see Fig. 6(a))

and the number of outlier points is 25359 (the outlier rate is 4.29%). The mean outlier error of the proposed SfM method is 7.5mm, while the same value is 6.92mm for COLMAP. D gt /d gt = 3.972 is the ground truth of this phantom.

The diameter ratios obtained with COLMAP and with the proposed DOF-based SfM method are 3.9462 (p = 99.35%) and 3.945 (p = 99.32%), respectively. of the proposed method since it is quite similar to that of COLMAP which has a high precision in presence of contrasted textures (the diameter ratios obtained by the two SfM methods are very close). However, reconstructing accurately surfaces with an SfM technique based on a DOF is a first important result (such accuracy obtained with a DOF-based SfM scheme is an original result).

Robustness of the DOF-based SfM scheme

Four gastroscopic images of size 640 × 482 pixels (image set {I 1 , I 2 , I 3 , I 4 }, see Fig. 8(a)) are used to illustrate the importance of a robust homologous point group determination in the frame of SfM applied to medical scenes. Both the proposed and the COLMAP SfM methods were applied to these images. It can be seen in Fig. 8(b) that the DOF-based approach led to a realistic pyloric antrum shape, while COLMAP was unable to reconstruct a surface.

Image pair

(I ref 2 , I 1 ) (I ref 2 , I 3 ) (I ref 2 , I 4 )
SIFT matches 33 23 18 OF correspondences 410 406 404 These differences in terms of reconstruction performances can be explained by the number of homologous points obtained with the SIFT and DOF approaches. Table 2 gives the number of correct homologous points obtained by COLMAP and the proposed SFM scheme for three image pairs. For COLMAP, only few tens of homologous points were found on these image pairs, while more than 400 correspondences were established using the DOF method.

As seen in Table 3 numerous point triplets and 368 point quadruplets obtained with the DOF fields enable to construct a part of the pyloric antrum region (stomach). On the contrary, only very few homologous point triplets and quadruplets were obtained with SIFT features. For this reason the COLMAP software completely failed in the reconstruction of the pyloric antrum region.

Tests on various medical scenes

In endoscopy, video-sequences are often not archived because they enable only an easy diagnosis during the examination itself. Video-sequences are also not optimal for lesion evolution assessment between two examinations since their visual comparison is very difficult. The proposed DOF-based SfM method can improve the efficiency of such medical examinations.

3D mosaicing of the pyloric antrum in gastroscopy

The inner stomach wall is scanned by an endoscope to find lesions like cancers or inflammations (chronic inflammations in the pylorc antrum region often lead the two modalities so that both WL and NBI video-sequences can be acquired.

Constructing FoV extended WL and NBI surfaces of the pyloric antrum has several advantages: i) it will lead to an original and medically interesting way to document a gastroscopic examination, ii) it will be a new information exchange media between gastroenterologists and other specialists, and iii) the comparison of two 3D mosaics built with video-sequences acquired at some weeks or month intervals will allow for an inflammation or cancer follow-up. between images, leading to both strong image distortion and significant resolution losses (only image I 1 is without resolution loss). On the other hand, due to accumulating registration errors, images which should be overlapped are in different (non-overlapping) places in the 2D mosaic plane. Thus, images I 809 to I 1101 should partly overlap the previous images of the sequence. The gaps without bladder texture in the 2D map are not due to tissue areas which were not scanned by the endoscope, but to an accumulating registration error that grows during the map construction. These registration errors are generally difficult to correct, even with sophisticated techniques as described in [START_REF] Weibel | Graph based construction of textured large field of view mosaics for bladder cancer diagnosis[END_REF]. In 2D mosaics it is not possible to distinguish between mosaicing errors and tissues that were not scanned by the endoscope. was chosen so that the 3D mosaic content can be visually compared to that of the 2D mosaic in Fig. 10(a). It can be seen that the surface is without gaps and that the bladder part was actually completely scanned by the endoscope. The dashed white line approximately represents the endoscope trajectory position computed for the 2D mosaic (this trajectory is not computed in the proposed SfM method). Also, contrary to Fig. 10(a) where the resolutions is strongly affected by the uncontrolled viewpoint changes of the camera, the resolution onto the surface is by far more constant since the image textures are projected on a realistic bladder shape surface part. The 3D mosaic can be archived and used as information media exchange and patient follow-up.

In urology, the fluorescence modality is a complementary modality often used to detect some bladder cancers in an early stage (with some cystoscopes it is possible to switch between the WL and fluorescence modalities). A 3D bladder surface was constructed with 84 fluorescence images5 .

3D skin mosaicing in dermatology

In dermatology, lesions like pressure ulcers or cancers have to be acquired with a high resolution. Pressure ulcers are usually lesions that are widespread over several images. Besides the fact that extended FoV images are required to represent them with a high resolution, it is also important to assess the lesion area evolution between two examinations. This evolution assessment is more precise on a 3D surface than on a 2D mosaic. Moreover, in countries like France, there is a lack of dermatologists in the countryside. A nurse often takes a few images of a wound at the patient's home and transmits them to a dermatologist in the city. An alternative would be to acquire a video-sequence of the interesting skin part and to transmit the data before or after the 3D surface construction. This would also allow for a virtual navigation around the body part under consideration without the presence of the patient. ). This colour differences, which do not affect the robustness of the proposed SfM technique owing to the used illumination invariant OF method, can be corrected.

Conclusion: global discussion and perspectives

An algorithm can be considered as being robust when it provides appropriate results for very different scene contents and acquisition conditions. In this paper, surface construction tests were presented on very different data. Surfaces with almost no textures (gastroscopy), with rather few textures (cystoscopy)

and with more textures (dermatology) were successfully reconstructed with the proposed DOF-based SfM method. These surfaces were reconstructed for hardly controllable camera trajectories and under strongly varying illumination conditions. Moreover, surface construction tests were conducted for very different imaging modalities, i.e. WL for all medical applications, NBI in gastroscopy and fluorescence in cystoscopy. All surface construction tests were performed with the constant algorithm parameters given in this paper. For the tested medical applications the described 3D reconstruction algorithm led systematically to consistent 3D shapes (in accordance with the anatomy of the organ), without discontinuities of textures or structures, as well as with an acceptable resolution regardless of the location observed on the surface. The robustness of the proposed solution is not only related to the fact that the OF-method provides numerous homologous points even without contrasted textures and structures.

This robustness is also due to the image grouping algorithm which allows for a 3D point reconstruction using a large number of homologous points seen in images taken under different viewpoints.

In the medical context of this work, the purpose of the proposed SfM method was not to construct very precise surfaces because hollow organs never have the same shape between two examinations or from one patient to another. However, the results on phantoms show that the precision of the proposed DOF-based SfM method can closely approach that of a method based on the detection of features (as with SIFT). The less accurate (non subpixel accuracy) homologous point matching with OF methods is compensated by the numerous correspondences provided by the flow field (the matched points are by far more numerous than those obtained with feature methods working with a subpixel accuracy).

Although the accuracy of the proposed DOF-based SfM can only approach that of state-of-the-art SfM methods when features can be detected, its robustness make it potentially interesting for other (non-medical) scenes with few textures.

Further test will be made to assess precisely the appropriateness of the method to other scenes.

Apart from the strengths mentioned above, the proposed method still has limitations that can be corrected. In endoscopy, the quality of numerous images is affected by defocussing/refocussing, motion blur, and floating objects, etc.

The proposed SfM algorithm should be associated to a more complete preprocessing step to improve image selection [START_REF] Ali | An objective comparison of detection and segmentation algorithms for artefacts in clinical endoscopy[END_REF]. Moreover, constructing the 3D surfaces in less than an hour allows for a second more reliable diagnosis after the medical examination, patient follow-up, examination traceability and information exchange between various specialists. However, this surface can currently not be available during the examination itself. The 3D reconstruction can be speeded-up from the algorithmic point of view (e.g., when available, combining feature information and OF information, see the very preliminary work in [START_REF] Phan | 3D surface reconstruction using dense optical flow combined to feature matching: Application to endoscopy[END_REF]) and from the informatics point of view (code optimizing and parallelization).

In this work, the medical scenes were almost rigid: the pyloric antrum region presents rather moderate surface deformations, the bladder is filled with an isotonic solution which rigidifies the organ surface, and the skin surface can be considered as completely rigid. A natural extension of the proposed reconstruction algorithm would be to adapt it to non-rigid scenes. Non-rigid structure from motion (NRSfM, [START_REF] Kumar | Scalable dense non-rigid structurefrom-motion: A grassmannian perspective[END_REF]) could be an appropriate principle for the development of a 3D reconstruction pipeline of medical scenes, for instance for facilitating the diagnosis of the Barret's esophagus.

Figure 1 :

 1 Figure 1: Comparison of two methods used to determine homologous points in two gastroscopic images. (a) Few homologous points obtained using SIFT and RANSAC. In the lower left image corners some false features points are due to specular refections. (b) Numerous homologous points found with the optical flow method proposed in this contribution.

  of images Is and It are modelled by an affine relationship between the colors. Both the multiplicative and the additive coefficients of the affine relationship are constant for all pixels of two homologous regions. Complex illumination changes can be modelled by choosing a size of 3 × 3 pixels for these regions (the illumination differences can by locally very strong since the values of the coefficients can vary for each small homologous region pairs of Is and It). The descriptor patches have the same size as the small regions in this illumination change model (3 × 3 pixels) and, as shown in this section, the values of the components of the descriptor vectors have to be independent of the values of the coefficients of the affine relationship between the colors.

  often include few contrasted textures and structures and are affected by strong illumination changes due, for instance, to viewpoint changes between two image acquisitions. Descriptor vector D (P I (x)) of the data-term in (3) has to capture weak intensity variations, while being invariant to illumination changes between I s and I t . The new descriptor perceives local intensity changes in patches P I (x) having a size of 3 × 3 pixels and centered on x. Twelve convolution kernels (K 1 , K 2 ,...,K 12 , see Fig. 2) are used to capture intensity variations in patches P g I (P g I are grey-level patches computed with the original RGB patches P I ). While kernels K d with d = 1, 2, . . . , 8 allow to encode gradient components approximating line segments with different orientations, kernels K d with d = 9, 10, 11, 12 are rather similar to corner detectors where the vertex of the detected corners are oriented in the direction of positive x-axis values (d = 10), of positive y-axis values (d = 9), of negative x-axis values (d = 12), or of negative y-axis values (d = 11). The twelve component vector D(P I ), is defined as follows.

Figure 2 :

 2 Figure 2: Convolution kernels used to compute the components of the new illuminationinvariant descriptor (vector D in (3)).

Figure 3 :

 3 Figure 3: HP-group example. Pairs (I ref i , I j ) consist both of consecutive and non-consecutive

Algorithm 1

 1 which favor groups consisting of numerous homologous points. From the practical point of view, such I ref i images are those including scene parts which are geometrically surrounded by other scene parts seen in numerous other images acquired from different viewpoints and having common areas with I ref i . References I ref i are images in S that simultaneously fulfill two conditions: (i) a reference image must be τ -overlapped with as much as possible of other images, and (ii) two reference images cannot be τ -overlapped. The first condition ensures that HP-groups involve numerous images, whereas the second condition favours the distribution of the 3D points over the complete surface. The proposed algorithm (see Algorithm 1) for the determination of reference images consists of two parts. Part 1: Determination of the τ -overlapped image sets. A set S i (with i = 1, 2, . . . , N ) of τ -overlapped images consists of all images I j of S which are τ -overlapped with I i , and of I i itself. For all image pairs (I i , I j ) with j = i, translation vector v i,j is computed differently depending on whether I i and I j are consecutive images or not. When |i -j| = 1 (consecutive images), translation v i,j is computed with (12). If |i -j| > 1 (nonconsecutive images), vector v i,j is obtained with (13). Set S i is updated with image I j only when the τ -overlap condition given in (14) is fulfilled for image pair (I i , I j ). This algorithm part leads to set G gathering all sets S i : G = {S 1 , S 2 , . . . , S N }. Reference image determination Input: Set S of N consecutive images I 1 , I 2 , . . . , I N , area threshold τ , and central flow field vectors c 1,2 , c 2,3 , . . ., c N -1,N

Part 2 :

 2 ) end while Output: Set Ω ref of images I ref i and their groups S i . Reference image determination. Let I ref i be a reference image and let Ω ref (Ω ref ⊂ S) be the set of reference images maximizing the number |S i | of τ -overlapped images of set S i associated with I ref i . At each iteration of part 2, the algorithm searches for set S i in G with the highest image number |S i |. Image I ref i is added to Ω ref ⊂ S and becomes a reference image. Before the next iteration, all image sets S j corresponding to an image I j ∈ S i are removed from set G. The iterative process ends when set G is empty. After the last iteration, all reference images are gathered in set Ω ref and image group S i is known for each I ref i . 3.2.3. Accurate point correspondences for a robust SfM step After obtaining the set of reference images Ω ref = {I ref i } i∈ Ẑ⊂Z (where Ẑ denotes the index set of the reference images) and the sets S i = {I j } j∈Zi⊂Z with i ∈ Ẑ, HP-groups can be easily established based on the DOF fields between images I ref i and their τ -overlapped images belonging to the sets S i . Suppose the DOF fields F i,j between I ref i and images I j in S i as determined. For every reference image I ref i in Ω ref , one first considers the set Ξ ref i

Figure 4 :

 4 Figure 4: Valid homologous points between image pair (I ref i , I j ). (a) Source image I ref i . (b)

  tureless image pair (I ref i , I j ) in Figs. 4(a)-4(b) is illustrated in Fig. 4(c). Only the OF vectors corresponding to black pixels which verify M i,j = 0 in Fig. 4(d) are used to determine the homologous point sets. Finally, a HP-group is defined by a point A i,ref xy in I ref i and all its homologous points in images I j ∈ S i . It is noticeable that with the proposed method

Figure 5 :

 5 Figure 5: Phantom data. (a) Snapshot of the external cylinder surface and two small FoV skin images.(b) Snapshot of the internal cylinder surface and two small FoV stomach images.

Fig. 5 (

 5 Fig. 5(b)) is covered with paper sheet printings of stomach images acquired during gastroscopies. The internal diameter D gt of the cylinder equals 191.8

Figure 6 :

 6 Figure 6: SfM results obtained for the skin phantom shown in Fig. 5(a). (a) 3D point cloud obtained with COLMAP [18] and zoom on the sphere region delineated by the green rectangle. (b) 3D point cloud obtained with the proposed method and zoom on the sphere.

Figure 7 :

 7 Figure 7: Internal phantom reconstruction results (same viewpoint as in 5(b)). (a) Point cloud given by COLMAP [18]. (b) Point cloud obtained with the proposed SfM method. (c) Textured triangle mesh obtained with the cloud in (b).

Figure 8 :

 8 Figure 8: Robustness tests on gastroscopic data.(a) Images acquired from four viewpoints and used to show the impact of the homologous point grouping efficiency on the robustness of a SfM method. (b) Two viewpoints of the pyloric antrum region surface reconstructed with the DOF-based SfM method.

  to cancers). The reference white light (WL) color modality is classically complemented by the narrow band imaging (NBI) modality in which inflammations can be earlier detected as in WL. A gastroscope often allow for switching between (a) (b)

Figure 9 :

 9 Figure 9: Pyloric antrum region surface obtained with the DOF-based SfM method in the white light modality. (a) Four colour images of the sequence of 191 frames. (b) Pyloric antrum region under to viewpoints.

Fig. 9 .Figure 10 :

 910 Fig. 9.(a) shows four images among 191 frames of a WL video-sequence. No textures and only few structures are visible in these images which are classically affected by reflections. The lack of textures impedes feature-based approaches to establish numerous correspondences, while the reflections lead to wrong matches. The pyloric antrum region surface constructed with the DOFbased SfM approach is presented under two viewpoints (i.e., at different orientations and scales) in Fig. 9.(b). With such surfaces, gastroenterologists are able to virtually navigate into the stomach after the examination. It is also noticeable that most of the reflections do not appear in the 3D mosaics since these illumination effects are not systematically present for all viewpoints on a same 3D point (viewpoints without reflections can be chosen during the surface

Fig. 10 (

 10 Fig. 10(b) shows the bladder surface reconstructed using the proposed DOFbased SfM method applied to the sequence of 1101 images. The orientation of the curved surface (the 3D shape is not very perceptible from this viewpoint)

Figure 11 :

 11 Figure 11: Leg reconstruction. (a) Snapshot of the leg. (b), (c), (d) Surface under three viewpoints.

Fig. 11 shows

 11 Fig.11shows the surface construction of a part of a leg seen in the snapshot given in Fig.11(a). The circle in Fig.11(a) encompasses a small wound which is clearly visible in the top view of the leg given in Fig.11(b). In the bottom view of the leg (see Fig.11(d)), the vertical light gradient is due to the camera viewpoint differences between the first and last images (the number of the last image is 130), which close the loop trajectory required for 360 degree scan of the leg (see the cross-sectional view of the leg in Fig.11(b)). This colour differences,

Table 1 :

 1 Constant parameter values used for experiments with the proposed DOF-based SfM method.

Table 2 :

 2 Number of correspondences determined between each image pair using SIFT features and DOF. Image groups I 1 , I ref 2 , I 3 I ref 2 , I 3 , I 4 I ref 2 , I 3 , I 4 I 1 , I ref 2 , I 3 , I 4

	OF	400 triplets 389 triplets 372 triplets 368 quadruplets
	SIFT	12 triplets	10 triplets	14 triplets	7 quadruplets

Table 3 :

 3 Number of homologous point triplets and quadruplets obtained with the SIFT features and DOF matches in Table2.

An overview video of the proposed algorithm and the MATLAB code for homologous point grouping can be downloaded from https://github.com/CRAN-BioSiS-Imaging/PR2020

The code can be downloaded at https://colmap.github.io/

See the video available at https://github.com/CRAN-BioSiS-Imaging/PR2020

See the video available at https://github.com/CRAN-BioSiS-Imaging/PR2020

Acknowledgments

This work was partially funded by the Agence Nationale de la Recherche in the frame of the EMMIE (Endoscopie MultiModale pour les lésions Inflammatoires de l'Estomac) project (ANR-15-CE17-0015).