All Downloads are FREE. Search and download functionalities are using the official Maven repository.

georegression.fitting.se.FitSpecialEuclideanOps_F32 Maven / Gradle / Ivy

Go to download

GeoRegression is a free Java based geometry library for scientific computing in fields such as robotics and computer vision with a focus on 2D/3D space.

There is a newer version: 0.27.1
Show newest version
/*
 * Copyright (C) 2011-2015, Peter Abeles. All Rights Reserved.
 *
 * This file is part of Geometric Regression Library (GeoRegression).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package georegression.fitting.se;

import georegression.fitting.MotionTransformPoint;
import georegression.struct.point.Point2D_F32;
import georegression.struct.point.Point3D_F32;
import georegression.struct.se.Se2_F32;
import georegression.struct.se.Se3_F32;

import java.util.List;


/**
 * Functions related to fitting {@link georegression.struct.se.SpecialEuclidean} transform to a set
 * of corresponding points.
 *
 * @author Peter Abeles
 */
public class FitSpecialEuclideanOps_F32 {

	/**
	 * Creates a {@link MotionTransformPoint} for finding a {@link Se2_F32} from two
	 * sets of 2D points.
	 *
	 * @return {@link MotionTransformPoint}.
	 */
	public static MotionTransformPoint fitPoints2D() {
		return new MotionSe2PointSVD_F32();
	}

	/**
	 * Creates a {@link MotionTransformPoint} for finding a {@link Se3_F32} from two
	 * sets of 3D points.
	 *
	 * @return {@link MotionTransformPoint}.
	 */
	public static MotionTransformPoint fitPoints3D() {
		return new MotionSe3PointSVD_F32();
	}

	/**
	 * Given two sets of corresponding points compute the {@link Se2_F32} transform
	 * which minimizes the difference between the two sets of points.
	 *
	 * @param from List of the points original location.
	 * @param to Observed location of the points after a transform has been applied.
	 * @return Found transform.
	 */
	public static Se2_F32 fitPoints2D( List from, List to ) {
		MotionTransformPoint alg = fitPoints2D();

		alg.process( from, to );

		return alg.getTransformSrcToDst();
	}

	/**
	 * Given two sets of corresponding points compute the {@link Se3_F32} transform
	 * which minimizes the difference between the two sets of points.
	 *
	 * @param from List of the points original location.
	 * @param to Observed location of the points after a transform has been applied.
	 * @return Found transform.
	 */
	public static Se3_F32 fitPoints3D( List from, List to ) {
		MotionTransformPoint alg = fitPoints3D();

		alg.process( from, to );

		return alg.getTransformSrcToDst();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy