use of boofcv.abst.geo.calibration.ImageResults in project BoofCV by lessthanoptimal.
the class FisheyePlanarPanel method updateResultsGUI.
@Override
protected void updateResultsGUI() {
if (selectedImage < results.size()) {
ImageResults r = results.get(selectedImage);
String textMean = String.format("%5.1e", r.meanError);
String textMax = String.format("%5.1e", r.maxError);
meanError.setText(textMean);
maxError.setText(textMax);
}
}
use of boofcv.abst.geo.calibration.ImageResults in project BoofCV by lessthanoptimal.
the class MonoPlanarPanel method updateResultsGUI.
// private void setSelected( int selected ) {
// mainView.setSelected(selected);
// selectedImage = selected;
//
// if( results != null ) {
// updateResultsGUI();
// }
// }
@Override
protected void updateResultsGUI() {
if (selectedImage < results.size()) {
ImageResults r = results.get(selectedImage);
String textMean = String.format("%5.1e", r.meanError);
String textMax = String.format("%5.1e", r.maxError);
meanError.setText(textMean);
maxError.setText(textMax);
}
}
use of boofcv.abst.geo.calibration.ImageResults in project BoofCV by lessthanoptimal.
the class CalibrationPlanarGridZhang99 method computeErrors.
public List<ImageResults> computeErrors() {
List<ImageResults> errors = new ArrayList<>();
double[] parameters = new double[structure.getParameterCount()];
double[] residuals = new double[observations.getObservationCount() * 2];
CodecSceneStructureMetric codec = new CodecSceneStructureMetric();
codec.encode(structure, parameters);
BundleAdjustmentMetricResidualFunction function = new BundleAdjustmentMetricResidualFunction();
function.configure(structure, observations);
function.process(parameters, residuals);
int idx = 0;
for (int i = 0; i < observations.viewsRigid.size; i++) {
SceneObservations.View v = observations.viewsRigid.data[i];
ImageResults r = new ImageResults(v.size());
double sumX = 0;
double sumY = 0;
double meanErrorMag = 0;
double maxError = 0;
for (int j = 0; j < v.size(); j++) {
double x = r.residuals[j * 2] = residuals[idx++];
double y = r.residuals[j * 2 + 1] = residuals[idx++];
double nerr = r.pointError[j] = Math.sqrt(x * x + y * y);
meanErrorMag += nerr;
maxError = Math.max(maxError, nerr);
sumX += x;
sumY += y;
}
r.biasX = sumX / v.size();
r.biasY = sumY / v.size();
r.meanError = meanErrorMag / v.size();
r.maxError = maxError;
errors.add(r);
}
return errors;
}
use of boofcv.abst.geo.calibration.ImageResults in project BoofCV by lessthanoptimal.
the class GenericCalibrationZhang99 method fullTest.
void fullTest(boolean partial) {
for (CameraConfig config : createCamera(rand)) {
CalibInputs inputs = createInputs(config.model, 3, rand);
// remove points for partial visibility of a target
if (partial) {
for (int i = 0; i < inputs.observations.size(); i++) {
CalibrationObservation o = inputs.observations.get(i);
for (int j = 0; j < 5; j++) {
o.points.remove(rand.nextInt(o.points.size()));
}
}
}
Zhang99Camera zhangCamera = createGenerator(config, inputs.layout);
CalibrationPlanarGridZhang99 alg = new CalibrationPlanarGridZhang99(inputs.layout, zhangCamera);
// estimate camera parameters using full non-linear methods
alg.process(inputs.observations);
// verify results using errors
List<ImageResults> errors = alg.computeErrors();
for (int i = 0; i < errors.size(); i++) {
assertEquals(0, errors.get(i).meanError, reprojectionTol);
}
}
}
Aggregations