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  package com.irurueta.ar.sfm;
17  
18  import com.irurueta.ar.epipolar.CorrectorType;
19  import com.irurueta.ar.epipolar.estimators.FundamentalMatrixEstimatorMethod;
20  import com.irurueta.ar.epipolar.estimators.FundamentalMatrixRobustEstimator;
21  import com.irurueta.ar.epipolar.estimators.PROSACFundamentalMatrixRobustEstimator;
22  import com.irurueta.geometry.InhomogeneousPoint2D;
23  import com.irurueta.geometry.PinholeCameraIntrinsicParameters;
24  import com.irurueta.geometry.estimators.EPnPPointCorrespondencePinholeCameraEstimator;
25  import com.irurueta.geometry.estimators.PROSACEPnPPointCorrespondencePinholeCameraRobustEstimator;
26  import com.irurueta.geometry.estimators.PinholeCameraRobustEstimator;
27  import com.irurueta.geometry.estimators.ProjectiveTransformation2DRobustEstimator;
28  import com.irurueta.numerical.robust.RobustEstimatorMethod;
29  
30  import java.io.Serializable;
31  
32  /**
33   * Base class containing configuration for a sparse re-constructor supporting multiple views.
34   *
35   * @param <T> an actual implementation of a configuration class.
36   */
37  public abstract class BaseSparseReconstructorConfiguration<T extends BaseSparseReconstructorConfiguration<T>>
38          implements Serializable {
39  
40      /**
41       * Default robust fundamental matrix estimator method.
42       * This is only used when general scenes are allowed.
43       */
44      public static final RobustEstimatorMethod DEFAULT_ROBUST_FUNDAMENTAL_MATRIX_ESTIMATOR_METHOD =
45              RobustEstimatorMethod.PROSAC;
46  
47      /**
48       * Default non-robust fundamental matrix estimator method used internally within a robust estimator.
49       * This is only used when general scenes are allowed.
50       */
51      public static final FundamentalMatrixEstimatorMethod DEFAULT_NON_ROBUST_FUNDAMENTAL_MATRIX_ESTIMATOR_METHOD =
52              FundamentalMatrixEstimatorMethod.SEVEN_POINTS_ALGORITHM;
53  
54      /**
55       * Indicates that estimated fundamental matrix is refined by default using all found inliers.
56       * This is only used when general scenes are allowed.
57       */
58      public static final boolean DEFAULT_REFINE_FUNDAMENTAL_MATRIX = true;
59  
60      /**
61       * Indicates that fundamental matrix covariance is kept by default after the estimation.
62       * This is only used when general scenes are allowed.
63       */
64      public static final boolean DEFAULT_KEEP_FUNDAMENTAL_MATRIX_COVARIANCE = false;
65  
66      /**
67       * Default confidence of robustly estimated fundamental matrix. By default, this is 99%.
68       * This is only used when general scenes are allowed.
69       */
70      public static final double DEFAULT_FUNDAMENTAL_MATRIX_CONFIDENCE =
71              FundamentalMatrixRobustEstimator.DEFAULT_CONFIDENCE;
72  
73      /**
74       * Default maximum number of iterations to make while robustly estimating fundamental matrix.
75       * By default, this is 5000 iterations. This is only used when general scenes are allowed.
76       */
77      public static final int DEFAULT_FUNDAMENTAL_MATRIX_MAX_ITERATIONS =
78              FundamentalMatrixRobustEstimator.DEFAULT_MAX_ITERATIONS;
79  
80      /**
81       * Default threshold to determine whether samples for robust fundamental matrix estimation are
82       * inliers or not.
83       * This is only used when general scenes are allowed.
84       */
85      public static final double DEFAULT_FUNDAMENTAL_MATRIX_THRESHOLD =
86              PROSACFundamentalMatrixRobustEstimator.DEFAULT_THRESHOLD;
87  
88      /**
89       * Default value indicating that inlier data is kept after robust fundamental matrix estimation.
90       * This is only used when general scenes are allowed.
91       */
92      public static final boolean DEFAULT_FUNDAMENTAL_MATRIX_COMPUTE_AND_KEEP_INLIERS = true;
93  
94      /**
95       * Default value indicating that residual data is kept after robust fundamental matrix estimation.
96       * This is only used when general scenes are allowed.
97       */
98      public static final boolean DEFAULT_FUNDAMENTAL_MATRIX_COMPUTE_AND_KEEP_RESIDUALS = true;
99  
100     /**
101      * Default method to use for initial cameras' estimation.
102      */
103     public static final InitialCamerasEstimatorMethod DEFAULT_INITIAL_CAMERAS_ESTIMATOR_METHOD =
104             InitialCamerasEstimatorMethod.DUAL_ABSOLUTE_QUADRIC_AND_ESSENTIAL_MATRIX;
105 
106     /**
107      * Indicates whether an homogeneous point triangulator is used for point triangulation when Dual
108      * Absolute Quadric (DAQ) camera initialization is used.
109      */
110     public static final boolean DEFAULT_DAQ_USE_HOMOGENEOUS_POINT_TRIANGULATOR = true;
111 
112     /**
113      * Default aspect ratio for initial cameras.
114      */
115     public static final double DEFAULT_INITIAL_CAMERAS_ASPECT_RATIO = 1.0;
116 
117     /**
118      * Default horizontal principal point value to use for initial cameras estimation using
119      * Dual Image of Absolute Conic (DIAC) or Dual Absolute Quadric (DAQ) methods.
120      */
121     public static final double DEFAULT_INITIAL_CAMERAS_PRINCIPAL_POINT_X = 0.0;
122 
123     /**
124      * Default vertical principal point value to use for initial cameras estimation using
125      * Dual Image of Absolute Conic (DIAC) or Dual Absolute Quadric (DAQ) methods.
126      */
127     public static final double DEFAULT_INITIAL_CAMERAS_PRINCIPAL_POINT_Y = 0.0;
128 
129     /**
130      * Default corrector type to use for point triangulation when initial cameras are
131      * being estimated using either Dual Image of Absolute Conic (DIAC), Dual Absolute Quadric
132      * (DAQ) or essential matrix methods.
133      */
134     public static final CorrectorType DEFAULT_INITIAL_CAMERAS_CORRECTOR_TYPE = CorrectorType.SAMPSON_CORRECTOR;
135 
136     /**
137      * Default value indicating whether valid triangulated points are marked during initial
138      * cameras estimation using either Dual Image of Absolute Conic (DIAC) or essential matrix
139      * methods.
140      */
141     public static final boolean DEFAULT_INITIAL_CAMERAS_MARK_VALID_TRIANGULATED_POINTS = true;
142 
143     /**
144      * Indicates whether a general (points are laying in a general 3D position) scene is
145      * allowed.
146      * When true, an initial geometry estimation is attempted for general points.
147      */
148     public static final boolean DEFAULT_ALLOW_GENERAL_SCENE = true;
149 
150     /**
151      * Indicates whether a planar (points laying in a 3D plane) scene is allowed.
152      * When true, an initial geometry estimation is attempted for planar points.
153      */
154     public static final boolean DEFAULT_ALLOW_PLANAR_SCENE = true;
155 
156     /**
157      * Default robust planar homography estimator method.
158      * This is only used when planar scenes are allowed.
159      */
160     public static final RobustEstimatorMethod DEFAULT_ROBUST_PLANAR_HOMOGRAPHY_ESTIMATOR_METHOD =
161             RobustEstimatorMethod.PROMEDS;
162 
163     /**
164      * Indicates that planar homography is refined by default using all found inliers.
165      * This is only used when planar scenes are allowed.
166      */
167     public static final boolean DEFAULT_REFINE_PLANAR_HOMOGRAPHY = true;
168 
169     /**
170      * Indicates that planar homography covariance is kept by default after estimation.
171      * This is only used when planar scenes are allowed.
172      */
173     public static final boolean DEFAULT_KEEP_PLANAR_HOMOGRAPHY_COVARIANCE = false;
174 
175     /**
176      * Default confidence of robustly estimated planar homography. By default, this is 99%.
177      * This is only used when planar scenes are allowed.
178      */
179     public static final double DEFAULT_PLANAR_HOMOGRAPHY_CONFIDENCE =
180             ProjectiveTransformation2DRobustEstimator.DEFAULT_CONFIDENCE;
181 
182     /**
183      * Default maximum number of iterations to make while robustly estimating planar
184      * homography. By default, this is 5000 iterations.
185      * This is only used when planar scenes are allowed.
186      */
187     public static final int DEFAULT_PLANAR_HOMOGRAPHY_MAX_ITERATIONS =
188             ProjectiveTransformation2DRobustEstimator.DEFAULT_MAX_ITERATIONS;
189 
190     /**
191      * Default threshold to determine whether samples for robust projective 2D transformation
192      * estimation are inliers or not.
193      * This is only used when planar scenes are allowed.
194      */
195     public static final double DEFAULT_PLANAR_HOMOGRAPHY_THRESHOLD = 1e-3;
196 
197     /**
198      * Default value indicating that inlier data is kept after robust planar homography estimation.
199      * This is only used when planar scenes are allowed.
200      */
201     public static final boolean DEFAULT_PLANAR_HOMOGRAPHY_COMPUTE_AND_KEEP_INLIERS = true;
202 
203     /**
204      * Default value indicating that residual data is kept after robust planar homography
205      * estimation.
206      * This is only used when planar scenes are allowed.
207      */
208     public static final boolean DEFAULT_PLANAR_HOMOGRAPHY_COMPUTE_AND_KEEP_RESIDUALS = true;
209 
210     /**
211      * Default value indicating that additional cameras intrinsics are estimated using the
212      * Dual Absolute Quadric (DAQ).
213      */
214     public static final boolean DEFAULT_USE_DAQ_FOR_ADDITIONAL_CAMERAS_INTRINSICS = true;
215 
216     /**
217      * Default value indicating that additional cameras intrinsics are estimated using
218      * the Dual Image of Absolute Conic (DIAC).
219      */
220     public static final boolean DEFAULT_USE_DIAC_FOR_ADDITIONAL_CAMERAS_INTRINSICS = false;
221 
222     /**
223      * Default skewness for additional cameras when UPnP (Uncalibrated Perspective-n-Point)
224      * method is used for additional cameras estimation and neither Dual Image of Absolute
225      * Conic (DIAC) or Dual Absolute Quadric (DAQ) are estimated to find intrinsic
226      * parameters when adding new cameras.
227      */
228     public static final double DEFAULT_ADDITIONAL_CAMERAS_SKEWNESS = 0.0;
229 
230     /**
231      * Default horizontal coordinate of principal point for additional cameras when
232      * UPnP (Uncalibrated Perspective-n-Point) method is used for additional cameras
233      * estimation and neither Dual Image of Absolute Conic (DIAC) or Dual Absolute
234      * Quadric (DAQ) are estimated to find intrinsic parameters when adding new
235      * cameras.
236      */
237     public static final double DEFAULT_ADDITIONAL_CAMERAS_HORIZONTAL_PRINCIPAL_POINT = 0.0;
238 
239     /**
240      * Default vertical coordinate of principal point for additional cameras when
241      * UPnP (Uncalibrated Perspective-n-Point) method is used for additional cameras
242      * estimation and neither Dual Image of Absolute Conic (DIAC) or Dual Absolute
243      * Quadric (DAQ) are estimated to find intrinsic parameters when adding new
244      * cameras.
245      */
246     public static final double DEFAULT_ADDITIONAL_CAMERAS_VERTICAL_PRINCIPAL_POINT = 0.0;
247 
248     /**
249      * Default aspect ratio for additional cameras.
250      */
251     public static final double DEFAULT_ADDITIONAL_CAMERAS_ASPECT_RATIO = 1.0;
252 
253 
254     /**
255      * Indicates that by default EPnP (Efficient Perspective-n-Point) method is NOT
256      * used for additional cameras' estimation.
257      */
258     public static final boolean DEFAULT_USE_EPNP_FOR_ADDITIONAL_CAMERAS_ESTIMATION = false;
259 
260     /**
261      * Indicates that by default UPnP (Uncalibrated Perspective-n-Point) method is
262      * used for additional cameras' estimation.
263      */
264     public static final boolean DEFAULT_USE_UPNP_FOR_ADDITIONAL_CAMERAS_ESTIMATION = true;
265 
266     /**
267      * Default robust method to estimate additional cameras.
268      */
269     public static final RobustEstimatorMethod DEFAULT_ADDITIONAL_CAMERAS_ROBUST_ESTIMATION_METHOD =
270             RobustEstimatorMethod.PROSAC;
271 
272     /**
273      * Default value indicating that planar configuration is allowed for additional
274      * cameras estimation using either EPnP or UPnP.
275      */
276     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_ALLOW_PLANAR_CONFIGURATION =
277             EPnPPointCorrespondencePinholeCameraEstimator.DEFAULT_PLANAR_CONFIGURATION_ALLOWED;
278 
279     /**
280      * Default value indicating that dimension 2 null-space is allowed while estimating
281      * additional cameras using either EPnP or UPnP.
282      */
283     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_ALLOW_NULLSPACE_DIMENSION2 =
284             EPnPPointCorrespondencePinholeCameraEstimator.DEFAULT_NULLSPACE_DIMENSION2_ALLOWED;
285 
286     /**
287      * Default value indicating that dimension 3 null-space is allowed while estimating
288      * additional cameras using EPnP.
289      */
290     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_ALLOW_NULLSPACE_DIMENSION3 =
291             EPnPPointCorrespondencePinholeCameraEstimator.DEFAULT_NULLSPACE_DIMENSION3_ALLOWED;
292 
293     /**
294      * Default threshold to determine whether 3D matched points to estimate additional
295      * cameras are in a planar configuration.
296      */
297     public static final double DEFAULT_ADDITIONAL_CAMERAS_PLANAR_THRESHOLD =
298             EPnPPointCorrespondencePinholeCameraEstimator.DEFAULT_PLANAR_THRESHOLD;
299 
300     /**
301      * Default value indicating that additional cameras are refined to minimize overall
302      * projection error among all found inliers.
303      */
304     public static final boolean DEFAULT_REFINE_ADDITIONAL_CAMERAS = PinholeCameraRobustEstimator.DEFAULT_REFINE_RESULT;
305 
306     /**
307      * Default value indicating that covariance is kept after refining results of
308      * additional cameras estimation.
309      */
310     public static final boolean DEFAULT_KEEP_COVARIANCE_ADDITIONAL_CAMERAS = true;
311 
312     /**
313      * Default value indicating that fast refinement is used for additional cameras'
314      * estimation.
315      */
316     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_USE_FAST_REFINEMENT = true;
317 
318     /**
319      * Default confidence of estimated additional cameras, which is 99%. This means
320      * that with a probability of 99% estimation will be accurate because chosen
321      * sub-samples will be inliers.
322      */
323     public static final double DEFAULT_ADDITIONAL_CAMERAS_CONFIDENCE = PinholeCameraRobustEstimator.DEFAULT_CONFIDENCE;
324 
325     /**
326      * Default maximum allowed number of iterations for additional cameras estimation.
327      */
328     public static final int DEFAULT_ADDITIONAL_CAMERAS_MAX_ITERATIONS =
329             PinholeCameraRobustEstimator.DEFAULT_MAX_ITERATIONS;
330 
331     /**
332      * Default threshold to determine whether samples for robust pinhole camera estimation are
333      * inliers or not.
334      */
335     public static final double DEFAULT_ADDITIONAL_CAMERAS_THRESHOLD =
336             PROSACEPnPPointCorrespondencePinholeCameraRobustEstimator.DEFAULT_THRESHOLD;
337 
338     /**
339      * Default value indicating that inlier data is kept after additional camera estimation.
340      */
341     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_COMPUTE_AND_KEEP_INLIERS = true;
342 
343     /**
344      * Default value indicating that residual data is kept after additional camera estimation.
345      */
346     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_COMPUTE_AND_KEEP_RESIDUALS = true;
347 
348     /**
349      * Default value indicating that skewness is not suggested during additional cameras'
350      * estimation.
351      */
352     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_SKEWNESS_VALUE_ENABLED =
353             PinholeCameraRobustEstimator.DEFAULT_SUGGEST_SKEWNESS_VALUE_ENABLED;
354 
355     /**
356      * Default value of skewness to be suggested when suggestion is enabled during
357      * additional cameras' estimation.
358      * By default, suggested skewness is zero.
359      */
360     public static final double DEFAULT_ADDITIONAL_CAMERAS_SUGGESTED_SKEWNESS_VALUE =
361             PinholeCameraRobustEstimator.DEFAULT_SUGGESTED_SKEWNESS_VALUE;
362 
363     /**
364      * Default value indicating whether horizontal focal length value is suggested or not
365      * during additional cameras' estimation. By default, this is disabled.
366      */
367     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_HORIZONTAL_FOCAL_LENGTH_ENABLED =
368             PinholeCameraRobustEstimator.DEFAULT_SUGGEST_HORIZONTAL_FOCAL_LENGTH_ENABLED;
369 
370     /**
371      * Default value indicating whether vertical focal length value is suggested or not
372      * during additional cameras' estimation. By default, this is disabled.
373      */
374     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_VERTICAL_FOCAL_LENGTH_ENABLED =
375             PinholeCameraRobustEstimator.DEFAULT_SUGGEST_VERTICAL_FOCAL_LENGTH_ENABLED;
376 
377     /**
378      * Default value indicating whether aspect ratio is suggested or not. By default, this is
379      * disabled.
380      */
381     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_ASPECT_RATIO_ENABLED =
382             PinholeCameraRobustEstimator.DEFAULT_SUGGEST_ASPECT_RATIO_ENABLED;
383 
384     /**
385      * Default value of aspect ratio to be suggested when suggestion is enabled.
386      * By default, suggested aspect ratio is 1.0, although also -1.0 is a typical value
387      * when vertical coordinates increase downwards.
388      */
389     public static final double DEFAULT_ADDITIONAL_CAMERAS_SUGGESTED_ASPECT_RATIO_VALUE =
390             PinholeCameraRobustEstimator.DEFAULT_SUGGESTED_ASPECT_RATIO_VALUE;
391 
392     /**
393      * Default value indicating whether principal point is suggested or not. By default,
394      * this is disabled.
395      */
396     public static final boolean DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_PRINCIPAL_POINT_ENABLED =
397             PinholeCameraRobustEstimator.DEFAULT_SUGGEST_PRINCIPAL_POINT_ENABLED;
398 
399     /**
400      * Indicates that an homogeneous point triangulator will be used by default.
401      */
402     public static final boolean DEFAULT_USE_HOMOGENEOUS_POINT_TRIANGULATOR =
403             RobustSinglePoint3DTriangulator.DEFAULT_USE_HOMOGENEOUS_SOLUTION;
404 
405     /**
406      * Default robust point triangulator method.
407      */
408     public static final RobustEstimatorMethod DEFAULT_ROBUST_POINT_TRIANGULATOR_METHOD =
409             RobustSinglePoint3DTriangulator.DEFAULT_ROBUST_METHOD;
410 
411     /**
412      * Default confidence of robustly triangulated points. By default, this is 99%.
413      */
414     public static final double DEFAULT_POINT_TRIANGULATOR_CONFIDENCE =
415             RobustSinglePoint3DTriangulator.DEFAULT_CONFIDENCE;
416 
417     /**
418      * Default maximum number of iterations to make while robustly estimating
419      * triangulated points. By default, this is 5000 iterations.
420      */
421     public static final int DEFAULT_POINT_TRIANGULATOR_MAX_ITERATIONS =
422             RobustSinglePoint3DTriangulator.DEFAULT_MAX_ITERATIONS;
423 
424     /**
425      * Default threshold to determine whether samples for robust point triangulator are
426      * inliers or not.
427      */
428     public static final double DEFAULT_POINT_TRIANGULATOR_THRESHOLD =
429             PROSACRobustSinglePoint3DTriangulator.DEFAULT_THRESHOLD;
430 
431     /**
432      * Method to use for non-robust fundamental matrix estimation.
433      * This is only used when general scenes are allowed.
434      */
435     private FundamentalMatrixEstimatorMethod mNonRobustFundamentalMatrixEstimatorMethod =
436             DEFAULT_NON_ROBUST_FUNDAMENTAL_MATRIX_ESTIMATOR_METHOD;
437 
438     /**
439      * Method to use for robust fundamental matrix estimation.
440      * This is only used when general scenes are allowed.
441      */
442     private RobustEstimatorMethod mRobustFundamentalMatrixEstimatorMethod =
443             DEFAULT_ROBUST_FUNDAMENTAL_MATRIX_ESTIMATOR_METHOD;
444 
445     /**
446      * Indicates whether estimated fundamental matrix is refined among all found inliers.
447      * This is only used when general scenes are allowed.
448      */
449     private boolean refineFundamentalMatrix = DEFAULT_REFINE_FUNDAMENTAL_MATRIX;
450 
451     /**
452      * Indicates whether covariance of estimated fundamental matrix is kept after the
453      * estimation.
454      * This is only used when general scenes are allowed.
455      */
456     private boolean keepFundamentalMatrixCovariance = DEFAULT_KEEP_FUNDAMENTAL_MATRIX_COVARIANCE;
457 
458     /**
459      * Confidence of robustly estimated fundamental matrix.
460      * This is only used when general scenes are allowed.
461      */
462     private double fundamentalMatrixConfidence = DEFAULT_FUNDAMENTAL_MATRIX_CONFIDENCE;
463 
464     /**
465      * Maximum number of iterations to robustly estimate fundamental matrix.
466      * This is only used when general scenes are allowed.
467      */
468     private int fundamentalMatrixMaxIterations = DEFAULT_FUNDAMENTAL_MATRIX_MAX_ITERATIONS;
469 
470     /**
471      * Threshold to determine whether samples for robust fundamental matrix estimation are
472      * inliers or not.
473      * This is only used when general scenes are allowed.
474      */
475     private double fundamentalMatrixThreshold = DEFAULT_FUNDAMENTAL_MATRIX_THRESHOLD;
476 
477     /**
478      * Indicates whether inliers must be kept during robust fundamental matrix estimation.
479      * This is only used when general scenes are allowed.
480      */
481     private boolean fundamentalMatrixComputeAndKeepInliers = DEFAULT_FUNDAMENTAL_MATRIX_COMPUTE_AND_KEEP_INLIERS;
482 
483     /**
484      * Indicates whether residuals must be computed and kept during robust fundamental matrix
485      * estimation.
486      * This is only used when general scenes are allowed.
487      */
488     private boolean fundamentalMatrixComputeAndKeepResiduals = DEFAULT_FUNDAMENTAL_MATRIX_COMPUTE_AND_KEEP_RESIDUALS;
489 
490     /**
491      * Method to use for initial cameras' estimation.
492      */
493     private InitialCamerasEstimatorMethod initialCamerasEstimatorMethod = DEFAULT_INITIAL_CAMERAS_ESTIMATOR_METHOD;
494 
495     /**
496      * Indicates whether an homogeneous point triangulator is used for point triangulation
497      * when Dual Absolute Quadric (DAQ) camera initialization is used.
498      */
499     private boolean daqUseHomogeneousPointTriangulator = DEFAULT_DAQ_USE_HOMOGENEOUS_POINT_TRIANGULATOR;
500 
501     /**
502      * Aspect ratio for initial cameras.
503      */
504     private double initialCamerasAspectRatio = DEFAULT_INITIAL_CAMERAS_ASPECT_RATIO;
505 
506     /**
507      * Horizontal principal point value to use for initial cameras estimation using
508      * Dual Image of Absolute Conic (DIAC) or Dual Absolute Quadric (DAQ) methods.
509      */
510     private double principalPointX = DEFAULT_INITIAL_CAMERAS_PRINCIPAL_POINT_X;
511 
512     /**
513      * Vertical principal point value to use for initial cameras estimation using
514      * Dual Image of Absolute Conic (DIAC) or Dual Absolute Quadric (DAC) methods.
515      */
516     private double principalPointY = DEFAULT_INITIAL_CAMERAS_PRINCIPAL_POINT_Y;
517 
518     /**
519      * Corrector type to use for point triangulation when initial cameras are being estimated
520      * using either Dual Image of Absolute Conic (DIAC) or essential matrix methods or null
521      * if no corrector is used.
522      */
523     private CorrectorType initialCamerasCorrectorType = DEFAULT_INITIAL_CAMERAS_CORRECTOR_TYPE;
524 
525     /**
526      * Value indicating whether valid triangulated points are marked during initial
527      * cameras estimation using either Dual Image of Absolute Conic (DIAC) or essential
528      * matrix methods.
529      */
530     private boolean initialCamerasMarkValidTriangulatedPoints = DEFAULT_INITIAL_CAMERAS_MARK_VALID_TRIANGULATED_POINTS;
531 
532     /**
533      * Intrinsic parameters of first camera estimated using the essential matrix
534      * method.
535      */
536     private PinholeCameraIntrinsicParameters initialIntrinsic1;
537 
538     /**
539      * Intrinsic parameters of second camera estimated using the essential matrix
540      * method.
541      */
542     private PinholeCameraIntrinsicParameters initialIntrinsic2;
543 
544     /**
545      * Indicates whether a general scene (points laying in a general 3D position) is
546      * allowed.
547      * When true, an initial geometry estimation is attempted for general points.
548      */
549     private boolean allowGeneralScene = DEFAULT_ALLOW_GENERAL_SCENE;
550 
551     /**
552      * Indicates whether a planar scene (points laying in a 3D plane) is allowed.
553      * When true, an initial geometry estimation is attempted for planar points.
554      */
555     private boolean allowPlanarScene = DEFAULT_ALLOW_PLANAR_SCENE;
556 
557     /**
558      * Robust method to use for planar homography estimation.
559      * This is only used when planar scenes are allowed.
560      */
561     private RobustEstimatorMethod robustPlanarHomographyEstimatorMethod =
562             DEFAULT_ROBUST_PLANAR_HOMOGRAPHY_ESTIMATOR_METHOD;
563 
564     /**
565      * Indicates whether planar homography is refined using all found inliers or not.
566      * This is only used when planar scenes are allowed.
567      */
568     private boolean refinePlanarHomography = DEFAULT_REFINE_PLANAR_HOMOGRAPHY;
569 
570     /**
571      * Indicates whether planar homography covariance is kept after estimation.
572      * This is only used when planar scenes are allowed.
573      */
574     private boolean keepPlanarHomographyCovariance = DEFAULT_KEEP_PLANAR_HOMOGRAPHY_COVARIANCE;
575 
576     /**
577      * Confidence of robustly estimated planar homography. By default, this is 99%.
578      * This is only used when planar scenes are allowed.
579      */
580     private double planarHomographyConfidence = DEFAULT_PLANAR_HOMOGRAPHY_CONFIDENCE;
581 
582     /**
583      * Maximum number of iterations to make while robustly estimating planar homography.
584      * By default, this is 5000.
585      * This is only used when planar scenes are allowed.
586      */
587     private int planarHomographyMaxIterations = DEFAULT_PLANAR_HOMOGRAPHY_MAX_ITERATIONS;
588 
589     /**
590      * Threshold to determine whether samples for robust projective 2D transformation estimation
591      * are inliers or not.
592      */
593     private double planarHomographyThreshold = DEFAULT_PLANAR_HOMOGRAPHY_THRESHOLD;
594 
595     /**
596      * Value indicating that inlier data is kept after robust planar homography estimation.
597      * This is only used when planar scenes are allowed.
598      */
599     private boolean planarHomographyComputeAndKeepInliers = DEFAULT_PLANAR_HOMOGRAPHY_COMPUTE_AND_KEEP_INLIERS;
600 
601     /**
602      * Value indicating that residual data is kept after robust planar homography estimation.
603      * This is only used when planar scenes are allowed.
604      */
605     private boolean planarHomographyComputeAndKeepResiduals = DEFAULT_PLANAR_HOMOGRAPHY_COMPUTE_AND_KEEP_RESIDUALS;
606 
607     /**
608      * Indicates that additional cameras intrinsics are estimated using the Dual Absolute
609      * Quadric (DAQ).
610      */
611     private boolean useDAQForAdditionalCamerasIntrinsics = DEFAULT_USE_DAQ_FOR_ADDITIONAL_CAMERAS_INTRINSICS;
612 
613     /**
614      * Indicates that additional cameras intrinsics are estimated using the Dual Image of Absolute
615      * Conic (DIAC).
616      */
617     private boolean useDIACForAdditionalCamerasIntrinsics = DEFAULT_USE_DIAC_FOR_ADDITIONAL_CAMERAS_INTRINSICS;
618 
619     /**
620      * Intrinsic parameters to use for additional cameras estimation when neither
621      * Dual Image of Absolute Conic (DIAC) nor Dual Absolute Quadric (DAQ) are used
622      * for intrinsic parameters' estimation.
623      */
624     private PinholeCameraIntrinsicParameters additionalCamerasIntrinsics;
625 
626     /**
627      * Skewness for additional cameras when UPnP (Uncalibrated Perspective-n-Point) method
628      * is used for additional cameras' estimation.
629      */
630     private double additionalCamerasSkewness = DEFAULT_ADDITIONAL_CAMERAS_SKEWNESS;
631 
632     /**
633      * Horizontal coordinate of principal point for additional cameras when UPnP
634      * (Uncalibrated Perspective-n-Point) method is used for additional cameras estimation
635      * and neither Dual Image of Absolute Conic (DIAC) or Dual Absolute Quadric (DAQ) are
636      * estimated to find intrinsic parameters when adding new cameras.
637      */
638     private double additionalCamerasHorizontalPrincipalPoint = DEFAULT_ADDITIONAL_CAMERAS_HORIZONTAL_PRINCIPAL_POINT;
639 
640     /**
641      * Vertical coordinate of principal point for additional cameras when UPnP (Uncalibrated
642      * Perspective-n-Point) method is used for additional cameras estimation and neither Dual
643      * Image of Absolute Conic (DIAC) nor Dual Absolute Quadric (DAQ) are estimated to find
644      * intrinsic parameters when adding new cameras.
645      */
646     private double additionalCamerasVerticalPrincipalPoint = DEFAULT_ADDITIONAL_CAMERAS_VERTICAL_PRINCIPAL_POINT;
647 
648     /**
649      * Aspect ratio for additional cameras.
650      */
651     private double additionalCamerasAspectRatio = DEFAULT_ADDITIONAL_CAMERAS_ASPECT_RATIO;
652 
653     /**
654      * Indicates whether EPnP (Efficient Perspective-n-Point) method is used for additional
655      * cameras' estimation. Either EPnP or UPnP must be used for additional cameras'
656      * estimation.
657      */
658     private boolean useEPnPForAdditionalCamerasEstimation = DEFAULT_USE_EPNP_FOR_ADDITIONAL_CAMERAS_ESTIMATION;
659 
660     /**
661      * Indicates whether UPnP (Uncalibrated Perspective-n-Point) method is used for
662      * additional cameras' estimation. Either EPnP or UPnP must be used for additional
663      * cameras' estimation.
664      */
665     private boolean useUPnPForAdditionalCamerasEstimation = DEFAULT_USE_UPNP_FOR_ADDITIONAL_CAMERAS_ESTIMATION;
666 
667     /**
668      * Robust method to estimate additional cameras.
669      */
670     private RobustEstimatorMethod additionalCamerasRobustEstimationMethod =
671             DEFAULT_ADDITIONAL_CAMERAS_ROBUST_ESTIMATION_METHOD;
672 
673     /**
674      * Indicates whether planar configuration is allowed for additional cameras
675      * estimation using either EPnP or UPnP.
676      */
677     private boolean additionalCamerasAllowPlanarConfiguration = DEFAULT_ADDITIONAL_CAMERAS_ALLOW_PLANAR_CONFIGURATION;
678 
679     /**
680      * Indicates whether dimension 2 null-space is allowed while estimating additional
681      * cameras using either EPnP or UPnP.
682      */
683     private boolean additionalCamerasAllowNullspaceDimension2 = DEFAULT_ADDITIONAL_CAMERAS_ALLOW_NULLSPACE_DIMENSION2;
684 
685     /**
686      * Indicates whether dimension 3 null-space is allowed while estimating additional
687      * cameras using EPnP.
688      */
689     private boolean additionalCamerasAllowNullspaceDimension3 = DEFAULT_ADDITIONAL_CAMERAS_ALLOW_NULLSPACE_DIMENSION3;
690 
691     /**
692      * Threshold to determine whether 3D matched points to estimate additional cameras
693      * are in a planar configuration.
694      */
695     private double additionalCamerasPlanarThreshold = DEFAULT_ADDITIONAL_CAMERAS_PLANAR_THRESHOLD;
696 
697     /**
698      * Indicates whether additional cameras are refined to minimize overall projection
699      * error among all found inliers.
700      */
701     private boolean refineAdditionalCameras = DEFAULT_REFINE_ADDITIONAL_CAMERAS;
702 
703     /**
704      * Indicates whether covariance is kept after refining result of additional
705      * cameras' estimation.
706      */
707     private boolean keepCovarianceAdditionalCameras = DEFAULT_KEEP_COVARIANCE_ADDITIONAL_CAMERAS;
708 
709     /**
710      * Value indicating whether fast refinement is used for additional cameras' estimation.
711      */
712     private boolean additionalCamerasUseFastRefinement = DEFAULT_ADDITIONAL_CAMERAS_USE_FAST_REFINEMENT;
713 
714     /**
715      * Confidence of estimated additional cameras.
716      */
717     private double additionalCamerasConfidence = DEFAULT_ADDITIONAL_CAMERAS_CONFIDENCE;
718 
719     /**
720      * Maximum allowed number of iterations for additional cameras estimation.
721      */
722     private int additionalCamerasMaxIterations = DEFAULT_ADDITIONAL_CAMERAS_MAX_ITERATIONS;
723 
724     /**
725      * Threshold to determine whether samples for robust pinhole camera estimation are inliers or not.
726      */
727     private double additionalCamerasThreshold = DEFAULT_ADDITIONAL_CAMERAS_THRESHOLD;
728 
729     /**
730      * Indicates whether inliers must be kept during additional camera estimation.
731      */
732     private boolean additionalCamerasComputeAndKeepInliers = DEFAULT_ADDITIONAL_CAMERAS_COMPUTE_AND_KEEP_INLIERS;
733 
734     /**
735      * Indicates whether residuals must be computed and kept during additional camera estimation.
736      */
737     private boolean additionalCamerasComputeAndKeepResiduals = DEFAULT_ADDITIONAL_CAMERAS_COMPUTE_AND_KEEP_RESIDUALS;
738 
739     /**
740      * Value indicating whether skewness is not suggested during additional cameras'
741      * estimation.
742      */
743     private boolean additionalCamerasSuggestSkewnessValueEnabled =
744             DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_SKEWNESS_VALUE_ENABLED;
745 
746     /**
747      * Value of skewness to be suggested when suggestion is enabled during additional
748      * cameras' estimation.
749      */
750     private double additionalCamerasSuggestedSkewnessValue = DEFAULT_ADDITIONAL_CAMERAS_SUGGESTED_SKEWNESS_VALUE;
751 
752     /**
753      * Value indicating whether horizontal focal length value is suggested or not
754      * during additional cameras' estimation.
755      */
756     private boolean additionalCamerasSuggestHorizontalFocalLengthEnabled =
757             DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_HORIZONTAL_FOCAL_LENGTH_ENABLED;
758 
759     /**
760      * Value of suggested horizontal focal length during additional cameras' estimation.
761      */
762     private double additionalCamerasSuggestedHorizontalFocalLengthValue;
763 
764     /**
765      * Value indicating whether vertical focal length value is suggested or not
766      * during additional cameras' estimation.
767      */
768     private boolean additionalCamerasSuggestVerticalFocalLengthEnabled =
769             DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_VERTICAL_FOCAL_LENGTH_ENABLED;
770 
771     /**
772      * Value of suggested vertical focal length during additional cameras' estimation.
773      */
774     private double additionalCamerasSuggestedVerticalFocalLengthValue;
775 
776     /**
777      * Value indicating whether aspect ratio is suggested or not during
778      * additional cameras' estimation.
779      */
780     private boolean additionalCamerasSuggestAspectRatioEnabled =
781             DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_ASPECT_RATIO_ENABLED;
782 
783     /**
784      * Value of aspect ratio to be suggested when suggestion is enabled during
785      * additional cameras' estimation.
786      */
787     private double additionalCamerasSuggestedAspectRatioValue =
788             DEFAULT_ADDITIONAL_CAMERAS_SUGGESTED_ASPECT_RATIO_VALUE;
789 
790     /**
791      * Value indicating whether principal point is suggested or not during
792      * additional cameras' estimation.
793      */
794     private boolean additionalCamerasSuggestPrincipalPointEnabled =
795             DEFAULT_ADDITIONAL_CAMERAS_SUGGEST_PRINCIPAL_POINT_ENABLED;
796 
797     /**
798      * Value of principal point to be suggested when suggestion is enabled
799      * during additional cameras' estimation.
800      */
801     private InhomogeneousPoint2D additionalCamerasSuggestedPrincipalPointValue;
802 
803     /**
804      * Indicates whether homogeneous point triangulator must be used or not to
805      * estimate 3D points when only two matches are available.
806      */
807     private boolean useHomogeneousPointTriangulator = DEFAULT_USE_HOMOGENEOUS_POINT_TRIANGULATOR;
808 
809     /**
810      * Robust method for point triangulation when points are matched in more
811      * than two views.
812      */
813     private RobustEstimatorMethod robustPointTriangulatorMethod = DEFAULT_ROBUST_POINT_TRIANGULATOR_METHOD;
814 
815     /**
816      * Confidence of robustly triangulated points. By default, this is 99%.
817      */
818     private double pointTriangulatorConfidence = DEFAULT_POINT_TRIANGULATOR_CONFIDENCE;
819 
820     /**
821      * Maximum number of iterations to make while robustly estimating
822      * triangulated points. By default, this is 5000 iterations.
823      */
824     private int pointTriangulatorMaxIterations = DEFAULT_POINT_TRIANGULATOR_MAX_ITERATIONS;
825 
826     /**
827      * Threshold to determine whether samples for robust point triangulator are
828      * inliers or not.
829      */
830     private double pointTriangulatorThreshold = DEFAULT_POINT_TRIANGULATOR_THRESHOLD;
831 
832     /**
833      * Constructor.
834      */
835     protected BaseSparseReconstructorConfiguration() {
836     }
837 
838     /**
839      * Gets method to use for non-robust fundamental matrix estimation.
840      * This is only used when general scenes are allowed.
841      *
842      * @return method to use for non-robust fundamental matrix estimation.
843      */
844     public FundamentalMatrixEstimatorMethod getNonRobustFundamentalMatrixEstimatorMethod() {
845         return mNonRobustFundamentalMatrixEstimatorMethod;
846     }
847 
848     /**
849      * Sets method to use for non-robust fundamental matrix estimation.
850      * This is only used when general scenes are allowed.
851      *
852      * @param method method to use for non-robust fundamental matrix estimation.
853      * @return this instance so that method can be easily chained.
854      */
855     public T setNonRobustFundamentalMatrixEstimatorMethod(final FundamentalMatrixEstimatorMethod method) {
856         mNonRobustFundamentalMatrixEstimatorMethod = method;
857         //noinspection unchecked
858         return (T) this;
859     }
860 
861     /**
862      * Gets method to use for robust fundamental matrix estimation.
863      * This is only used when general scenes are allowed.
864      *
865      * @return method to use for robust fundamental matrix estimation.
866      */
867     public RobustEstimatorMethod getRobustFundamentalMatrixEstimatorMethod() {
868         return mRobustFundamentalMatrixEstimatorMethod;
869     }
870 
871     /**
872      * Sets method to use for robust fundamental matrix estimation.
873      * This is only used when general scenes are allowed.
874      *
875      * @param method method to use for robust fundamental matrix estimation.
876      * @return this instance so that method can be easily chained.
877      */
878     public T setRobustFundamentalMatrixEstimatorMethod(final RobustEstimatorMethod method) {
879         mRobustFundamentalMatrixEstimatorMethod = method;
880         //noinspection unchecked
881         return (T) this;
882     }
883 
884     /**
885      * Indicates whether estimated fundamental matrix is refined among all found inliers.
886      * This is only used when general scenes are allowed.
887      *
888      * @return true if fundamental matrix is refined, false otherwise.
889      */
890     public boolean isFundamentalMatrixRefined() {
891         return refineFundamentalMatrix;
892     }
893 
894     /**
895      * Specifies whether estimated fundamental matrix is refined among all found inliers.
896      * This is only used when general scenes are allowed.
897      *
898      * @param refineFundamentalMatrix true if fundamental matrix is refined, false otherwise.
899      * @return this instance so that method can be easily chained.
900      */
901     public T setFundamentalMatrixRefined(final boolean refineFundamentalMatrix) {
902         this.refineFundamentalMatrix = refineFundamentalMatrix;
903         //noinspection unchecked
904         return (T) this;
905     }
906 
907     /**
908      * Indicates whether covariance of estimated fundamental matrix is kept after the estimation.
909      * This is only used when general scenes are allowed.
910      *
911      * @return true if covariance is kept, false otherwise.
912      */
913     public boolean isFundamentalMatrixCovarianceKept() {
914         return keepFundamentalMatrixCovariance;
915     }
916 
917     /**
918      * Specifies whether covariance of estimated fundamental matrix is kept after the
919      * estimation.
920      * This is only used when general scenes are allowed.
921      *
922      * @param keepFundamentalMatrixCovariance true if covariance is kept, false otherwise.
923      * @return this instance so that method can be easily chained.
924      */
925     public T setFundamentalMatrixCovarianceKept(final boolean keepFundamentalMatrixCovariance) {
926         this.keepFundamentalMatrixCovariance = keepFundamentalMatrixCovariance;
927         //noinspection unchecked
928         return (T) this;
929     }
930 
931     /**
932      * Gets confidence of robustly estimated fundamental matrix.
933      * This is only used when general scenes are allowed.
934      *
935      * @return confidence of robustly estimated fundamental matrix.
936      */
937     public double getFundamentalMatrixConfidence() {
938         return fundamentalMatrixConfidence;
939     }
940 
941     /**
942      * Sets confidence of robustly estimated fundamental matrix.
943      * This is only used when general scenes are allowed.
944      *
945      * @param fundamentalMatrixConfidence confidence of robustly estimated fundamental matrix.
946      * @return this instance so that method can be easily chained.
947      */
948     public T setFundamentalMatrixConfidence(final double fundamentalMatrixConfidence) {
949         this.fundamentalMatrixConfidence = fundamentalMatrixConfidence;
950         //noinspection unchecked
951         return (T) this;
952     }
953 
954     /**
955      * Gets maximum number of iterations to robustly estimate fundamental matrix.
956      * This is only used when general scenes are allowed.
957      *
958      * @return maximum number of iterations to robustly estimate fundamental matrix.
959      */
960     public int getFundamentalMatrixMaxIterations() {
961         return fundamentalMatrixMaxIterations;
962     }
963 
964     /**
965      * Sets maximum number of iterations to robustly estimate fundamental matrix.
966      * This is only used when general scenes are allowed.
967      *
968      * @param fundamentalMatrixMaxIterations maximum number of iterations to robustly estimate
969      *                                       fundamental matrix.
970      * @return this instance so that method can be easily chained.
971      */
972     public T setFundamentalMatrixMaxIterations(final int fundamentalMatrixMaxIterations) {
973         this.fundamentalMatrixMaxIterations = fundamentalMatrixMaxIterations;
974         //noinspection unchecked
975         return (T) this;
976     }
977 
978     /**
979      * Gets threshold to determine whether samples for robust fundamental matrix estimation
980      * are inliers or not.
981      * This is only used when general scenes are allowed.
982      *
983      * @return threshold to determine whether samples for robust fundamental matrix
984      * estimation are inliers or not.
985      */
986     public double getFundamentalMatrixThreshold() {
987         return fundamentalMatrixThreshold;
988     }
989 
990     /**
991      * Sets threshold to determine whether samples for robust fundamental matrix
992      * estimation are inliers or not.
993      * This is only used when general scenes are allowed.
994      *
995      * @param fundamentalMatrixThreshold threshold to determine whether samples for
996      *                                   robust fundamental matrix estimation are inliers
997      *                                   or not.
998      * @return this instance so that method can be easily chained.
999      */
1000     public T setFundamentalMatrixThreshold(final double fundamentalMatrixThreshold) {
1001         this.fundamentalMatrixThreshold = fundamentalMatrixThreshold;
1002         //noinspection unchecked
1003         return (T) this;
1004     }
1005 
1006     /**
1007      * Indicates whether inliers must be kept during robust fundamental matrix estimation.
1008      * This is only used when general scenes are allowed.
1009      *
1010      * @return true if inliers must be kept during robust fundamental matrix estimation,
1011      * false otherwise.
1012      */
1013     public boolean getFundamentalMatrixComputeAndKeepInliers() {
1014         return fundamentalMatrixComputeAndKeepInliers;
1015     }
1016 
1017     /**
1018      * Specifies whether inliers must be kept during robust fundamental matrix estimation.
1019      * This is only used when general scenes are allowed.
1020      *
1021      * @param fundamentalMatrixComputeAndKeepInliers true if inliers must be kept during
1022      *                                               robust fundamental matrix estimation, false
1023      *                                               otherwise.
1024      * @return this instance so that method can be easily chained.
1025      */
1026     public T setFundamentalMatrixComputeAndKeepInliers(final boolean fundamentalMatrixComputeAndKeepInliers) {
1027         this.fundamentalMatrixComputeAndKeepInliers = fundamentalMatrixComputeAndKeepInliers;
1028         //noinspection unchecked
1029         return (T) this;
1030     }
1031 
1032     /**
1033      * Indicates whether residuals must be computed and kept during robust fundamental
1034      * matrix estimation.
1035      * This is only used when general scenes are allowed.
1036      *
1037      * @return true if residuals must be computed and kept, false otherwise.
1038      */
1039     public boolean getFundamentalMatrixComputeAndKeepResiduals() {
1040         return fundamentalMatrixComputeAndKeepResiduals;
1041     }
1042 
1043     /**
1044      * Specifies whether residuals must be computed and kept during robust fundamental
1045      * matrix estimation.
1046      * This is only used when general scenes are allowed.
1047      *
1048      * @param fundamentalMatrixComputeAndKeepResiduals true if residuals must be
1049      *                                                 computed and kept, false otherwise.
1050      * @return this instance so that method can be easily chained.
1051      */
1052     public T setFundamentalMatrixComputeAndKeepResiduals(final boolean fundamentalMatrixComputeAndKeepResiduals) {
1053         this.fundamentalMatrixComputeAndKeepResiduals = fundamentalMatrixComputeAndKeepResiduals;
1054         //noinspection unchecked
1055         return (T) this;
1056     }
1057 
1058     /**
1059      * Gets method to use for initial cameras' estimation.
1060      *
1061      * @return method to use for initial cameras' estimation.
1062      */
1063     public InitialCamerasEstimatorMethod getInitialCamerasEstimatorMethod() {
1064         return initialCamerasEstimatorMethod;
1065     }
1066 
1067     /**
1068      * Sets method to use for initial cameras' estimation.
1069      *
1070      * @param method method to use for initial cameras' estimation.
1071      * @return this instance so that method can be easily chained.
1072      */
1073     public T setInitialCamerasEstimatorMethod(final InitialCamerasEstimatorMethod method) {
1074         initialCamerasEstimatorMethod = method;
1075         //noinspection unchecked
1076         return (T) this;
1077     }
1078 
1079     /**
1080      * Indicates whether an homogeneous point triangulator is used for point triangulation
1081      * when Dual Absolute Quadric (DAQ) camera initialization is used.
1082      *
1083      * @return true if homogeneous point triangulator is used, false if an inhomogeneous
1084      * point triangulator is used instead.
1085      */
1086     public boolean getDaqUseHomogeneousPointTriangulator() {
1087         return daqUseHomogeneousPointTriangulator;
1088     }
1089 
1090     /**
1091      * Specifies whether an homogeneous point triangulator is used for point
1092      * triangulation when Dual Absolute Quadric (DAQ) camera initialization is used.
1093      *
1094      * @param daqUseHomogeneousPointTriangulator true if homogeneous point triangulator
1095      *                                           is used, false if inhomogeneous point
1096      *                                           triangulator is used instead.
1097      * @return this instance so that method can be easily chained.
1098      */
1099     public T setDaqUseHomogeneousPointTriangulator(final boolean daqUseHomogeneousPointTriangulator) {
1100         this.daqUseHomogeneousPointTriangulator = daqUseHomogeneousPointTriangulator;
1101         //noinspection unchecked
1102         return (T) this;
1103     }
1104 
1105     /**
1106      * Gets aspect ratio for initial cameras estimation using DAQ or DIAC methods.
1107      *
1108      * @return aspect ratio for initial cameras using DAQ or DIAC methods.
1109      */
1110     public double getInitialCamerasAspectRatio() {
1111         return initialCamerasAspectRatio;
1112     }
1113 
1114     /**
1115      * Sets aspect ratio for initial cameras using DAQ or DIAC methods.
1116      *
1117      * @param initialCamerasAspectRatio aspect ratio for initial cameras using DAQ or DIAC
1118      *                                  methods.
1119      * @return this instance so that method can be easily chained.
1120      */
1121     public T setInitialCamerasAspectRatio(final double initialCamerasAspectRatio) {
1122         this.initialCamerasAspectRatio = initialCamerasAspectRatio;
1123         //noinspection unchecked
1124         return (T) this;
1125     }
1126 
1127     /**
1128      * Gets horizontal principal point value to use for initial cameras estimation
1129      * using DIAC or DAQ methods.
1130      *
1131      * @return horizontal principal point value to use for initial cameras estimation
1132      * using DIAC or DAQ methods.
1133      */
1134     public double getPrincipalPointX() {
1135         return principalPointX;
1136     }
1137 
1138     /**
1139      * Sets horizontal principal point value to use for initial cameras estimation
1140      * using DIAC or DAQ methods.
1141      *
1142      * @param principalPointX horizontal principal point value to use for initial
1143      *                        cameras estimation using DIAC or DAQ methods.
1144      * @return this instance so that method can be easily chained.
1145      */
1146     public T setPrincipalPointX(final double principalPointX) {
1147         this.principalPointX = principalPointX;
1148         //noinspection unchecked
1149         return (T) this;
1150     }
1151 
1152     /**
1153      * Gets vertical principal point value to use for initial cameras estimation
1154      * using DIAC or DAQ methods.
1155      *
1156      * @return vertical principal point value to use for initial cameras
1157      * estimation using DIAC or DAQ methods.
1158      */
1159     public double getPrincipalPointY() {
1160         return principalPointY;
1161     }
1162 
1163     /**
1164      * Sets vertical principal point value to use for initial cameras estimation using
1165      * DIAC or DAQ methods.
1166      *
1167      * @param principalPointY vertical principal point value to use for initial cameras
1168      *                        estimation using DIAC or DAQ methods.
1169      * @return this instance so that method can be easily chained.
1170      */
1171     public T setPrincipalPointY(final double principalPointY) {
1172         this.principalPointY = principalPointY;
1173         //noinspection unchecked
1174         return (T) this;
1175     }
1176 
1177     /**
1178      * Gets corrector type to use for point triangulation when initial cameras are being
1179      * estimated using either DIAC or essential matrix methods or null if no corrector is
1180      * used.
1181      *
1182      * @return corrector type to use for point triangulation when initial cameras are
1183      * being estimated using either DIAC or essential matrix methods or null if no
1184      * corrector is used.
1185      */
1186     public CorrectorType getInitialCamerasCorrectorType() {
1187         return initialCamerasCorrectorType;
1188     }
1189 
1190     /**
1191      * Sets corrector type to use for point triangulation when initial cameras are being
1192      * estimated using either DIAC or essential matrix methods or null if no corrector
1193      * is used.
1194      *
1195      * @param type corrector type to use for point triangulation when initial cameras
1196      *             are being estimated using either DIAC or essential matrix methods
1197      *             or null if no corrector is used.
1198      * @return this instance so that method can be easily chained.
1199      */
1200     public T setInitialCamerasCorrectorType(final CorrectorType type) {
1201         initialCamerasCorrectorType = type;
1202         //noinspection unchecked
1203         return (T) this;
1204     }
1205 
1206     /**
1207      * Gets value indicating whether valid triangulated points are marked during initial
1208      * cameras estimation using either DIAC or essential matrix methods.
1209      *
1210      * @return value indicating whether valid triangulated points are marked during
1211      * initial cameras estimation using either DIAC or essential matrix methods.
1212      */
1213     public boolean getInitialCamerasMarkValidTriangulatedPoints() {
1214         return initialCamerasMarkValidTriangulatedPoints;
1215     }
1216 
1217     /**
1218      * Sets value indicating whether valid triangulated points are marked during initial
1219      * cameras estimation using either DIAC or essential matrix methods.
1220      *
1221      * @param initialCamerasMarkValidTriangulatedPoints value indicating whether valid
1222      *                                                  triangulated points are marked during
1223      *                                                  initial cameras estimation using
1224      *                                                  either DIAC or essential matrix
1225      *                                                  methods.
1226      * @return this instance so that method can be easily chained.
1227      */
1228     public T setInitialCamerasMarkValidTriangulatedPoints(final boolean initialCamerasMarkValidTriangulatedPoints) {
1229         this.initialCamerasMarkValidTriangulatedPoints = initialCamerasMarkValidTriangulatedPoints;
1230         //noinspection unchecked
1231         return (T) this;
1232     }
1233 
1234     /**
1235      * Intrinsic parameters of first camera estimated using the essential matrix method.
1236      *
1237      * @return parameters of first camera estimated using the essential matrix method.
1238      */
1239     public PinholeCameraIntrinsicParameters getInitialIntrinsic1() {
1240         return initialIntrinsic1;
1241     }
1242 
1243     /**
1244      * Sets intrinsic parameters of first camera estimated using the essential matrix
1245      * method.
1246      *
1247      * @param initialIntrinsic1 parameters of first camera estimated using the essential
1248      *                          matrix method.
1249      * @return this instance so that method can be easily chained.
1250      */
1251     public T setInitialIntrinsic1(final PinholeCameraIntrinsicParameters initialIntrinsic1) {
1252         this.initialIntrinsic1 = initialIntrinsic1;
1253         //noinspection unchecked
1254         return (T) this;
1255     }
1256 
1257     /**
1258      * Intrinsic parameters of second camera estimated using the essential matrix method.
1259      *
1260      * @return parameters of second camera estimated using the essential matrix method.
1261      */
1262     public PinholeCameraIntrinsicParameters getInitialIntrinsic2() {
1263         return initialIntrinsic2;
1264     }
1265 
1266     /**
1267      * Sets intrinsic parameters of second camera estimated using the essential matrix
1268      * method.
1269      *
1270      * @param initialIntrinsic2 parameters of second camera estimated using the essential
1271      *                          matrix method.
1272      * @return this instance so that method can be easily chained.
1273      */
1274     public T setInitialIntrinsic2(final PinholeCameraIntrinsicParameters initialIntrinsic2) {
1275         this.initialIntrinsic2 = initialIntrinsic2;
1276         //noinspection unchecked
1277         return (T) this;
1278     }
1279 
1280     /**
1281      * Indicates whether a general scene (points laying in a general 3D position) is
1282      * allowed.
1283      * When true, an initial geometry estimation is attempted for general points.
1284      *
1285      * @return true if general scene is allowed, false otherwise.
1286      */
1287     public boolean isGeneralSceneAllowed() {
1288         return allowGeneralScene;
1289     }
1290 
1291     /**
1292      * Specifies whether a general scene (points laying in a general 3D position) is
1293      * allowed.
1294      * When true, an initial geometry estimation is attempted for general points.
1295      *
1296      * @param allowGeneralScene true if general scene is allowed, false otherwise.
1297      * @return this instance so that method can be easily chained.
1298      */
1299     public T setGeneralSceneAllowed(final boolean allowGeneralScene) {
1300         this.allowGeneralScene = allowGeneralScene;
1301         //noinspection unchecked
1302         return (T) this;
1303     }
1304 
1305     /**
1306      * Indicates whether a planar scene (points laying in a 3D plane) is allowed or not.
1307      * When true, an initial geometry estimation is attempted for planar points.
1308      *
1309      * @return true if planar scene is allowed, false otherwise.
1310      */
1311     public boolean isPlanarSceneAllowed() {
1312         return allowPlanarScene;
1313     }
1314 
1315     /**
1316      * Specifies whether a planar scene (points laying in a 3D plane) is allowed or not.
1317      * When true, an initial geometry estimation is attempted for planar points.
1318      *
1319      * @param allowPlanarScene true if planar scene is allowed, false otherwise.
1320      * @return this instance so that method can be easily chained.
1321      */
1322     public T setPlanarSceneAllowed(final boolean allowPlanarScene) {
1323         this.allowPlanarScene = allowPlanarScene;
1324         //noinspection unchecked
1325         return (T) this;
1326     }
1327 
1328     /**
1329      * Gets robust method to use for planar homography estimation.
1330      * This is only used when planar scenes are allowed.
1331      *
1332      * @return robust method to use for planar homography estimation.
1333      */
1334     public RobustEstimatorMethod getRobustPlanarHomographyEstimatorMethod() {
1335         return robustPlanarHomographyEstimatorMethod;
1336     }
1337 
1338     /**
1339      * Sets robust method to use for planar homography estimation.
1340      * This is only used when planar scenes are allowed.
1341      *
1342      * @param robustPlanarHomographyEstimatorMethod robust method to use for planar
1343      *                                              homography estimation.
1344      * @return this instance so that method can be easily chained.
1345      */
1346     public T setRobustPlanarHomographyEstimatorMethod(
1347             final RobustEstimatorMethod robustPlanarHomographyEstimatorMethod) {
1348         this.robustPlanarHomographyEstimatorMethod = robustPlanarHomographyEstimatorMethod;
1349         //noinspection unchecked
1350         return (T) this;
1351     }
1352 
1353     /**
1354      * Indicates whether planar homography is refined using all found inliers or not.
1355      * This is only used when planar scenes are allowed.
1356      *
1357      * @return true if planar homography is refined, false otherwise.
1358      */
1359     public boolean isPlanarHomographyRefined() {
1360         return refinePlanarHomography;
1361     }
1362 
1363     /**
1364      * Specifies whether planar homography is refined using all found inliers or not.
1365      * This is only used when planar scenes are allowed.
1366      *
1367      * @param refinePlanarHomography true if planar homography must be refined, false
1368      *                               otherwise.
1369      * @return this instance so that method can be easily chained.
1370      */
1371     public T setPlanarHomographyRefined(final boolean refinePlanarHomography) {
1372         this.refinePlanarHomography = refinePlanarHomography;
1373         //noinspection unchecked
1374         return (T) this;
1375     }
1376 
1377     /**
1378      * Indicates whether planar homography covariance is kept after estimation.
1379      * This is only used when planar scenes are allowed.
1380      *
1381      * @return true if planar homography covariance is kept, false otherwise.
1382      */
1383     public boolean isPlanarHomographyCovarianceKept() {
1384         return keepPlanarHomographyCovariance;
1385     }
1386 
1387     /**
1388      * Specifies whether planar homography covariance is kept after estimation.
1389      * This is only used when planar scenes are allowed.
1390      *
1391      * @param keepPlanarHomographyCovariance true if planar homography covariance is
1392      *                                       kept, false otherwise.
1393      * @return this instance so that method can be easily chained.
1394      */
1395     public T setPlanarHomographyCovarianceKept(final boolean keepPlanarHomographyCovariance) {
1396         this.keepPlanarHomographyCovariance = keepPlanarHomographyCovariance;
1397         //noinspection unchecked
1398         return (T) this;
1399     }
1400 
1401     /**
1402      * Gets confidence of robustly estimated planar homography. By default, this is 99%.
1403      * This is only used when planar scenes are allowed.
1404      *
1405      * @return confidence of robustly estimated planar homography.
1406      */
1407     public double getPlanarHomographyConfidence() {
1408         return planarHomographyConfidence;
1409     }
1410 
1411     /**
1412      * Sets confidence of robustly estimated planar homography. By default, this is 99%.
1413      * This is only used when planar scenes are allowed.
1414      *
1415      * @param planarHomographyConfidence confidence of robustly estimated planar
1416      *                                   homography.
1417      * @return this instance so that method can be easily chained.
1418      */
1419     public T setPlanarHomographyConfidence(final double planarHomographyConfidence) {
1420         this.planarHomographyConfidence = planarHomographyConfidence;
1421         //noinspection unchecked
1422         return (T) this;
1423     }
1424 
1425     /**
1426      * Gets maximum number of iterations to make while robustly estimating planar
1427      * homography. By default, this is 5000.
1428      * This is only used when planar scenes are allowed.
1429      *
1430      * @return maximum number of iterations to make while robustly estimating planar
1431      * homography.
1432      */
1433     public int getPlanarHomographyMaxIterations() {
1434         return planarHomographyMaxIterations;
1435     }
1436 
1437     /**
1438      * Sets maximum number of iterations to make while robustly estimating planar
1439      * homography. By default, this is 5000.
1440      * This is only used when planar scenes are allowed.
1441      *
1442      * @param planarHomographyMaxIterations maximum number of iterations to make while
1443      *                                      robustly estimating planar homography.
1444      * @return this instance so that method can be easily chained.
1445      */
1446     public T setPlanarHomographyMaxIterations(final int planarHomographyMaxIterations) {
1447         this.planarHomographyMaxIterations = planarHomographyMaxIterations;
1448         //noinspection unchecked
1449         return (T) this;
1450     }
1451 
1452     /**
1453      * Gets threshold to determine whether samples for robust projective 2D
1454      * transformation estimation are inliers or not.
1455      * This is only used when planar scenes are allowed.
1456      *
1457      * @return threshold to robustly estimate projective 2D transformation.
1458      */
1459     public double getPlanarHomographyThreshold() {
1460         return planarHomographyThreshold;
1461     }
1462 
1463     /**
1464      * Sets threshold to determine whether samples for robust projective 2D
1465      * transformation estimation are inliers or not.
1466      * This is only used when planar scenes are allowed.
1467      *
1468      * @param planarHomographyThreshold threshold to robustly estimate projective 2D
1469      *                                  transformation.
1470      * @return this instance so that method can be easily chained.
1471      */
1472     public T setPlanarHomographyThreshold(final double planarHomographyThreshold) {
1473         this.planarHomographyThreshold = planarHomographyThreshold;
1474         //noinspection unchecked
1475         return (T) this;
1476     }
1477 
1478     /**
1479      * Gets value indicating that inlier data is kept after robust planar homography
1480      * estimation.
1481      * This is only used when planar scenes are allowed.
1482      *
1483      * @return true if inlier data is kept, false otherwise.
1484      */
1485     public boolean getPlanarHomographyComputeAndKeepInliers() {
1486         return planarHomographyComputeAndKeepInliers;
1487     }
1488 
1489     /**
1490      * Specifies whether inlier data is kept after robust planar homography estimation.
1491      * This is only used when planar scenes are allowed.
1492      *
1493      * @param planarHomographyComputeAndKeepInliers true if inlier data is kept, false
1494      *                                              otherwise.
1495      * @return this instance so that method can be easily chained.
1496      */
1497     public T setPlanarHomographyComputeAndKeepInliers(final boolean planarHomographyComputeAndKeepInliers) {
1498         this.planarHomographyComputeAndKeepInliers = planarHomographyComputeAndKeepInliers;
1499         //noinspection unchecked
1500         return (T) this;
1501     }
1502 
1503     /**
1504      * Gets value indicating that residual data is kept after robust planar homography
1505      * estimation.
1506      * This is only used when planar scenes are allowed.
1507      *
1508      * @return true if residual data is kept, false otherwise.
1509      */
1510     public boolean getPlanarHomographyComputeAndKeepResiduals() {
1511         return planarHomographyComputeAndKeepResiduals;
1512     }
1513 
1514     /**
1515      * Sets value indicating that residual data is kept after robust planar homography
1516      * estimation.
1517      * This is only used when planar scenes are allowed.
1518      *
1519      * @param planarHomographyComputeAndKeepResiduals true if residual data is kept,
1520      *                                                false otherwise.
1521      * @return this instance so that method can be easily chained.
1522      */
1523     public T setPlanarHomographyComputeAndKeepResiduals(final boolean planarHomographyComputeAndKeepResiduals) {
1524         this.planarHomographyComputeAndKeepResiduals = planarHomographyComputeAndKeepResiduals;
1525         //noinspection unchecked
1526         return (T) this;
1527     }
1528 
1529     /**
1530      * Indicates that additional cameras intrinsics are estimated using the Dual Absolute
1531      * Quadric (DAQ).
1532      *
1533      * @return true if additional cameras intrinsics are estimated using the Dual Absolute
1534      * Quadric (DAQ), false otherwise.
1535      */
1536     public boolean getUseDAQForAdditionalCamerasIntrinsics() {
1537         return useDAQForAdditionalCamerasIntrinsics;
1538     }
1539 
1540     /**
1541      * Specifies whether additional cameras intrinsics are estimated using the Dual Absolute
1542      * Quadric (DAQ).
1543      *
1544      * @param useDAQForAdditionalCamerasIntrinics true if additional cameras intrinsics
1545      *                                            are estimated using the Dual Absolute
1546      *                                            Quadric (DAQ), false otherwise.
1547      * @return this instance so that method can be easily chained.
1548      */
1549     public T setUseDAQForAdditionalCamerasIntrinics(final boolean useDAQForAdditionalCamerasIntrinics) {
1550         useDAQForAdditionalCamerasIntrinsics = useDAQForAdditionalCamerasIntrinics;
1551         //noinspection unchecked
1552         return (T) this;
1553     }
1554 
1555     /**
1556      * Indicates that additional cameras intrinsics are estimated using the Dual Image of Absolute
1557      * Conic (DIAC).
1558      *
1559      * @return true if additional cameras intrinsics are estimated using the Dual Image of Absolute Conic
1560      * (DIAC), false otherwise.
1561      */
1562     public boolean getUseDIACForAdditionalCamerasIntrinsics() {
1563         return useDIACForAdditionalCamerasIntrinsics;
1564     }
1565 
1566     /**
1567      * Specifies whether additional cameras intrinsics are estimated using the Dual Image of
1568      * Absolute Conic (DIAC).
1569      * It is not recommended to enable this setting as it has low accuracy.
1570      *
1571      * @param useDIACForAdditionalCamerasIntrinsics true if additional cameras intrinsics are
1572      *                                              estimated using the Dual Image of Absolute
1573      *                                              Conic (DIAC), false otherwise.
1574      * @return this instance so that method can be easily chained.
1575      */
1576     public T setUseDIACForAdditionalCamerasIntrinsics(final boolean useDIACForAdditionalCamerasIntrinsics) {
1577         this.useDIACForAdditionalCamerasIntrinsics = useDIACForAdditionalCamerasIntrinsics;
1578         //noinspection unchecked
1579         return (T) this;
1580     }
1581 
1582     /**
1583      * Gets intrinsic parameters to use for additional cameras estimation when neither
1584      * Dual Image of Absolute Conic (DIAC) nor Dual Absolute Quadric (DAQ) are used for
1585      * estimation of intrinsic parameters.
1586      *
1587      * @return intrinsic parameters to use for additional estimation of cameras.
1588      */
1589     public PinholeCameraIntrinsicParameters getAdditionalCamerasIntrinsics() {
1590         return additionalCamerasIntrinsics;
1591     }
1592 
1593     /**
1594      * Sets intrinsic parameters to use for additional cameras estimation when neither
1595      * Dual Image of Absolute Conic (DIAC) nor Dual Absolute Quadric (DAQ) are used for
1596      * estimation of intrinsic parameters.
1597      *
1598      * @param additionalCamerasIntrinsics intrinsic parameters to use for additional
1599      *                                    estimation of cameras.
1600      * @return this instance so that method can be easily chained.
1601      */
1602     public T setAdditionalCamerasIntrinsics(final PinholeCameraIntrinsicParameters additionalCamerasIntrinsics) {
1603         this.additionalCamerasIntrinsics = additionalCamerasIntrinsics;
1604         //noinspection unchecked
1605         return (T) this;
1606     }
1607 
1608     /**
1609      * Gets skewness for additional cameras when UPnP (Uncalibrated Perspective-n-Point)
1610      * method is used for additional estimation of cameras.
1611      *
1612      * @return skewness for additional cameras when UPnP method is used for additional
1613      * estimation of cameras.
1614      */
1615     public double getAdditionalCamerasSkewness() {
1616         return additionalCamerasSkewness;
1617     }
1618 
1619     /**
1620      * Sets skewness for additional cameras when UPnP (Uncalibrated Perspective-n-Point)
1621      * method is used for additional estimation of cameras.
1622      *
1623      * @param additionalCamerasSkewness skewness for additional cameras when UPnP method is
1624      *                                  used for additional estimation of cameras.
1625      * @return this instance so that method can be easily chained.
1626      */
1627     public T setAdditionalCamerasSkewness(final double additionalCamerasSkewness) {
1628         this.additionalCamerasSkewness = additionalCamerasSkewness;
1629         //noinspection unchecked
1630         return (T) this;
1631     }
1632 
1633     /**
1634      * Gets horizontal coordinate of principal point for additional cameras when UPnP
1635      * (Uncalibrated Perspective-n-Point) method is used for additional cameras
1636      * estimation and neither Dual Image of Absolute Conic (DIAC) or Dual Absolute
1637      * Quadric (DAQ) are estimated to find intrinsic parameters when adding new cameras.
1638      *
1639      * @return horizontal coordinate of principal point for additional cameras when
1640      * UPnP method is used for additional cameras estimation and neither DIAC nor DAQ
1641      * are estimated to find intrinsic parameters when adding new cameras.
1642      */
1643     public double getAdditionalCamerasHorizontalPrincipalPoint() {
1644         return additionalCamerasHorizontalPrincipalPoint;
1645     }
1646 
1647     /**
1648      * Sets horizontal coordinate of principal point for additional cameras when UPnP
1649      * (Uncalibrated Perspective-n-Point) method is used for additional cameras estimation
1650      * and neither Dual Image of Absolute Conic (DIAC) or Dual Absolute Quadric (DAQ) are
1651      * estimated to find intrinsic parameters when adding new cameras.
1652      *
1653      * @param additionalCamerasHorizontalPrincipalPoint horizontal coordinate of principal point
1654      *                                                  for additional cameras when UPnP method is
1655      *                                                  used for additional cameras estimation and
1656      *                                                  neither DIAC nor DAQ are estimated to find
1657      *                                                  intrinsic parameters when adding new cameras.
1658      * @return this instance so that method can be easily chained.
1659      */
1660     public T setAdditionalCamerasHorizontalPrincipalPoint(final double additionalCamerasHorizontalPrincipalPoint) {
1661         this.additionalCamerasHorizontalPrincipalPoint = additionalCamerasHorizontalPrincipalPoint;
1662         //noinspection unchecked
1663         return (T) this;
1664     }
1665 
1666     /**
1667      * Gets vertical coordinate of principal point for additional cameras when UPnP
1668      * (Uncalibrated Perspective-n-Point) method is used for additional cameras estimation
1669      * and neither Dual Image of Absolute Conic (DIAC) or Dual Absolute Quadric (DAQ) are
1670      * estimated to find intrinsic parameters when adding new cameras.
1671      *
1672      * @return vertical coordinate of principal point for additional cameras when UPnP
1673      * method is used for additional cameras estimation and neither DIAC nor DAQ are
1674      * estimated to find intrinsic parameters when adding new cameras.
1675      */
1676     public double getAdditionalCamerasVerticalPrincipalPoint() {
1677         return additionalCamerasVerticalPrincipalPoint;
1678     }
1679 
1680     /**
1681      * Sets vertical coordinate of principal point for additional cameras when UPnP
1682      * (Uncalibrated Perspective-n-Point) method is used for additional cameras
1683      * estimation and neither Dual Image of Absolute Conic (DIAC) or Dual Absolute Quadric
1684      * (DAQ) are estimated to find intrinsic parameters when adding new cameras.
1685      *
1686      * @param additionalCamerasVerticalPrincipalPoint vertical coordinate of principal
1687      *                                                point for additional cameras when UPnP
1688      *                                                method is used for additional cameras
1689      *                                                estimation and neither DIAC nor DAQ
1690      *                                                are estimated to find intrinsic
1691      *                                                parameters when adding new cameras.
1692      * @return this instance so that method can be easily chained.
1693      */
1694     public T setAdditionalCamerasVerticalPrincipalPoint(final double additionalCamerasVerticalPrincipalPoint) {
1695         this.additionalCamerasVerticalPrincipalPoint = additionalCamerasVerticalPrincipalPoint;
1696         //noinspection unchecked
1697         return (T) this;
1698     }
1699 
1700     /**
1701      * Gets aspect ratio for additional cameras estimation using DAQ or DIAC methods.
1702      *
1703      * @return aspect ratio for additional cameras using DAQ or DIAC methods.
1704      */
1705     public double getAdditionalCamerasAspectRatio() {
1706         return additionalCamerasAspectRatio;
1707     }
1708 
1709     /**
1710      * Sets aspect ratio for additional cameras using DAQ or DIAC methods.
1711      *
1712      * @param additionalCamerasAspectRatio aspect ratio for additional cameras using DAQ or DIAC
1713      *                                     methods.
1714      * @return this instance so that method can be easily chained.
1715      */
1716     public T setAdditionalCamerasAspectRatio(final double additionalCamerasAspectRatio) {
1717         this.additionalCamerasAspectRatio = additionalCamerasAspectRatio;
1718         //noinspection unchecked
1719         return (T) this;
1720     }
1721 
1722     /**
1723      * Indicates whether EPnP (Efficient Perspective-n-Point) method is used for additional
1724      * estimation of cameras. Either EPnP or UPnP must be used for additional estimation
1725      * of cameras.
1726      *
1727      * @return true if EPnP method is used for additional cameras estimation, false
1728      * otherwise.
1729      */
1730     public boolean getUseEPnPForAdditionalCamerasEstimation() {
1731         return useEPnPForAdditionalCamerasEstimation;
1732     }
1733 
1734     /**
1735      * Specifies whether EPnP (Efficient Perspective-n-Point) method is used for additional
1736      * estimation of cameras. Either EPnP or UPnP must be used for additional estimation of cameras.
1737      *
1738      * @param useEPnPForAdditionalCamerasEstimation true if EPnP method is used for additional
1739      *                                              cameras estimation, false otherwise.
1740      * @return this instance so that method can be easily chained.
1741      */
1742     public T setUseEPnPForAdditionalCamerasEstimation(final boolean useEPnPForAdditionalCamerasEstimation) {
1743         this.useEPnPForAdditionalCamerasEstimation = useEPnPForAdditionalCamerasEstimation;
1744         //noinspection unchecked
1745         return (T) this;
1746     }
1747 
1748     /**
1749      * Indicates whether UPnP (Uncalibrated Perspective-n-Point) method is used for
1750      * additional estimation of cameras. Either EPnP or UPnP must be used for additional
1751      * estimation of cameras.
1752      *
1753      * @return true if UPnP method is used for additional cameras estimation, false
1754      * otherwise.
1755      */
1756     public boolean getUseUPnPForAdditionalCamerasEstimation() {
1757         return useUPnPForAdditionalCamerasEstimation;
1758     }
1759 
1760     /**
1761      * Specifies whether UPnP (Uncalibrated Perspective-n-Point) method is used for
1762      * additional estimation of cameras. Either EPnP or UPnP must be used for additional
1763      * estimation of cameras.
1764      *
1765      * @param useUPnPForAdditionalCamerasEstimation true if UPnP method is used for
1766      *                                              additional cameras estimation, false
1767      *                                              otherwise.
1768      * @return this instance so that method can be easily chained.
1769      */
1770     public T setUseUPnPForAdditionalCamerasEstimation(final boolean useUPnPForAdditionalCamerasEstimation) {
1771         this.useUPnPForAdditionalCamerasEstimation = useUPnPForAdditionalCamerasEstimation;
1772         //noinspection unchecked
1773         return (T) this;
1774     }
1775 
1776     /**
1777      * Gets robust method to estimate additional cameras.
1778      *
1779      * @return robust method to estimate additional cameras.
1780      */
1781     public RobustEstimatorMethod getAdditionalCamerasRobustEstimationMethod() {
1782         return additionalCamerasRobustEstimationMethod;
1783     }
1784 
1785     /**
1786      * Sets robust method to estimate additional cameras.
1787      *
1788      * @param method robust method to estimate additional cameras.
1789      * @return this instance so that method can be easily chained.
1790      */
1791     public T setAdditionalCamerasRobustEstimationMethod(final RobustEstimatorMethod method) {
1792         additionalCamerasRobustEstimationMethod = method;
1793         //noinspection unchecked
1794         return (T) this;
1795     }
1796 
1797     /**
1798      * Indicates whether planar configuration is allowed for additional cameras
1799      * estimation using either EPnP or UPnP.
1800      *
1801      * @return true if planar configuration is allowed, false otherwise.
1802      */
1803     public boolean getAdditionalCamerasAllowPlanarConfiguration() {
1804         return additionalCamerasAllowPlanarConfiguration;
1805     }
1806 
1807     /**
1808      * Specifies whether planar configuration is allowed for additional cameras
1809      * estimation using either EPnP or UPnP.
1810      *
1811      * @param allowPlanarConfiguration true if planar configuration is allowed, false
1812      *                                 otherwise.
1813      * @return this instance so that method can be easily chained.
1814      */
1815     public T setAdditionalCamerasAllowPlanarConfiguration(final boolean allowPlanarConfiguration) {
1816         additionalCamerasAllowPlanarConfiguration = allowPlanarConfiguration;
1817         //noinspection unchecked
1818         return (T) this;
1819     }
1820 
1821     /**
1822      * Indicates whether dimension 2 null-space is allowed while estimating additional
1823      * cameras using either EPnP or UPnP.
1824      *
1825      * @return true if dimension 2 null-space is allowed while estimating additional
1826      * cameras, false otherwise.
1827      */
1828     public boolean getAdditionalCamerasAllowNullspaceDimension2() {
1829         return additionalCamerasAllowNullspaceDimension2;
1830     }
1831 
1832     /**
1833      * Specifies whether dimension 2 null-space is allowed while estimating additional
1834      * cameras using either EPnP or UPnP.
1835      *
1836      * @param allowNullspaceDimension2 true if dimension 2 null-space is allowed while
1837      *                                 estimating additional cameras, false otherwise.
1838      * @return this instance so that method can be easily chained.
1839      */
1840     public T setAdditionalCamerasAllowNullspaceDimension2(final boolean allowNullspaceDimension2) {
1841         additionalCamerasAllowNullspaceDimension2 = allowNullspaceDimension2;
1842         //noinspection unchecked
1843         return (T) this;
1844     }
1845 
1846     /**
1847      * Indicates whether dimension 3 null-space is allowed while estimating additional
1848      * cameras using EPnP.
1849      *
1850      * @return true if dimension 3 null-space is allowed while estimating additional
1851      * cameras, false otherwise.
1852      */
1853     public boolean getAdditionalCamerasAllowNullspaceDimension3() {
1854         return additionalCamerasAllowNullspaceDimension3;
1855     }
1856 
1857     /**
1858      * Specifies whether dimension 3 null-space is allowed while estimating additional
1859      * cameras using either EPnP or UPnP.
1860      *
1861      * @param allowNullspaceDimension3 true if dimension 3 null-space is allowed while
1862      *                                 estimating additional cameras, false otherwise.
1863      * @return this instance so that method can be easily chained.
1864      */
1865     public T setAdditionalCamerasAllowNullspaceDimension3(final boolean allowNullspaceDimension3) {
1866         additionalCamerasAllowNullspaceDimension3 = allowNullspaceDimension3;
1867         //noinspection unchecked
1868         return (T) this;
1869     }
1870 
1871     /**
1872      * Gets threshold to determine whether 3D matched points to estimate additional
1873      * cameras are in a planar configuration.
1874      *
1875      * @return threshold to determine whether 3D matched points to estimate additional
1876      * cameras are in a planar configuration.
1877      */
1878     public double getAdditionalCamerasPlanarThreshold() {
1879         return additionalCamerasPlanarThreshold;
1880     }
1881 
1882     /**
1883      * Specifies threshold to determine whether 3D matched points to estimate additional
1884      * cameras are in a planar configuration.
1885      *
1886      * @param additionalCamerasPlanarThreshold threshold to determine whether 3D matched
1887      *                                         points to estimate additional cameras are
1888      *                                         in a planar configuration.
1889      * @return this instance so that method can be easily chained.
1890      */
1891     public T setAdditionalCamerasPlanarThreshold(final double additionalCamerasPlanarThreshold) {
1892         this.additionalCamerasPlanarThreshold = additionalCamerasPlanarThreshold;
1893         //noinspection unchecked
1894         return (T) this;
1895     }
1896 
1897     /**
1898      * Indicates whether additional cameras are refined to minimize overall projection
1899      * error among all found inliers.
1900      *
1901      * @return true if additional cameras are refined, false otherwise.
1902      */
1903     public boolean areAdditionalCamerasRefined() {
1904         return refineAdditionalCameras;
1905     }
1906 
1907     /**
1908      * Specifies whether additional cameras are refined to minimize overall projection
1909      * error among all found inliers.
1910      *
1911      * @param refineAdditionalCameras true if additional cameras are refined, false
1912      *                                otherwise.
1913      * @return this instance so that method can be easily chained.
1914      */
1915     public T setAdditionalCamerasRefined(final boolean refineAdditionalCameras) {
1916         this.refineAdditionalCameras = refineAdditionalCameras;
1917         //noinspection unchecked
1918         return (T) this;
1919     }
1920 
1921     /**
1922      * Indicates whether covariance is kept after refining result of additional
1923      * estimation of cameras.
1924      *
1925      * @return true if covariance is kept, false otherwise.
1926      */
1927     public boolean isAdditionalCamerasCovarianceKept() {
1928         return keepCovarianceAdditionalCameras;
1929     }
1930 
1931     /**
1932      * Specifies whether covariance is kept after refining result of additional estimation
1933      * of cameras.
1934      *
1935      * @param keepCovarianceAdditionalCameras true if covariance is kept, false otherwise.
1936      * @return this instance so that method can be easily chained.
1937      */
1938     public T setAdditionalCamerasCovarianceKept(final boolean keepCovarianceAdditionalCameras) {
1939         this.keepCovarianceAdditionalCameras = keepCovarianceAdditionalCameras;
1940         //noinspection unchecked
1941         return (T) this;
1942     }
1943 
1944     /**
1945      * Gets value indicating whether fast refinement is used for additional estimation
1946      * of cameras.
1947      *
1948      * @return true if fast refinement is used for additional cameras estimation,
1949      * false otherwise.
1950      */
1951     public boolean getAdditionalCamerasUseFastRefinement() {
1952         return additionalCamerasUseFastRefinement;
1953     }
1954 
1955     /**
1956      * Sets value indicating whether fast refinement is used for additional estimation
1957      * of cameras.
1958      *
1959      * @param additionalCamerasUseFastRefinement true if fast refinement is used for
1960      *                                           additional cameras estimation, false
1961      *                                           otherwise.
1962      * @return this instance so that method can be easily chained.
1963      */
1964     public T setAdditionalCamerasUseFastRefinement(final boolean additionalCamerasUseFastRefinement) {
1965         this.additionalCamerasUseFastRefinement = additionalCamerasUseFastRefinement;
1966         //noinspection unchecked
1967         return (T) this;
1968     }
1969 
1970     /**
1971      * Gets confidence of estimated additional cameras.
1972      *
1973      * @return confidence of estimated additional cameras.
1974      */
1975     public double getAdditionalCamerasConfidence() {
1976         return additionalCamerasConfidence;
1977     }
1978 
1979     /**
1980      * Sets confidence of estimated additional cameras.
1981      *
1982      * @param additionalCamerasConfidence confidence of estimated additional cameras.
1983      * @return this instance so that method can be easily chained.
1984      */
1985     public T setAdditionalCamerasConfidence(final double additionalCamerasConfidence) {
1986         this.additionalCamerasConfidence = additionalCamerasConfidence;
1987         //noinspection unchecked
1988         return (T) this;
1989     }
1990 
1991     /**
1992      * Gets maximum allowed number of iterations for additional cameras estimation.
1993      *
1994      * @return maximum allowed number of iterations for additional cameras estimation.
1995      */
1996     public int getAdditionalCamerasMaxIterations() {
1997         return additionalCamerasMaxIterations;
1998     }
1999 
2000     /**
2001      * Sets maximum allowed number of iterations for additional cameras estimation.
2002      *
2003      * @param additionalCamerasMaxIterations maximum allowed number of iterations for
2004      *                                       additional cameras estimation.
2005      * @return this instance so that method can be easily chained.
2006      */
2007     public T setAdditionalCamerasMaxIterations(final int additionalCamerasMaxIterations) {
2008         this.additionalCamerasMaxIterations = additionalCamerasMaxIterations;
2009         //noinspection unchecked
2010         return (T) this;
2011     }
2012 
2013     /**
2014      * Gets threshold to determine whether samples for robust pinhole camera estimation are inliers or not.
2015      *
2016      * @return threshold to determine whether samples for robust pinhole camera estimation are inliers or
2017      * not.
2018      */
2019     public double getAdditionalCamerasThreshold() {
2020         return additionalCamerasThreshold;
2021     }
2022 
2023     /**
2024      * Sets threshold to determine whether samples for robust pinhole camera estimation are inliers or not.
2025      *
2026      * @param additionalCamerasThreshold threshold to determine whether samples for robust pinhole camera
2027      *                                   estimation are inliers or not.
2028      * @return this instance so that method can be easily chained.
2029      */
2030     public T setAdditionalCamerasThreshold(final double additionalCamerasThreshold) {
2031         this.additionalCamerasThreshold = additionalCamerasThreshold;
2032         //noinspection unchecked
2033         return (T) this;
2034     }
2035 
2036     /**
2037      * Indicates whether inliers must be kept during additional camera estimation.
2038      *
2039      * @return true if inliers must be kept during additional camera estimation, false
2040      * otherwise.
2041      */
2042     public boolean getAdditionalCamerasComputeAndKeepInliers() {
2043         return additionalCamerasComputeAndKeepInliers;
2044     }
2045 
2046     /**
2047      * Specifies whether inliers must be kept during additional camera estimation.
2048      *
2049      * @param additionalCamerasComputeAndKeepInliers true if inliers must be kept during additional camera
2050      *                                               estimation, false otherwise.
2051      * @return this instance so that method can be easily chained.
2052      */
2053     public T setAdditionalCamerasComputeAndKeepInliers(final boolean additionalCamerasComputeAndKeepInliers) {
2054         this.additionalCamerasComputeAndKeepInliers = additionalCamerasComputeAndKeepInliers;
2055         //noinspection unchecked
2056         return (T) this;
2057     }
2058 
2059     /**
2060      * Indicates whether residuals must be computed and kept during additional camera estimation.
2061      *
2062      * @return true if residuals must be computed and kept, false otherwise.
2063      */
2064     public boolean getAdditionalCamerasComputeAndKeepResiduals() {
2065         return additionalCamerasComputeAndKeepResiduals;
2066     }
2067 
2068     /**
2069      * Specifies whether residuals must be computed and kept during additional camera estimation.
2070      *
2071      * @param additionalCamerasComputeAndKeepResiduals true if residuals must be computed and kept, false
2072      *                                                 otherwise.
2073      * @return this instance so that method can be easily chained.
2074      */
2075     public T setAdditionalCamerasComputeAndKeepResiduals(final boolean additionalCamerasComputeAndKeepResiduals) {
2076         this.additionalCamerasComputeAndKeepResiduals = additionalCamerasComputeAndKeepResiduals;
2077         //noinspection unchecked
2078         return (T) this;
2079     }
2080 
2081     /**
2082      * Gets value indicating whether skewness is not suggested during additional
2083      * estimation of cameras.
2084      *
2085      * @return true if skewness is suggested, false otherwise.
2086      */
2087     public boolean isAdditionalCamerasSuggestSkewnessValueEnabled() {
2088         return additionalCamerasSuggestSkewnessValueEnabled;
2089     }
2090 
2091     /**
2092      * Sets value indicating whether skewness is not suggested during additional
2093      * estimation of cameras.
2094      *
2095      * @param additionalCamerasSuggestSkewnessValueEnabled true if skewness is suggested,
2096      *                                                     false otherwise.
2097      * @return this instance so that method can be easily chained.
2098      */
2099     public T setAdditionalCamerasSuggestSkewnessValueEnabled(
2100             final boolean additionalCamerasSuggestSkewnessValueEnabled) {
2101         this.additionalCamerasSuggestSkewnessValueEnabled = additionalCamerasSuggestSkewnessValueEnabled;
2102         //noinspection unchecked
2103         return (T) this;
2104     }
2105 
2106     /**
2107      * Gets value of skewness to be suggested when suggestion is enabled during
2108      * additional estimation of cameras.
2109      *
2110      * @return value of skewness to be suggested when suggestion is enabled during
2111      * additional estimation of cameras.
2112      */
2113     public double getAdditionalCamerasSuggestedSkewnessValue() {
2114         return additionalCamerasSuggestedSkewnessValue;
2115     }
2116 
2117     /**
2118      * Sets value of skewness to be suggested when suggestion is enabled during additional
2119      * estimation of cameras.
2120      *
2121      * @param additionalCamerasSuggestedSkewnessValue value of skewness to be suggested
2122      *                                                when suggestion is enabled during
2123      *                                                additional estimation of cameras.
2124      * @return this instance so that method can be easily chained.
2125      */
2126     public T setAdditionalCamerasSuggestedSkewnessValue(final double additionalCamerasSuggestedSkewnessValue) {
2127         this.additionalCamerasSuggestedSkewnessValue = additionalCamerasSuggestedSkewnessValue;
2128         //noinspection unchecked
2129         return (T) this;
2130     }
2131 
2132     /**
2133      * Indicates whether horizontal focal length value is suggested or not during
2134      * additional estimation of cameras.
2135      *
2136      * @return true if horizontal focal length value is suggested, false otherwise.
2137      */
2138     public boolean isAdditionalCamerasSuggestHorizontalFocalLengthEnabled() {
2139         return additionalCamerasSuggestHorizontalFocalLengthEnabled;
2140     }
2141 
2142     /**
2143      * Specifies whether horizontal focal length value is suggested or not during additional
2144      * estimation of cameras.
2145      *
2146      * @param additionalCamerasSuggestHorizontalFocalLengthEnabled true if horizontal focal
2147      *                                                             length value is suggested, false
2148      *                                                             otherwise.
2149      * @return this instance so that method can be easily chained.
2150      */
2151     public T setAdditionalCamerasSuggestHorizontalFocalLengthEnabled(
2152             final boolean additionalCamerasSuggestHorizontalFocalLengthEnabled) {
2153         this.additionalCamerasSuggestHorizontalFocalLengthEnabled =
2154                 additionalCamerasSuggestHorizontalFocalLengthEnabled;
2155         //noinspection unchecked
2156         return (T) this;
2157     }
2158 
2159     /**
2160      * Gets value of suggested horizontal focal length during additional estimation
2161      * of cameras.
2162      *
2163      * @return value of suggested horizontal focal length during additional estimation
2164      * of cameras.
2165      */
2166     public double getAdditionalCamerasSuggestedHorizontalFocalLengthValue() {
2167         return additionalCamerasSuggestedHorizontalFocalLengthValue;
2168     }
2169 
2170     /**
2171      * Sets value of suggested horizontal focal length during additional estimation
2172      * of cameras.
2173      *
2174      * @param additionalCamerasSuggestedHorizontalFocalLengthValue value of suggested
2175      *                                                             horizontal focal length during
2176      *                                                             additional estimation of cameras.
2177      * @return this instance so that method can be easily chained.
2178      */
2179     public T setAdditionalCamerasSuggestedHorizontalFocalLengthValue(
2180             final double additionalCamerasSuggestedHorizontalFocalLengthValue) {
2181         this.additionalCamerasSuggestedHorizontalFocalLengthValue =
2182                 additionalCamerasSuggestedHorizontalFocalLengthValue;
2183         //noinspection unchecked
2184         return (T) this;
2185     }
2186 
2187     /**
2188      * Gets value indicating whether vertical focal length value is suggested or not
2189      * during additional estimation of cameras.
2190      *
2191      * @return true if vertical focal length value is suggested, false otherwise.
2192      */
2193     public boolean isAdditionalCamerasSuggestVerticalFocalLengthEnabled() {
2194         return additionalCamerasSuggestVerticalFocalLengthEnabled;
2195     }
2196 
2197     /**
2198      * Sets value indicating whether vertical focal length value is suggested or not
2199      * during additional estimation of cameras.
2200      *
2201      * @param additionalCamerasSuggestVerticalFocalLengthEnabled true if vertical focal
2202      *                                                           length is suggested, false
2203      *                                                           otherwise.
2204      * @return this instance so that method can be easily chained.
2205      */
2206     public T setAdditionalCamerasSuggestVerticalFocalLengthEnabled(
2207             final boolean additionalCamerasSuggestVerticalFocalLengthEnabled) {
2208         this.additionalCamerasSuggestVerticalFocalLengthEnabled = additionalCamerasSuggestVerticalFocalLengthEnabled;
2209         //noinspection unchecked
2210         return (T) this;
2211     }
2212 
2213     /**
2214      * Gets value of suggested vertical focal length during additional estimation of cameras.
2215      *
2216      * @return value of suggested vertical focal length during additional estimation of cameras.
2217      */
2218     public double getAdditionalCamerasSuggestedVerticalFocalLengthValue() {
2219         return additionalCamerasSuggestedVerticalFocalLengthValue;
2220     }
2221 
2222     /**
2223      * Sets value of suggested vertical focal length during additional estimation of cameras.
2224      *
2225      * @param additionalCamerasSuggestedVerticalFocalLengthValue value of suggested vertical
2226      *                                                           focal length during additional
2227      *                                                           estimation of cameras.
2228      * @return this instance so that method can be easily chained.
2229      */
2230     public T setAdditionalCamerasSuggestedVerticalFocalLengthValue(
2231             final double additionalCamerasSuggestedVerticalFocalLengthValue) {
2232         this.additionalCamerasSuggestedVerticalFocalLengthValue = additionalCamerasSuggestedVerticalFocalLengthValue;
2233         //noinspection unchecked
2234         return (T) this;
2235     }
2236 
2237     /**
2238      * Gets value indicating whether aspect ratio is suggested or not during additional
2239      * estimation of cameras.
2240      *
2241      * @return true if aspect ratio is suggested, false otherwise.
2242      */
2243     public boolean isAdditionalCamerasSuggestAspectRatioEnabled() {
2244         return additionalCamerasSuggestAspectRatioEnabled;
2245     }
2246 
2247     /**
2248      * Sets value indicating whether aspect ratio is suggested or not during additional
2249      * estimation of cameras.
2250      *
2251      * @param additionalCamerasSuggestAspectRatioEnabled true if aspect ratio is suggested,
2252      *                                                   false otherwise.
2253      * @return this instance so that method can be easily chained.
2254      */
2255     public T setAdditionalCamerasSuggestAspectRatioEnabled(final boolean additionalCamerasSuggestAspectRatioEnabled) {
2256         this.additionalCamerasSuggestAspectRatioEnabled = additionalCamerasSuggestAspectRatioEnabled;
2257         //noinspection unchecked
2258         return (T) this;
2259     }
2260 
2261     /**
2262      * Gets value of aspect ratio to be suggested when suggestion is enabled during
2263      * additional estimation of cameras.
2264      *
2265      * @return value of aspect ratio to be suggested.
2266      */
2267     public double getAdditionalCamerasSuggestedAspectRatioValue() {
2268         return additionalCamerasSuggestedAspectRatioValue;
2269     }
2270 
2271     /**
2272      * Sets value of aspect ratio to be suggested when suggestion is enabled during
2273      * additional estimation of cameras.
2274      *
2275      * @param additionalCamerasSuggestedAspectRatioValue value of aspect ratio to be
2276      *                                                   suggested.
2277      * @return this instance so that method can be easily chained.
2278      */
2279     public T setAdditionalCamerasSuggestedAspectRatioValue(final double additionalCamerasSuggestedAspectRatioValue) {
2280         this.additionalCamerasSuggestedAspectRatioValue = additionalCamerasSuggestedAspectRatioValue;
2281         //noinspection unchecked
2282         return (T) this;
2283     }
2284 
2285     /**
2286      * Gets value indicating whether principal point is suggested or not during
2287      * additional estimation of cameras.
2288      *
2289      * @return true if principal point is suggested, false otherwise.
2290      */
2291     public boolean isAdditionalCamerasSuggestPrincipalPointEnabled() {
2292         return additionalCamerasSuggestPrincipalPointEnabled;
2293     }
2294 
2295     /**
2296      * Sets value indicating whether principal point is suggested or not during additional
2297      * estimation of cameras.
2298      *
2299      * @param additionalCamerasSuggestPrincipalPointEnabled true if principal point is
2300      *                                                      suggested, false otherwise.
2301      * @return this instance so that method can be easily chained.
2302      */
2303     public T setAdditionalCamerasSuggestPrincipalPointEnabled(
2304             final boolean additionalCamerasSuggestPrincipalPointEnabled) {
2305         this.additionalCamerasSuggestPrincipalPointEnabled = additionalCamerasSuggestPrincipalPointEnabled;
2306         //noinspection unchecked
2307         return (T) this;
2308     }
2309 
2310     /**
2311      * Gets value of principal point to be suggested when suggestion is enabled during
2312      * additional estimation of cameras.
2313      *
2314      * @return principal point to be suggested.
2315      */
2316     public InhomogeneousPoint2D getAdditionalCamerasSuggestedPrincipalPointValue() {
2317         return additionalCamerasSuggestedPrincipalPointValue;
2318     }
2319 
2320     /**
2321      * Sets value of principal point to be suggested when suggestion is enabled during
2322      * additional estimation of cameras.
2323      *
2324      * @param additionalCamerasSuggestedPrincipalPointValue principal point to be
2325      *                                                      suggested.
2326      * @return this instance so that method can be easily chained.
2327      */
2328     public T setAdditionalCamerasSuggestedPrincipalPointValue(
2329             final InhomogeneousPoint2D additionalCamerasSuggestedPrincipalPointValue) {
2330         this.additionalCamerasSuggestedPrincipalPointValue = additionalCamerasSuggestedPrincipalPointValue;
2331         //noinspection unchecked
2332         return (T) this;
2333     }
2334 
2335     /**
2336      * Indicates whether homogeneous point triangulator must be used or not to estimate
2337      * 3D points when only two matches are available.
2338      *
2339      * @return true if homogeneous point triangulator must be used, false otherwise.
2340      */
2341     public boolean isHomogeneousPointTriangulatorUsed() {
2342         return useHomogeneousPointTriangulator;
2343     }
2344 
2345     /**
2346      * Specifies whether homogeneous point triangulator must be used or not to estimate
2347      * 3D points when only two matches are available.
2348      *
2349      * @param useHomogeneousPointTriangulator true if homogeneous point triangulator must
2350      *                                        be used, false otherwise.
2351      * @return this instance so that method can be easily chained.
2352      */
2353     public T setHomogeneousPointTriangulatorUsed(final boolean useHomogeneousPointTriangulator) {
2354         this.useHomogeneousPointTriangulator = useHomogeneousPointTriangulator;
2355         //noinspection unchecked
2356         return (T) this;
2357     }
2358 
2359     /**
2360      * Gets robust method for point triangulation when points are matched in more
2361      * than two views.
2362      *
2363      * @return robust method for point triangulation.
2364      */
2365     public RobustEstimatorMethod getRobustPointTriangulatorMethod() {
2366         return robustPointTriangulatorMethod;
2367     }
2368 
2369     /**
2370      * Sets robust method for point triangulation when points are matched in more
2371      * than two views.
2372      *
2373      * @param robustPointTriangulatorMethod robust method for point triangulation.
2374      * @return this instance so that method can be easily chained.
2375      */
2376     public T setRobustPointTriangulatorMethod(final RobustEstimatorMethod robustPointTriangulatorMethod) {
2377         this.robustPointTriangulatorMethod = robustPointTriangulatorMethod;
2378         //noinspection unchecked
2379         return (T) this;
2380     }
2381 
2382     /**
2383      * Gets confidence of robustly triangulated points. By default, this is 99%.
2384      *
2385      * @return confidence of robustly triangulated points.
2386      */
2387     public double getPointTriangulatorConfidence() {
2388         return pointTriangulatorConfidence;
2389     }
2390 
2391     /**
2392      * Sets confidence of robustly triangulated points. By default, this is 99%.
2393      *
2394      * @param pointTriangulatorConfidence confidence of robustly triangulated points.
2395      * @return this instance so that method can be easily chained.
2396      */
2397     public T setPointTriangulatorConfidence(final double pointTriangulatorConfidence) {
2398         this.pointTriangulatorConfidence = pointTriangulatorConfidence;
2399         //noinspection unchecked
2400         return (T) this;
2401     }
2402 
2403     /**
2404      * Gets maximum number of iterations to make while robustly estimating triangulated
2405      * points. By default, this is 5000 iterations.
2406      *
2407      * @return maximum number of iterations to make while robustly estimating
2408      * triangulated points.
2409      */
2410     public int getPointTriangulatorMaxIterations() {
2411         return pointTriangulatorMaxIterations;
2412     }
2413 
2414     /**
2415      * Sets maximum number of iterations to make while robustly estimating triangulated
2416      * points. By default, this is 5000 iterations.
2417      *
2418      * @param pointTriangulatorMaxIterations maximum number of iterations to make while
2419      *                                       robustly estimating triangulated points.
2420      * @return this instance so that method can be easily chained.
2421      */
2422     public T setPointTriangulatorMaxIterations(final int pointTriangulatorMaxIterations) {
2423         this.pointTriangulatorMaxIterations = pointTriangulatorMaxIterations;
2424         //noinspection unchecked
2425         return (T) this;
2426     }
2427 
2428     /**
2429      * Gets threshold to determine whether samples for robust point triangulator are
2430      * inliers or not.
2431      *
2432      * @return threshold to determine whether samples for robust point triangulator
2433      * are inliers or not.
2434      */
2435     public double getPointTriangulatorThreshold() {
2436         return pointTriangulatorThreshold;
2437     }
2438 
2439     /**
2440      * Sets threshold to determine whether samples for robust point triangulator are
2441      * inliers or not.
2442      *
2443      * @param pointTriangulatorThreshold threshold to determine whether samples for
2444      *                                   robust point triangulator are inliers or not.
2445      * @return this instance so that method can be easily chained.
2446      */
2447     public T setPointTriangulatorThreshold(final double pointTriangulatorThreshold) {
2448         this.pointTriangulatorThreshold = pointTriangulatorThreshold;
2449         //noinspection unchecked
2450         return (T) this;
2451     }
2452 }