use of georegression.struct.point.Point3D_F64 in project BoofCV by lessthanoptimal.
the class DistanceTranGivenRotSq method computeDistance.
@Override
public double computeDistance(Point2D3D pt) {
Point3D_F64 X = pt.location;
Point2D_F64 obs = pt.observation;
SePointOps_F64.transform(motion, X, localX);
double dx = obs.x - localX.x / localX.z;
double dy = obs.y - localX.y / localX.z;
return dx * dx + dy * dy;
}
use of georegression.struct.point.Point3D_F64 in project BoofCV by lessthanoptimal.
the class ParamFundamentalEpipolar method selectColumns.
private void selectColumns(DMatrixRMaj F) {
Point3D_F64 e1 = new Point3D_F64();
Point3D_F64 e2 = new Point3D_F64();
MultiViewOps.extractEpipoles(F, e1, e2);
// if the right epipole lies at infinity (z=0) then don't use the first two columns
if (Math.abs(e2.z) <= UtilEjml.EPS) {
col0 = 1;
col1 = 2;
col2 = 0;
} else {
col0 = 0;
col1 = 1;
col2 = 2;
}
}
use of georegression.struct.point.Point3D_F64 in project BoofCV by lessthanoptimal.
the class TestVisualDepthOps method compute.
private Point3D_F64 compute(int x, int y, int distance) {
Point2D_F64 n = new Point2D_F64();
RemoveRadialPtoN_F64 p2n = new RemoveRadialPtoN_F64();
p2n.setK(param.fx, param.fy, param.skew, param.cx, param.cy).setDistortion(param.radial, param.t1, param.t2);
p2n.compute(x, y, n);
Point3D_F64 p = new Point3D_F64();
p.z = distance;
p.x = n.x * p.z;
p.y = n.y * p.z;
return p;
}
use of georegression.struct.point.Point3D_F64 in project BoofCV by lessthanoptimal.
the class TestVisualDepthOps method depthTo3D_with_rgb.
@Test
public void depthTo3D_with_rgb() {
GrayU16 depth = new GrayU16(width, height);
depth.set(200, 80, 3400);
depth.set(600, 420, 50);
Planar<GrayU8> rgb = new Planar<>(GrayU8.class, width, height, 3);
GImageMiscOps.fillUniform(rgb, rand, 0, 200);
FastQueue<Point3D_F64> pts = new FastQueue<>(Point3D_F64.class, true);
FastQueueArray_I32 color = new FastQueueArray_I32(3);
VisualDepthOps.depthTo3D(param, rgb, depth, pts, color);
assertEquals(2, pts.size());
assertEquals(2, color.size());
assertEquals(0, compute(200, 80, 3400).distance(pts.get(0)), 1e-8);
assertEquals(0, compute(600, 420, 50).distance(pts.get(1)), 1e-8);
color(200, 80, rgb, color.get(0));
color(600, 420, rgb, color.get(1));
}
use of georegression.struct.point.Point3D_F64 in project BoofCV by lessthanoptimal.
the class TestAssociateStereo2D method positive.
/**
* Very simple positive case with only a perfect observation and descriptor
*/
@Test
public void positive() {
Point3D_F64 X = new Point3D_F64(0.02, -0.5, 3);
SfmTestHelper.renderPointPixel(param, X, leftP, rightP);
pointsLeft.grow().set(leftP);
pointsRight.grow().set(rightP);
descLeft.grow();
descRight.grow();
AssociateStereo2D<TupleDesc_F64> alg = new AssociateStereo2D<>(scorer, 0.5, TupleDesc_F64.class);
alg.setCalibration(param);
alg.setSource(pointsLeft, descLeft);
alg.setDestination(pointsRight, descRight);
alg.associate();
FastQueue<AssociatedIndex> matches = alg.getMatches();
assertEquals(1, matches.size);
}
Aggregations