View Javadoc
1   /*
2    * Copyright (C) 2017 Alberto Irurueta Carro (alberto@irurueta.com)
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package com.irurueta.ar.sfm;
18  
19  /**
20   * Listener to retrieve and and store required data to compute a 3D reconstruction
21   * from sparse image point correspondences.
22   */
23  public interface PairedViewsSparseReconstructorListener extends
24          BasePairedViewsSparseReconstructorListener<PairedViewsSparseReconstructor> {
25  
26      /**
27       * Requests baseline for the provided pair of views so that actual scale can be estimated
28       * to obtain cameras and reconstructed points in an Euclidean space (up to certain rotation and
29       * translation).
30       *
31       * @param reconstructor re-constructor raising this event.
32       * @param viewId1       id of previous view (i.e. 1st view).
33       * @param viewId2       id of current view (i.e. 2nd view).
34       * @param metricCamera1 estimated first metric camera.
35       * @param metricCamera2 estimated second metric camera
36       * @return baseline separating cameras.
37       */
38      double onBaselineRequested(final PairedViewsSparseReconstructor reconstructor, final int viewId1, final int viewId2,
39                                 final EstimatedCamera metricCamera1, final EstimatedCamera metricCamera2);
40  }