1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-23 18:09:25 +08:00

Refactored API classes, removed unused params

This commit is contained in:
Bence Magyar
2014-09-02 13:24:36 +02:00
parent 995b696360
commit 3f620fd19f
7 changed files with 127 additions and 136 deletions

View File

@@ -89,9 +89,9 @@ public:
ICP()
{
m_tolerence = 0.005f;
m_tolerance = 0.005f;
m_rejectionScale = 2.5f;
m_maxItereations = 250;
m_maxIterations = 250;
m_numLevels = 6;
m_sampleType = ICP_SAMPLING_TYPE_UNIFORM;
m_numNeighborsCorr = 1;
@@ -112,10 +112,10 @@ public:
*/
ICP(const int iterations, const float tolerence=0.05, const float rejectionScale=2.5, const int numLevels=6, const ICP_SAMPLING_TYPE sampleType = ICP_SAMPLING_TYPE_UNIFORM, const int numMaxCorr=1)
{
m_tolerence = tolerence;
m_tolerance = tolerence;
m_numNeighborsCorr = numMaxCorr;
m_rejectionScale = rejectionScale;
m_maxItereations = iterations;
m_maxIterations = iterations;
m_numLevels = numLevels;
m_sampleType = sampleType;
}
@@ -147,8 +147,8 @@ public:
int registerModelToScene(const Mat& srcPC, const Mat& dstPC, std::vector<Pose3D*>& poses);
private:
float m_tolerence;
int m_maxItereations;
float m_tolerance;
int m_maxIterations;
float m_rejectionScale;
int m_numNeighborsCorr;
int m_numLevels;

View File

@@ -66,7 +66,7 @@ public:
residual = 0;
for (int i=0; i<16; i++)
Pose[i]=0;
pose[i]=0;
}
Pose3D(double Alpha, unsigned int ModelIndex=0, unsigned int NumVotes=0)
@@ -77,7 +77,7 @@ public:
residual=0;
for (int i=0; i<16; i++)
Pose[i]=0;
pose[i]=0;
}
/**
@@ -117,7 +117,7 @@ public:
double alpha, residual;
unsigned int modelIndex;
unsigned int numVotes;
double Pose[16], angle, t[3], q[4];
double pose[16], angle, t[3], q[4];
};
/**

View File

@@ -67,16 +67,14 @@ namespace cv
namespace ppf_match_3d
{
#define T_PPF_LENGTH 5
/**
* @struct THash
* @brief Struct, holding a node in the hashtable
*/
typedef struct THash
{
int id;
int i, ppfInd;
int id;
int i, ppfInd;
} THash;
/**
@@ -113,13 +111,11 @@ public:
/**
* Set the parameters for the search
* @param [in] numPoses The maximum number of poses to return
* @param [in] positionThreshold Position threshold controlling the similarity of translations. Depends on the units of calibration/model.
* @param [in] rotationThreshold Position threshold controlling the similarity of rotations. This parameter can be perceived as a threshold over the difference of angles
* @param [in] minMatchScore Not used at the moment
* @param [in] useWeightedClustering The algorithm by default clusters the poses without weighting. A non-zero value would indicate that the pose clustering should take into account the number of votes as the weights and perform a weighted averaging instead of a simple one.
*/
void setSearchParams(const int numPoses=5, const double positionThreshold=-1, const double rotationThreshold=-1, const double minMatchScore=0.5, const bool useWeightedClustering=false);
void setSearchParams(const double positionThreshold=-1, const double rotationThreshold=-1, const bool useWeightedClustering=false);
/**
* \brief Trains a new model.
@@ -145,19 +141,17 @@ public:
protected:
double maxDist, angle_step, angleStepRadians, distance_step;
double samplingStepRelative, angleStepRelative, distanceStepRelative;
Mat inputPC, sampledPC, PPF;
int num_ref_points, sampled_step, ppf_step;
double angle_step, angle_step_radians, distance_step;
double sampling_step_relative, angle_step_relative, distance_step_relative;
Mat sampled_pc, ppf;
int num_ref_points, ppf_step;
hashtable_int* hash_table;
THash* hash_nodes;
int NumPoses;
double PositionThreshold, RotationThreshold, MinMatchScore;
bool UseWeightedAvg;
double position_threshold, rotation_threshold;
bool use_weighted_avg;
float sampleStepSearch;
int SceneSampleStep;
int scene_sample_step;
void clearTrainingModels();