Commit a392d11d authored by Bence Magyar's avatar Bence Magyar

cv::Mat -> Mat

parent 9d6fc048
...@@ -56,16 +56,16 @@ namespace ppf_match_3d ...@@ -56,16 +56,16 @@ namespace ppf_match_3d
* and whether it should be loaded or not * and whether it should be loaded or not
* \return Returns the matrix on successfull load * \return Returns the matrix on successfull load
*/ */
CV_EXPORTS cv::Mat loadPLYSimple(const char* fileName, int withNormals); CV_EXPORTS Mat loadPLYSimple(const char* fileName, int withNormals);
/** /**
* \brief Write a point cloud to PLY file * \brief Write a point cloud to PLY file
* \param [in] fileName The PLY model file to write * \param [in] fileName The PLY model file to write
*/ */
CV_EXPORTS void writePLY(cv::Mat PC, const char* fileName); CV_EXPORTS void writePLY(Mat PC, const char* fileName);
cv::Mat samplePCUniform(cv::Mat PC, int sampleStep); Mat samplePCUniform(Mat PC, int sampleStep);
cv::Mat samplePCUniformInd(cv::Mat PC, int sampleStep, std::vector<int>& indices); Mat samplePCUniformInd(Mat PC, int sampleStep, std::vector<int>& indices);
/** /**
* Sample a point cloud using uniform steps * Sample a point cloud using uniform steps
...@@ -79,13 +79,13 @@ cv::Mat samplePCUniformInd(cv::Mat PC, int sampleStep, std::vector<int>& indices ...@@ -79,13 +79,13 @@ cv::Mat samplePCUniformInd(cv::Mat PC, int sampleStep, std::vector<int>& indices
* by the distance to the origin. This parameter enables/disables the use of weighting. * by the distance to the origin. This parameter enables/disables the use of weighting.
* \return Sampled point cloud * \return Sampled point cloud
*/ */
CV_EXPORTS cv::Mat samplePCByQuantization(cv::Mat pc, float xrange[2], float yrange[2], float zrange[2], float sample_step_relative, int weightByCenter=0); CV_EXPORTS Mat samplePCByQuantization(Mat pc, float xrange[2], float yrange[2], float zrange[2], float sample_step_relative, int weightByCenter=0);
void computeBboxStd(cv::Mat pc, float xRange[2], float yRange[2], float zRange[2]); void computeBboxStd(Mat pc, float xRange[2], float yRange[2], float zRange[2]);
void* indexPCFlann(cv::Mat pc); void* indexPCFlann(Mat pc);
void destroyFlann(void* flannIndex); void destroyFlann(void* flannIndex);
void queryPCFlann(void* flannIndex, cv::Mat& pc, cv::Mat& indices, cv::Mat& distances); void queryPCFlann(void* flannIndex, Mat& pc, Mat& indices, Mat& distances);
/** /**
* Mostly for visualization purposes. Normalizes the point cloud in a Hartley-Zissermann * Mostly for visualization purposes. Normalizes the point cloud in a Hartley-Zissermann
...@@ -96,10 +96,10 @@ void queryPCFlann(void* flannIndex, cv::Mat& pc, cv::Mat& indices, cv::Mat& dist ...@@ -96,10 +96,10 @@ void queryPCFlann(void* flannIndex, cv::Mat& pc, cv::Mat& indices, cv::Mat& dist
* @param [in] scale The scale after normalization. Default to 1. * @param [in] scale The scale after normalization. Default to 1.
* \return Normalized point cloud * \return Normalized point cloud
*/ */
CV_EXPORTS cv::Mat normalize_pc(cv::Mat pc, float scale); CV_EXPORTS Mat normalize_pc(Mat pc, float scale);
cv::Mat normalizePCCoeff(cv::Mat pc, float scale, float* Cx, float* Cy, float* Cz, float* MinVal, float* MaxVal); Mat normalizePCCoeff(Mat pc, float scale, float* Cx, float* Cy, float* Cz, float* MinVal, float* MaxVal);
cv::Mat transPCCoeff(cv::Mat pc, float scale, float Cx, float Cy, float Cz, float MinVal, float MaxVal); Mat transPCCoeff(Mat pc, float scale, float Cx, float Cy, float Cz, float MinVal, float MaxVal);
/** /**
* Transforms the point cloud with a given a homogeneous 4x4 pose matrix (in double precision) * Transforms the point cloud with a given a homogeneous 4x4 pose matrix (in double precision)
...@@ -109,7 +109,7 @@ cv::Mat transPCCoeff(cv::Mat pc, float scale, float Cx, float Cy, float Cz, floa ...@@ -109,7 +109,7 @@ cv::Mat transPCCoeff(cv::Mat pc, float scale, float Cx, float Cy, float Cz, floa
* @param [in] Pose 4x4 pose matrix, but linearized in row-major form. * @param [in] Pose 4x4 pose matrix, but linearized in row-major form.
* \return Transformed point cloud * \return Transformed point cloud
*/ */
CV_EXPORTS cv::Mat transformPCPose(cv::Mat pc, double Pose[16]); CV_EXPORTS Mat transformPCPose(Mat pc, double Pose[16]);
/** /**
* Generate a random 4x4 pose matrix * Generate a random 4x4 pose matrix
...@@ -123,7 +123,7 @@ CV_EXPORTS void getRandomPose(double Pose[16]); ...@@ -123,7 +123,7 @@ CV_EXPORTS void getRandomPose(double Pose[16]);
* @param [in] scale Input scale of the noise. The larger the scale, the more * @param [in] scale Input scale of the noise. The larger the scale, the more
* noisy the output * noisy the output
*/ */
CV_EXPORTS cv::Mat addNoisePC(cv::Mat pc, double scale); CV_EXPORTS Mat addNoisePC(Mat pc, double scale);
/** /**
* \brief Compute the normals of an arbitrary point cloud * \brief Compute the normals of an arbitrary point cloud
...@@ -140,7 +140,7 @@ CV_EXPORTS cv::Mat addNoisePC(cv::Mat pc, double scale); ...@@ -140,7 +140,7 @@ CV_EXPORTS cv::Mat addNoisePC(cv::Mat pc, double scale);
* If PCNormals is provided to be an Nx6 matrix, then no new allocation * If PCNormals is provided to be an Nx6 matrix, then no new allocation
* is made, instead the existing memory is overwritten. * is made, instead the existing memory is overwritten.
*/ */
CV_EXPORTS int computeNormalsPC3d(const cv::Mat& PC, cv::Mat& PCNormals, const int NumNeighbors, const bool FlipViewpoint, const double viewpoint[3]); CV_EXPORTS int computeNormalsPC3d(const Mat& PC, Mat& PCNormals, const int NumNeighbors, const bool FlipViewpoint, const double viewpoint[3]);
} // namespace ppf_match_3d } // namespace ppf_match_3d
} // namespace cv } // namespace cv
......
...@@ -206,7 +206,7 @@ void destroyFlann(void* flannIndex) ...@@ -206,7 +206,7 @@ void destroyFlann(void* flannIndex)
} }
// For speed purposes this function assumes that PC, Indices and Distances are created with continuous structures // For speed purposes this function assumes that PC, Indices and Distances are created with continuous structures
void queryPCFlann(void* flannIndex, cv::Mat& pc, cv::Mat& indices, cv::Mat& distances) void queryPCFlann(void* flannIndex, Mat& pc, Mat& indices, Mat& distances)
{ {
Mat obj_32f; Mat obj_32f;
pc.colRange(0,3).copyTo(obj_32f); pc.colRange(0,3).copyTo(obj_32f);
...@@ -518,11 +518,11 @@ Mat transformPCPose(Mat pc, double Pose[16]) ...@@ -518,11 +518,11 @@ Mat transformPCPose(Mat pc, double Pose[16])
Mat genRandomMat(int rows, int cols, double mean, double stddev, int type) Mat genRandomMat(int rows, int cols, double mean, double stddev, int type)
{ {
cv::Mat meanMat = mean*cv::Mat::ones(1,1,type); Mat meanMat = mean*Mat::ones(1,1,type);
cv::Mat sigmaMat= stddev*cv::Mat::ones(1,1,type); Mat sigmaMat= stddev*Mat::ones(1,1,type);
cv::RNG rng(time(0)); RNG rng(time(0));
cv::Mat matr(rows, cols,type); Mat matr(rows, cols,type);
rng.fill(matr, cv::RNG::NORMAL, meanMat, sigmaMat); rng.fill(matr, RNG::NORMAL, meanMat, sigmaMat);
return matr; return matr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment