@Override public String toString() { String s = getSettings().getName() + " (" + imageWidth + " x " + imageHeight + ")\n"; for (int i = 0; i < getSettings().getName().length(); i++) { s += "="; } s += "\n" + "Intrinsics\n" + "----------\n" + "camera matrix = " + (cameraMatrix == null ? "null" : cameraMatrix.toString(16)) + "\n" + "distortion coefficients = " + (distortionCoeffs == null ? "null" : distortionCoeffs) + "\n" + "reprojection RMS/max error (pixels) = " + (float)avgReprojErr + " / " + (float)maxReprojErr + "\n\n" + "Extrinsics\n" + "----------\n" + "rotation = " + (R == null ? "null" : R.toString(11)) + "\n" + "translation = " + (T == null ? "null" : T.toString(14)) + "\n" + "epipolar RMS/max error (pixels) = " + (float)avgEpipolarErr + " / " + (float)maxEpipolarErr + "\n\n" + "Color\n" + "-----\n" + "order = " + colorOrder + "\n" + "mixing matrix = " + (colorMixingMatrix == null ? "null" : colorMixingMatrix.toString(16)) + "\n" + "additive light = " + (additiveLight == null ? "null" : additiveLight.toString(17)) + "\n" + "normalized RMSE (intensity) = " + (float)avgColorErr + "\n" + "R^2 (intensity) = " + (float)colorR2; return s; } }
public static void write(String filename, ProjectiveDevice ... devices) { FileStorage fs = new FileStorage(filename, FileStorage.WRITE); shiftLeft(shiftLeft(fs, "Cameras"), "["); for (ProjectiveDevice d : devices) { if (d instanceof CameraDevice) { opencv_core.write(fs, d.getSettings().getName()); } } shiftLeft(fs, "]"); shiftLeft(shiftLeft(fs, "Projectors"), "["); for (ProjectiveDevice d : devices) { if (d instanceof ProjectorDevice) { opencv_core.write(fs, d.getSettings().getName()); } } shiftLeft(fs, "]"); for (ProjectiveDevice d : devices) { d.writeParameters(fs); } fs.release(); }
public double[] calibrateStereo(boolean useCenters, GeometricCalibrator peer) { ProjectiveDevice d = projectiveDevice; ProjectiveDevice dp = peer.projectiveDevice; CalibrationSettings dsettings = (CalibrationSettings)d.getSettings(); CalibrationSettings dpsettings = (CalibrationSettings)dp.getSettings();
CvMat x = CvMat.create(12, 1); double gamma = device.getSettings().getResponseGamma();
public void writeParameters(FileStorage fs) { shiftLeft(shiftLeft(fs, getSettings().getName()), "{"); opencv_core.write(fs, "responseGamma", getSettings().getResponseGamma());
public void readParameters(FileStorage fs) throws Exception { if (fs == null) { throw new Exception("Error: FileStorage is null, cannot read parameters for device " + getSettings().getName() + ". Is the parametersFile correct?"); FileNode fn = fs.get(getSettings().getName()); if (fn == null) { throw new Exception("Error: FileNode is null, cannot read parameters for device " + getSettings().getName() + ". Is the name correct?"); if ((n = fn.get("imageWidth")).isInt()) imageWidth = n.asInt(); if ((n = fn.get("imageHeight")).isInt()) imageHeight = n.asInt(); if ((n = fn.get("gamma")).isReal()) getSettings().setResponseGamma(n.asDouble());
public double[] calibrate(boolean useCenters) { ProjectiveDevice d = projectiveDevice; CalibrationSettings dsettings = (CalibrationSettings)d.getSettings();