Skip to content

Commit

Permalink
Updated Nullaway
Browse files Browse the repository at this point in the history
  • Loading branch information
lessthanoptimal committed Jul 15, 2023
1 parent 06352b2 commit 20a43ef
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -26,7 +26,7 @@ project.ext.guava_version = '31.1-jre'
project.ext.args4j_version = '2.33'
project.ext.junit_version = '5.9.1'
project.ext.errorprone_version = '2.11.0'
project.ext.nullaway_version = '0.9.5'
project.ext.nullaway_version = '0.10.11'
project.ext.auto64to32_version = '3.2.1'
project.ext.snakeyaml_version = '2.0'
project.ext.jmh_version = '1.36'
Expand Down
Expand Up @@ -351,7 +351,7 @@ public static <T> T load( Map<String, Object> data ) throws IOException {
CameraUniversalOmni parameters = new CameraUniversalOmni(0);

loadPinhole(getOrThrow(data, "pinhole"), parameters);
parameters.mirrorOffset = (double)data.get("mirror_offset");
parameters.mirrorOffset = getOrThrow(data, "mirror_offset");

Map<String, Object> distortion = getOrThrow(data, "radial_tangential");
if (distortion.containsKey("radial")) {
Expand Down
62 changes: 37 additions & 25 deletions main/boofcv-io/src/main/java/boofcv/io/geo/MultiViewIO.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Peter Abeles. All Rights Reserved.
* Copyright (c) 2023, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
Expand Down Expand Up @@ -517,7 +517,7 @@ public static SceneObservations load( Reader reader, @Nullable SceneObservations

loadObservations(observations.views, yamlViews);
loadObservations(observations.viewsRigid, yamlViewsRigid);
} catch( IOException e ) {
} catch (IOException e) {
throw new UncheckedIOException(e);
}

Expand Down Expand Up @@ -887,8 +887,12 @@ public static ImageDimension loadDimension( Map<String, Object> map, @Nullable I
if (dimension == null)
dimension = new ImageDimension();

dimension.width = (int)map.get("width");
dimension.height = (int)map.get("height");
try {
dimension.width = getOrThrow(map, "width");
dimension.height = getOrThrow(map, "height");
} catch (IOException e) {
throw new UncheckedIOException(e);
}

return dimension;
}
Expand All @@ -913,33 +917,41 @@ public static BundlePinholeBrown loadPinholeBrown( Map<String, Object> map,
if (intrinsic == null)
intrinsic = new BundlePinholeBrown();

intrinsic.fx = (double)map.get("fx");
intrinsic.fy = (double)map.get("fy");
intrinsic.skew = (double)map.getOrDefault("skew", 0.0);
intrinsic.cx = (double)map.get("cx");
intrinsic.cy = (double)map.get("cy");

intrinsic.t1 = (double)map.getOrDefault("t1", 0.0);
intrinsic.t2 = (double)map.getOrDefault("t2", 0.0);
try {
intrinsic.fx = getOrThrow(map, "fx");
intrinsic.fy = getOrThrow(map, "fy");
intrinsic.skew = (double)map.getOrDefault("skew", 0.0);
intrinsic.cx = getOrThrow(map, "cx");
intrinsic.cy = getOrThrow(map, "cy");

intrinsic.t1 = (double)map.getOrDefault("t1", 0.0);
intrinsic.t2 = (double)map.getOrDefault("t2", 0.0);

List<Double> radialList = (List<Double>)map.get("radial");
if (radialList == null)
intrinsic.radial = new double[0];
else {
intrinsic.radial = radialList.stream().mapToDouble(i -> i).toArray();
}

List<Double> radialList = (List<Double>)map.get("radial");
if (radialList == null)
intrinsic.radial = new double[0];
else {
intrinsic.radial = radialList.stream().mapToDouble(i -> i).toArray();
return intrinsic;
} catch (IOException e) {
throw new UncheckedIOException(e);
}

return intrinsic;
}

public static BundlePinholeSimplified loadPinholeSimplified( Map<String, Object> map,
@Nullable BundlePinholeSimplified intrinsic ) {
if (intrinsic == null)
intrinsic = new BundlePinholeSimplified();

intrinsic.f = (double)map.get("f");
intrinsic.k1 = (double)map.get("k1");
intrinsic.k2 = (double)map.get("k2");
try {
intrinsic.f = getOrThrow(map, "f");
intrinsic.k1 = getOrThrow(map, "k1");
intrinsic.k2 = getOrThrow(map, "k2");
} catch (IOException e) {
throw new UncheckedIOException(e);
}

return intrinsic;
}
Expand Down Expand Up @@ -970,9 +982,9 @@ public static Se3_F64 loadSE3( Map<String, Object> map,
if (m == null)
m = new Se3_F64();

m.T.x = (double)map.get("x");
m.T.y = (double)map.get("y");
m.T.z = (double)map.get("z");
m.T.x = getOrThrow(map, "x");
m.T.y = getOrThrow(map, "y");
m.T.z = getOrThrow(map, "z");

copyIntoMatrix(getOrThrow(map, "R"), m.R);

Expand Down

0 comments on commit 20a43ef

Please sign in to comment.