Structure from Motion (SfM) is getting ready for 3D reconstruction only using images, thanks to off-the-shelf softwares [1, 2, 3] and open-source libraries [4, 5, 6, 7, 8, 9, 10]. They provide impressive 3D models, especially, when targets are captured from many viewpoints with large overlaps. The state-of-the-art SfM pipelines, in general, start with extracting local features [11, 12, 13, 14, 15, 16, 17]
and matching them across images, followed by pose estimation, triangulation, and bundle adjustment[18, 19, 20]. The performance of local features and their matching, therefore, is crucial for 3D reconstruction by SfM.
In this decade, the performance of local features, namely, SIFT  and its variants [16, 21, 22, 23, 24] are validated on 3D reconstruction as well as many other tasks [25, 26, 27]. The local features give promising matches for well-textured surfaces/objects but significantly drop its performance for matching weakly-textured objects , repeated patterns , extreme changes of viewpoints [21, 30, 31] and illumination change [32, 33] because of degradation in repeatability of feature point (keypoint) extraction [21, 31]. This problem can be mitigated by using densely detected features on a regular grid [34, 35]
but their merit is only demonstrated in image retrieval[32, 36] or image classification tasks [26, 34] that use the features for global image representation and do not require one-to-one feature correspondences as in SfM.
Only recently, SfM with densely detected features are presented in . DenseSfM  uses convolutional neural network (CNN) features as densely detected features, i.e., it extracts convolutional layers of deep neural network  and converts them as feature descriptors of keypoints on a grid pattern (Section 3.1). As the main focus of  is camera localization, the SfM architecture including neither dense CNN feature description and matching nor its 3D reconstruction performance is not studied in detail.
In this work, we first review the details of the SfM pipeline with dense CNN feature extraction and matching. We then propose a keypoint relocalization that uses the structure of convolutional layers (Section3.2) to overcome keypoint inaccuracy on the grid resolution and computational burden of dense feature matching. Finally, the performance of SfM with dense CNN feature using the proposed keypoint relocalization is evaluated on Aachen Day-Night  dataset and additionally on Strecha  dataset.
2 Related work
In VisualSLAM approaches, namely, LSD-SLAM  and DTAM  repeat camera pose estimation based on selected keyframe and (semi-)dense reconstruction using the pixel-level correspondences in real-time. These methods are particularly designed to work with video streams, i.e., short baseline camera motion, but not with general wide-baseline camera motion.
Recently,  introduces CNN-based DenseSfM that adopts densely detected and described features. But, their SfM uses fixed poses and intrinsic parameters of reference images in evaluating the performance of query images localization. They also do not address keypoint inacuraccy of CNN features. Therefore, it remains as an open challenge.
Feature points. The defacto standard local feature, SIFT , is capable of matching images under viewpoint and illumination changes thanks to scale and rotation invariant keypoint patches described by histograms of the oriented gradient. ASIFT  and its variants [30, 31] explicitly generate synthesized views in order to improve repeatability of keypoint detection and description under extreme viewpoint changes.
An alternative approach to improve feature matching between images across extreme appearance changes is to use densely sampled features from images. Densely detected features are often used in multi-view stereo  with DAISY , or image retrieval and classification [35, 47] with Dense SIFT . However, dense features are not spotlighted in the task of one-to-one feature correspondence search under unknown camera poses due to its loss of scale, rotation invariant, inaccuracy of localized keypoints, and computational burden.
CNN features. Fischer et al.  reported that, given feature positions, descriptors extracted from CNN layer have better matchability compared to SIFT . More recently, Schonberger et al.  also showed that CNN-based learned local features such as LIFT , Deep-Desc , and ConvOpt  have higher recall compared to SIFT  but still cannot outperform its variants, e.g., DSP-SIFT  and SIFT-PCA .
Those studies motivate us to adopt CNN architecture for extracting features from images and matching them for SfM as it efficiently outputs multi-resolution features and has potential to be improved by better training or architecture.
3 The pipeline: SfM using dense CNN features with keypoint relocalization
Our SfM using densely detected features mimics the state-of-the-art incremental SfM pipeline that consists of feature extraction (Section 3.1), feature matching (Section 3.2 to 3.4), and incremental reconstruction (Section 3.5). Figure 1 overviews the pipeline. In this section, we describe each component while stating the difference to the sparse keypoint based approaches.
3.1 Dense feature extraction
Firstly, our method densely extracts the feature descriptors and their locations from the input image. In the same spirit of [53, 54], we input images in a modern CNN architecture [38, 55, 56] and use the convolutional layers as densely detected keypoints on a regular grid, i.e
., cropping out the fully connected and softmax layers. In the following, we chose VGG-16 as the base network architecture and focus on the description tailored to it, but this can be replaced with other networks with marginal modification.
is composed of five max-pooling layers and 16 weight layers. We extract the max-pooling layers as dense features. As can be seen in Figure2, the conv1 max-pooling layer is not yet the same resolution as the input image. We, therefore, also extract conv1_2, one layer before the conv1 max-pooling layer, that has pixel-level accuracy.
3.2 Tentative matching
Given multi-level feature point locations and descriptors, tentative matching uses upper max-pooling layer (lower spatial resolution) to establish initial correspondences. This is motivated by that the upper max-pooling layer has a larger receptive field and encodes more semantic information [48, 57, 58] which potentially gives high matchability across appearance changes. Having the lower spatial resolution is also advantageous in the sense of computational efficiency.
For a pair of images, CNN descriptors are tentatively matched by searching their nearest neighbors (L2 distances) and refined by taking mutually nearest neighbors. Note that the standard ratio test  removes too many feature matches as neighborhood features on a regularly sampled grid tend to be similar to each other.
We perform feature descriptor matching for all the pairs of images or shortlisted images by image retrieval, e.g., NetVLAD .
3.3 Keypoint relocalization
The tentative matching using the upper max-pooling layers, e.g., conv5, generates distinctive correspondences but the accuracy of keypoint position is limited by their spatial resolution. This inaccuracy of keypoints can be mitigated by a coarse-to-fine matching from the extracted max-pooling layer up to conv1_2 layer utilizing extracted intermediate max-pooling layers between them.
For example, the matched keypoints found on the conv3 layer are transferred to the conv2 (higher spatial resolution) and new correspondences are searched only in the area constrained by the transferred keypoints. This can be repeated until reaching conv1_2 layer. However, this naive coarse-to-fine matching generates too many keypoints that may lead to a problem in computational and memory usage in incremental SfM step, especially, bundle adjustment.
To generate dense feature matches with pixel-level accuracy while preserving their quantity, we propose a method of keypoint relocalization as follows.
For each feature point at the current layer, we retrieve the descriptors on the lower layer (higher spatial resolution) in the corresponding pixels111We use throughout the experiments.. The feature point is relocalized at the pixel position that has the largest descriptor norm (L2 norm) in the pixels. This relocalization is repeated until it reaches the conv1_2 layer which has the same resolution as the input image (see also Figure 3).
3.4 Feature verification using RANSAC with multiple homographies
Using all the relocated feature points, we next remove outliers from a set of tentative matches by Homography-RANSAC. We rather use a vanilla RANSAC instead of the state-of-the-art spatial verification by taking into account the spatial density of feature correspondences. To detect inlier matches lying on several planes, Homography-RANSAC is repeated while excluding the inlier matches of the best hypothesis. The RANSAC inlier/outlier threshold is set to be loose to allow features off the planes.
3.5 3D reconstruction
Having all the relocalized keypoints filtered by RANSAC, we can export them to any available pipelines that perform pose estimation, point triangulation, and bundle adjustment.
Dense matching may produce many confusing feature matches on the scene with many repetitive structures, e.g., windows, doors, pillars, etc. In such cases, we keep only the best matching image pairs for each image in the dataset based on the number of inlier matches of multiple Homography-RANSAC.
We implement feature detection, description and matching (Sections 3.1 to 3.4) in MATLAB with third-party libraries (MatConvNet  and Yael library ). Dense CNN features are extracted using the VGG-16 network . Using conv4 and conv3 max-pooling layers, feature matches are computed by the coarse-to-fine matching followed by multiple Homography-RANSAC that finds at most five homographies supported by an inlier threshold of 10 pixels. The best pairs based on multiple Homography-RANSAC of every image are imported to COLMAP  with the fixed intrinsic parameter option for scene with many repetitive structures. Otherwise, we use all the image pairs.
In our preliminary experiments, we tested other layers having the same spatial resolution, e.g., using conv4_3 and conv3_3 layers in the coarse-to-fine matching but we observed no improvement in 3D reconstruction. As a max-pooling layer has a half depth dimension in comparison with the other layers at the same spatial resolution, we chose the max-pooling layer as the dense features for efficiency.
In the following, we evaluate the reconstruction performance on Aachen Day-Night  and Strecha  dataset. We compare our SfM using dense CNN features with keypoint relocalization to the baseline COLMAP with DoG+RootSIFT features . In addition, we also compare our SfM to SfM using dense CNN without keypoint relocalization . All experiments are tested on a computer equipped with a 3.20GHz Intel Core i7-6900K CPU with 16 threads and a 12GB GeForce GTX 1080Ti.
4.1 Results on Aachen Day-Night dataset
The Aachen Day-Night dataset  is aimed for evaluating SfM and visual localization under large illumination changes such as day and night. It includes 98 subsets of images. Each subset consists of 20 day-time images and one night-time image, their reference camera poses, and 3D points 222Although the poses are carefully obtained with manual verification, the poses are called as “reference poses” but not ground truth..
For each subset, we run SfM and evaluate the estimated camera pose of the night image as follows. First, the reconstructed SfM model is registered to the reference camera poses by adopting a similarity transform obtained from the camera positions of day-time images. We then evaluate the estimated camera pose of the night image by measuring positional (L2 distance) and angular () error.
Table 1 shows the number of reconstructed cameras. The proposed SfM with keypoint relocalization (conv1_2) can reconstruct 96 night images that are twice as many as that of the baseline method using COLMAP with DoG+RootSIFT . This result validates the benefit of densely detected features that can provide correspondences across large illumination changes as they have smaller loss in keypoint detection repeatablity than a standard DoG. On the other hand, both methods with sparse and dense features work well for reconstructing day images. The difference between with and without keypoint localization can be seen more clearly in the next evaluation.
|RootSIFT ||w/o reloc||w/ reloc (Ours)|
Figure 4 shows the percentages of night images reconstructed (y-axis) within certain positional and angular error threshold (x-axis). Similarly, Table 2 shows the reconstruction percentages of night images for varying distance error thresholds with a fixed angular error threshold at ten degrees. As can be seen from both evaluations, the proposed SfM using dense CNN features with keypoint relocalization outperforms the baseline DoG+RootSIFT  by a large margin. The improvement by the proposed keypoint relocalization is significant when the evaluation accounts for pose accuracy. Notice that the SfM using dense CNN without keypoint relocalization  performs worse than the baseline DoG+RootSIFT  at small thresholds, e.g., below meters position and angular error. This indicates that the proposed keypoint relocalization gives features at more stable and accurate positions and provides better inlier matches for COLMAP reconstruction which results 3D reconstruction in higher quality.
|RootSIFT ||w/o reloc||w/ reloc (Ours)|
4.2 Results on Strecha dataset
We additionally evaluate our SfM using dense CNN with the proposed keypoint relocalization on all six subsets of Strecha dataset  which is a standard benchmark dataset for SfM and MVS. Position and angular error between the reconstructed cameras and the ground truth poses are evaluated. In our SfM, we take only feature matches from the best image pairs for each image to suppress artifacts from confusing image pairs.
The mean average position and angular errors resulted by our SfM are meters and degrees. Although these errors are worse than those of the state-of-the-art COLMAP with DoG+RootSIFT  which are meters and degrees, the quantitative evaluation on the Strecha dataset demonstrated that our SfM does not overfit to specific challenging tasks but works reasonably well for standard (easy) situations.
We presented a new SfM using dense features extracted from CNN with the proposed keypoint relocalization to improve the accuracy of feature positions sampled on a regular grid. The advantage of our SfM has demonstrated on the Aachen Day-Night dataset that includes images with large illumination changes. The result on the Strecha dataset also showed that our SfM works for standard datasets and does not overfit to a particular task although it is less accurate than the state-of-the-art SfM with local features. We wish the proposed SfM becomes a milestone in the 3D reconstruction, in particularly, challenging situations.
-  Pix4D - Professional drone mapping and photogrammetry software. https://pix4d.com/
-  Agisoft Photoscan. http://www.agisoft.com/
-  Discover Photogrammetry Software - Photomodeler. http://www.photomodeler.com/index.html
-  Fuhrmann, S., Langguth, F., Goesele, M.: MVE-A Multi-View Reconstruction Environment. In: GCH, pp. 11–18 (2014)
-  Sweeney, C., Hollerer, T., Turk, M.: Theia: A fast and scalable structure-from-motion library. In: Proc. ACMM, pp. 693–696 (2015)
-  Schonberger, J.L., Frahm, J.-M.: Structure-from-motion revisited. In: Proc. CVPR, pp. 4104–4113 (2016)
-  Schönberger, J.L., Zheng, E., Frahm, J.-M., Pollefeys, M.: Pixelwise view selection for unstructured multi-view stereo. In: Proc. ECCV, pp. 501–518 (2016)
-  Wilson, K., Snavely, N.: Robust global translations with 1dsfm. In: Proc. ECCV, pp. 61–75 (2014). Springer
Moulon, P., Monasse, P., Perrot, R., Marlet, R.: OpenMVG: Open multiple view geometry. In: International Workshop on Reproducible Research in Pattern Recognition, pp. 60–74 (2016)
-  Cui, H., Gao, X., Shen, S., Hu, Z.: Hsfm: Hybrid structure-from-motion
-  Lowe, D.G.: Distinctive image features from scale-invariant keypoints. IJCV 60(2), 91–110 (2004)
-  Mikolajczyk, K., Schmid, C.: Scale & affine invariant interest point detectors. IJCV 60(1), 63–86 (2004)
-  Kadir, T., Zisserman, A., Brady, M.: An affine invariant salient region detector. In: Proc. ECCV, pp. 228–241 (2004). Springer
-  Tuytelaars, T., Van Gool, L.: Matching widely separated views based on affine invariant regions. IJCV 59(1), 61–85 (2004)
-  Arandjelović, R., Zisserman, A.: Three things everyone should know to improve object retrieval. In: Proc. CVPR, pp. 2911–2918 (2012). IEEE
-  Dong, J., Soatto, S.: Domain-size pooling in local descriptors: Dsp-sift. In: Proc. CVPR, pp. 5097–5106 (2015). IEEE
-  Yi, K.M., Trulls, E., Lepetit, V., Fua, P.: Lift: Learned invariant feature transform. In: Proc. ECCV, pp. 467–483 (2016)
-  Snavely, N., Seitz, S.M., Szeliski, R.: Modeling the world from internet photo collections. IJCV 80(2), 189–210 (2008)
-  Agarwal, S., Furukawa, Y., Snavely, N., Curless, B., Seitz, S.M., Szeliski, R.: Reconstructing rome. Computer 43(6), 40–47 (2010)
-  Agarwal, S., Furukawa, Y., Snavely, N., Simon, I., Curless, B., Seitz, S.M., Szeliski, R.: Building rome in a day. Communications of the ACM 54(10), 105–112 (2011)
-  Morel, J.-M., Yu, G.: Asift: A new framework for fully affine invariant image comparison. SIAM journal on imaging sciences 2(2), 438–469 (2009)
-  Ke, Y., Sukthankar, R.: Pca-sift: A more distinctive representation for local image descriptors. In: Proc. CVPR, vol. 2, p. (2004). IEEE
-  Abdel-Hakim, A.E., Farag, A.A.: Csift: A sift descriptor with color invariant characteristics. In: Proc. CVPR, vol. 2, pp. 1978–1983 (2006). IEEE
-  Bay, H., Tuytelaars, T., Van Gool, L.: Surf: Speeded up robust features. In: Proc. ECCV, pp. 404–417 (2006). Springer
-  Csurka, G., Dance, C., Fan, L., Willamowski, J., Bray, C.: Visual categorization with bags of keypoints. In: Proc. ECCV, vol. 1, pp. 1–2 (2004). Prague
-  Lazebnik, S., Schmid, C., Ponce, J.: Beyond bags of features: Spatial pyramid matching for recognizing natural scene categories. In: Proc. CVPR, vol. 2, pp. 2169–2178 (2006). IEEE
Chong, W., Blei, D., Li, F.-F.: Simultaneous image classification and annotation. In: Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference On, pp. 1903–1910 (2009). IEEE
-  Hinterstoisser, S., Cagniart, C., Ilic, S., Sturm, P., Navab, N., Fua, P., Lepetit, V.: Gradient response maps for real-time detection of textureless objects. IEEE PAMI 34(5), 876–888 (2012)
-  Torii, A., Sivic, J., Pajdla, T., Okutomi, M.: Visual place recognition with repetitive structures. In: Proc. CVPR, pp. 883–890 (2013). IEEE
-  Mishkin, D., Matas, J., Perdoch, M.: Mods: Fast and robust method for two-view matching. CVIU 141, 81–93 (2015)
-  Taira, H., Torii, A., Okutomi, M.: Robust feature matching by learning descriptor covariance with viewpoint synthesis. In: Proc. ICPR, pp. 1953–1958 (2016). IEEE
-  Torii, A., Arandjelović, R., Sivic, J., Okutomi, M., Pajdla, T.: 24/7 place recognition by view synthesis. In: Proc. CVPR, pp. 1808–1817 (2015)
-  Radenovic, F., Schonberger, J.L., Ji, D., Frahm, J.-M., Chum, O., Matas, J.: From dusk till dawn: Modeling in the dark. In: Proc. CVPR, pp. 5488–5496 (2016)
Bosch, A., Zisserman, A., Munoz, X.: Image classification using random forests and ferns. In: Proc. ICCV, pp. 1–8 (2007)
-  Liu, C., Yuen, J., Torralba, A.: Sift flow: Dense correspondence across scenes and its applications. In: Dense Image Correspondences for Computer Vision, pp. 15–49 (2016)
-  Zhao, W.-L., Jégou, H., Gravier, G.: Oriented pooling for dense and non-dense rotation-invariant features. In: Proc. BMVC. (2013)
-  Sattler, T., Maddern, W., Toft, C., Torii, A., Hammarstrand, L., Stenborg, E., Safari, D., Sivic, J., Pajdla, T., Pollefeys, M., Kahl, F., Okutomi, M.: Benchmarking 6dof outdoor visual localization in changing conditions. arXiv preprint arXiv:1707.09092 (2017)
-  Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
-  Strecha, C., Von Hansen, W., Van Gool, L., Fua, P., Thoennessen, U.: On benchmarking camera calibration and multi-view stereo for high resolution imagery. In: Proc. CVPR, pp. 1–8 (2008)
-  Wu, C.: Towards linear-time incremental structure from motion. In: Proc. 3DV, pp. 127–134 (2013)
-  Cui, Z., Tan, P.: Global structure-from-motion by similarity averaging. In: Proceedings of the IEEE International Conference on Computer Vision, pp. 864–872 (2015)
-  Magerand, L., Del Bue, A.: Practical projective structure from motion (p2sfm). In: Proc. CVPR, pp. 39–47 (2017)
-  Engel, J., Schöps, T., Cremers, D.: Lsd-slam: Large-scale direct monocular slam. In: Proc. ECCV, pp. 834–849 (2014). Springer
-  Newcombe, R.A., Lovegrove, S.J., Davison, A.J.: Dtam: Dense tracking and mapping in real-time. In: Proc. ICCV, pp. 2320–2327 (2011). IEEE
-  Furukawa, Y., Hernández, C., et al.: Multi-view stereo: A tutorial. Foundations and Trends® in Computer Graphics and Vision 9(1-2), 1–148 (2015)
-  Tola, E., Lepetit, V., Fua, P.: Daisy: An efficient dense descriptor applied to wide-baseline stereo. IEEE PAMI 32(5), 815–830 (2010)
-  Tuytelaars, T.: Dense interest points. In: Proc. CVPR, pp. 2281–2288 (2010). IEEE
-  Fischer, P., Dosovitskiy, A., Brox, T.: Descriptor matching with convolutional neural networks: a comparison to sift. arXiv preprint arXiv:1405.5769 (2014)
-  Schonberger, J.L., Hardmeier, H., Sattler, T., Pollefeys, M.: Comparative evaluation of hand-crafted and learned local features. In: Proc. CVPR, pp. 6959–6968 (2017)
-  Simo-Serra, E., Trulls, E., Ferraz, L., Kokkinos, I., Fua, P., Moreno-Noguer, F.: Discriminative learning of deep convolutional feature point descriptors. In: Proc. ICCV, pp. 118–126 (2015). IEEE
-  Simonyan, K., Vedaldi, A., Zisserman, A.: Learning local feature descriptors using convex optimisation. IEEE PAMI 36(8), 1573–1585 (2014)
-  Bursuc, A., Tolias, G., Jégou, H.: Kernel local descriptors with implicit rotation matching. In: Proc. ACMM, pp. 595–598 (2015). ACM
-  Arandjelovic, R., Gronat, P., Torii, A., Pajdla, T., Sivic, J.: NetVLAD: CNN architecture for weakly supervised place recognition. In: Proc. CVPR, pp. 5297–5307 (2016)
-  Radenović, F., Tolias, G., Chum, O.: CNN image retrieval learns from BoW: Unsupervised fine-tuning with hard examples. In: Proc. ECCV (2016)
-  Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., Rabinovich, A., et al.: Going deeper with convolutions. (2015). Proc. CVPR
-  He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proc. CVPR, pp. 770–778 (2016)
-  Berkes, P., Wiskott, L.: On the analysis and interpretation of inhomogeneous quadratic forms as receptive fields. Neural computation 18(8), 1868–1895 (2006)
-  Zeiler, M.D., Fergus, R.: Visualizing and understanding convolutional networks. In: European Conference on Computer Vision, pp. 818–833 (2014). Springer
-  Philbin, J., Chum, O., Isard, M., Sivic, J., Zisserman, A.: Object retrieval with large vocabularies and fast spatial matching. In: Proc. CVPR (2007)
-  Vedaldi, A., Lenc, K.: Matconvnet – convolutional neural networks for matlab. In: Proc. ACMM (2015)
-  Douze, M., Jégou, H.: The yael library. In: Proc. ACMM. MM ’14, pp. 687–690. ACM, New York, NY, USA (2014). doi:10.1145/2647868.2654892. http://doi.acm.org/10.1145/2647868.2654892