Skip to content
Snippets Groups Projects
Commit 9cb3de77 authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

IcpVisitor renamed to IcpTransformator

parent bf7053f6
No related branches found
No related tags found
No related merge requests found
package cz.fidentis.analyst.face; package cz.fidentis.analyst;
import cz.fidentis.analyst.icp.IcpVisitor; import cz.fidentis.analyst.face.AvgFaceConstructor;
import cz.fidentis.analyst.face.HumanFace;
import cz.fidentis.analyst.face.HumanFaceFactory;
import cz.fidentis.analyst.icp.IcpTransformer;
import cz.fidentis.analyst.icp.UndersamplingStrategy; import cz.fidentis.analyst.icp.UndersamplingStrategy;
import cz.fidentis.analyst.kdtree.KdTree; import cz.fidentis.analyst.kdtree.KdTree;
import cz.fidentis.analyst.mesh.core.MeshFacet; import cz.fidentis.analyst.mesh.core.MeshFacet;
...@@ -56,7 +59,7 @@ public class BatchProcessor { ...@@ -56,7 +59,7 @@ public class BatchProcessor {
int facesCounter = faces.size(); int facesCounter = faces.size();
HumanFaceFactory.instance().setStrategy(HumanFaceFactory.Strategy.MRU); HumanFaceFactory.instance().setStrategy(HumanFaceFactory.Strategy.MRU);
KdTree kdTree = primaryFace.computeKdTree(true); KdTree kdTree = primaryFace.computeKdTree(true);
IcpVisitor icpVisitor = new IcpVisitor(kdTree, iters, true, error, strategy); IcpTransformer icpVisitor = new IcpTransformer(kdTree, iters, true, error, strategy);
for (String facePath: faces) { for (String facePath: faces) {
String faceId = HumanFaceFactory.instance().loadFace(new File(facePath)); String faceId = HumanFaceFactory.instance().loadFace(new File(facePath));
......
...@@ -19,12 +19,12 @@ import javax.vecmath.Point3d; ...@@ -19,12 +19,12 @@ import javax.vecmath.Point3d;
import javax.vecmath.Vector3d; import javax.vecmath.Vector3d;
/** /**
* Visitor for Iterative Closest Point (ICP) algorithm that minimizes Hausdorff distance * Visitor applying the Iterative Closest Point (ICP) algorithm to minimize
* of two triangular meshes. * Hausdorff distance of two triangular meshes.
* Inspected mesh facets are transformed (!) and the history of their transformations * Inspected mesh facets are transformed (!) (vertices are moved) and the history
* (transformation performed in each ICP iteration) is returned. * of their transformations (transformation performed in each ICP iteration) is returned.
* <p> * <p>
* This visitor is <strong>is not thread-safe</strong> due to efficiency reasons * This visitor <strong>is not thread-safe</strong> due to efficiency reasons
* and because of the algorithm principle, when it iterates multiple times through * and because of the algorithm principle, when it iterates multiple times through
* each inspected facet. Therefore, concurrent ICP transformation has to use * each inspected facet. Therefore, concurrent ICP transformation has to use
* an individual ICP visitor for each transformed (inspected) mesh facet. * an individual ICP visitor for each transformed (inspected) mesh facet.
...@@ -35,7 +35,7 @@ import javax.vecmath.Vector3d; ...@@ -35,7 +35,7 @@ import javax.vecmath.Vector3d;
* @author Maria Kocurekova * @author Maria Kocurekova
* @author Radek Oslejsek * @author Radek Oslejsek
*/ */
public class IcpVisitor extends MeshVisitor { public class IcpTransformer extends MeshVisitor {
/** /**
* Transformed mesh facets and their history of transformations. * Transformed mesh facets and their history of transformations.
...@@ -80,7 +80,7 @@ public class IcpVisitor extends MeshVisitor { ...@@ -80,7 +80,7 @@ public class IcpVisitor extends MeshVisitor {
* @param strategy One of the reduction strategies. If {@code null}, then {@link NoUndersampling} is used. * @param strategy One of the reduction strategies. If {@code null}, then {@link NoUndersampling} is used.
* @throws IllegalArgumentException if some parameter is wrong * @throws IllegalArgumentException if some parameter is wrong
*/ */
public IcpVisitor(MeshFacet mainFacet, int maxIteration, boolean scale, double error, UndersamplingStrategy strategy) { public IcpTransformer(MeshFacet mainFacet, int maxIteration, boolean scale, double error, UndersamplingStrategy strategy) {
this(new HashSet<>(Collections.singleton(mainFacet)), maxIteration, scale, error, strategy); this(new HashSet<>(Collections.singleton(mainFacet)), maxIteration, scale, error, strategy);
if (mainFacet == null) { if (mainFacet == null) {
throw new IllegalArgumentException("mainFacet"); throw new IllegalArgumentException("mainFacet");
...@@ -101,7 +101,7 @@ public class IcpVisitor extends MeshVisitor { ...@@ -101,7 +101,7 @@ public class IcpVisitor extends MeshVisitor {
* @param strategy One of the reduction strategies. If {@code null}, then {@link NoUndersampling} is used. * @param strategy One of the reduction strategies. If {@code null}, then {@link NoUndersampling} is used.
* @throws IllegalArgumentException if some parameter is wrong * @throws IllegalArgumentException if some parameter is wrong
*/ */
public IcpVisitor(Set<MeshFacet> mainFacets, int maxIteration, boolean scale, double error, UndersamplingStrategy strategy) { public IcpTransformer(Set<MeshFacet> mainFacets, int maxIteration, boolean scale, double error, UndersamplingStrategy strategy) {
if (mainFacets == null) { if (mainFacets == null) {
throw new IllegalArgumentException("mainFacets"); throw new IllegalArgumentException("mainFacets");
} }
...@@ -132,7 +132,7 @@ public class IcpVisitor extends MeshVisitor { ...@@ -132,7 +132,7 @@ public class IcpVisitor extends MeshVisitor {
* @param strategy One of the reduction strategies. If {@code null}, then {@link NoUndersampling} is used. * @param strategy One of the reduction strategies. If {@code null}, then {@link NoUndersampling} is used.
* @throws IllegalArgumentException if some parameter is wrong * @throws IllegalArgumentException if some parameter is wrong
*/ */
public IcpVisitor(MeshModel mainModel, int maxIteration, boolean scale, double error, UndersamplingStrategy strategy) { public IcpTransformer(MeshModel mainModel, int maxIteration, boolean scale, double error, UndersamplingStrategy strategy) {
this(new HashSet<>(mainModel.getFacets()), maxIteration, scale, error, strategy); this(new HashSet<>(mainModel.getFacets()), maxIteration, scale, error, strategy);
if (mainModel.getFacets().isEmpty()) { if (mainModel.getFacets().isEmpty()) {
throw new IllegalArgumentException("mainModel"); throw new IllegalArgumentException("mainModel");
...@@ -152,7 +152,7 @@ public class IcpVisitor extends MeshVisitor { ...@@ -152,7 +152,7 @@ public class IcpVisitor extends MeshVisitor {
* @param strategy One of the reduction strategies. If {@code null}, then {@link NoUndersampling} is used. * @param strategy One of the reduction strategies. If {@code null}, then {@link NoUndersampling} is used.
* @throws IllegalArgumentException if some parameter is wrong * @throws IllegalArgumentException if some parameter is wrong
*/ */
public IcpVisitor(KdTree primaryKdTree, int maxIteration, boolean scale, double error, UndersamplingStrategy strategy) { public IcpTransformer(KdTree primaryKdTree, int maxIteration, boolean scale, double error, UndersamplingStrategy strategy) {
if (primaryKdTree == null) { if (primaryKdTree == null) {
throw new IllegalArgumentException("primaryKdTree"); throw new IllegalArgumentException("primaryKdTree");
} }
......
...@@ -14,7 +14,7 @@ import static com.jogamp.opengl.GL2GL3.GL_LINE; ...@@ -14,7 +14,7 @@ import static com.jogamp.opengl.GL2GL3.GL_LINE;
import com.jogamp.opengl.GLAutoDrawable; import com.jogamp.opengl.GLAutoDrawable;
import static com.jogamp.opengl.fixedfunc.GLMatrixFunc.GL_MODELVIEW_MATRIX; import static com.jogamp.opengl.fixedfunc.GLMatrixFunc.GL_MODELVIEW_MATRIX;
import static com.jogamp.opengl.fixedfunc.GLMatrixFunc.GL_PROJECTION_MATRIX; import static com.jogamp.opengl.fixedfunc.GLMatrixFunc.GL_PROJECTION_MATRIX;
import cz.fidentis.analyst.icp.IcpVisitor; import cz.fidentis.analyst.icp.IcpTransformer;
import cz.fidentis.analyst.icp.RandomStrategy; import cz.fidentis.analyst.icp.RandomStrategy;
//import cz.fidentis.analyst.face.HumanFace; //import cz.fidentis.analyst.face.HumanFace;
import cz.fidentis.analyst.mesh.core.MeshFacet; import cz.fidentis.analyst.mesh.core.MeshFacet;
...@@ -86,7 +86,7 @@ public class RegistrationGLEventListener extends GeneralGLEventListener{ ...@@ -86,7 +86,7 @@ public class RegistrationGLEventListener extends GeneralGLEventListener{
primaryModel = model; primaryModel = model;
} }
else { else {
IcpVisitor icpVisitor = new IcpVisitor(primaryModel, 10, true, 0.05, new RandomStrategy(0.5)); IcpTransformer icpVisitor = new IcpTransformer(primaryModel, 10, true, 0.05, new RandomStrategy(0.5));
for (MeshFacet f: model.getFacets()) { for (MeshFacet f: model.getFacets()) {
icpVisitor.visitMeshFacet(f); icpVisitor.visitMeshFacet(f);
} }
......
package cz.fidentis.analyst.tests; package cz.fidentis.analyst.tests;
import cz.fidentis.analyst.face.BatchProcessor; import cz.fidentis.analyst.BatchProcessor;
import cz.fidentis.analyst.face.HumanFace; import cz.fidentis.analyst.face.HumanFace;
import cz.fidentis.analyst.face.HumanFaceFactory; import cz.fidentis.analyst.face.HumanFaceFactory;
import cz.fidentis.analyst.icp.IcpTransformation; import cz.fidentis.analyst.icp.IcpTransformation;
import cz.fidentis.analyst.icp.IcpVisitor; import cz.fidentis.analyst.icp.IcpTransformer;
import cz.fidentis.analyst.icp.RandomStrategy; import cz.fidentis.analyst.icp.RandomStrategy;
import cz.fidentis.analyst.icp.UndersamplingStrategy; import cz.fidentis.analyst.icp.UndersamplingStrategy;
import cz.fidentis.analyst.kdtree.KdTree; import cz.fidentis.analyst.kdtree.KdTree;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment