1 /* 2 * Copyright (C) 2015 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.calibration; 17 18 import com.irurueta.geometry.PinholeCameraIntrinsicParameters; 19 20 /** 21 * Listener to be notified when calibration starts, finishes or any progress 22 * changes. 23 */ 24 public interface CameraCalibratorListener { 25 /** 26 * Called when a calibrator starts the camera calibration process. 27 * 28 * @param calibrator reference to a camera calibrator. 29 */ 30 void onCalibrateStart(final CameraCalibrator calibrator); 31 32 /** 33 * Called when a calibrator ends the camera calibration process. 34 * 35 * @param calibrator reference to a camera calibrator. 36 */ 37 void onCalibrateEnd(final CameraCalibrator calibrator); 38 39 /** 40 * Called to notify changes in the camera calibration progress. 41 * 42 * @param calibrator reference to a camera calibrator. 43 * @param progress current percentage of progress expressed as a value 44 * between 0.0f and 1.0f. 45 */ 46 void onCalibrateProgressChange(final CameraCalibrator calibrator, final float progress); 47 48 /** 49 * Called when a calibrator starts the estimation of intrinsic parameters 50 * of a pinhole camera. 51 * Depending on the calibrator implementation, this method might be called 52 * multiple times while the distortion parameters are being refined. 53 * 54 * @param calibrator reference to a camera calibrator. 55 */ 56 void onIntrinsicParametersEstimationStarts(final CameraCalibrator calibrator); 57 58 /** 59 * Called when a calibrator finishes the estimation of intrinsic parameters 60 * of a pinhole camera. 61 * Depending on the calibrator implementation, this method might be called 62 * multiple times while the distortion parameters are being refined. 63 * 64 * @param calibrator reference to a camera calibrator. 65 * @param intrinsicParameters intrinsic parameters that have been estimated 66 * so far. 67 */ 68 void onIntrinsicParametersEstimationEnds( 69 final CameraCalibrator calibrator, final PinholeCameraIntrinsicParameters intrinsicParameters); 70 71 /** 72 * Called when a calibrator starts the estimation of radial distortion of 73 * the camera lens. 74 * Depending on the calibrator implementation, this method might be called 75 * multiple times while the distortion parameters are being refined. 76 * 77 * @param calibrator reference to a camera calibrator. 78 */ 79 void onRadialDistortionEstimationStarts(final CameraCalibrator calibrator); 80 81 /** 82 * Called when a calibrator finishes the estimation of radial distortion of 83 * the camera lens. 84 * Depending on the calibrator implementation, this method might be called 85 * multiple times while the distortion parameters are being refined. 86 * 87 * @param calibrator reference to a camera calibrator. 88 * @param distortion radial distortion that has been estimated so far. 89 */ 90 void onRadialDistortionEstimationEnds(final CameraCalibrator calibrator, final RadialDistortion distortion); 91 }