Skip to content

Commit b527ab9

Browse files
authored
Merge pull request #1008 from Sahloul:features/python_wrapper/surface_matching
Wrap `computeNormalsPC3d()` for python
2 parents b11ce40 + 1df961c commit b527ab9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

modules/surface_matching/include/opencv2/surface_matching/ppf_helpers.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Mat samplePCUniformInd(Mat PC, int sampleStep, std::vector<int>& indices);
8989
* @param [in] zrange Z components (min and max) of the bounding box of the model
9090
* @param [in] sample_step_relative The point cloud is sampled such that all points
9191
* have a certain minimum distance. This minimum distance is determined relatively using
92-
* the parameter sample_step_relative.
92+
* the parameter sample_step_relative.
9393
* @param [in] weightByCenter The contribution of the quantized data points can be weighted
9494
* by the distance to the origin. This parameter enables/disables the use of weighting.
9595
* @return Sampled point cloud
@@ -135,7 +135,7 @@ CV_EXPORTS void getRandomPose(double Pose[16]);
135135

136136
/**
137137
* Adds a uniform noise in the given scale to the input point cloud
138-
* @param [in] pc Input point cloud (CV_32F family).
138+
* @param [in] pc Input point cloud (CV_32F family).
139139
* @param [in] scale Input scale of the noise. The larger the scale, the more noisy the output
140140
*/
141141
CV_EXPORTS Mat addNoisePC(Mat pc, double scale);
@@ -148,13 +148,13 @@ CV_EXPORTS Mat addNoisePC(Mat pc, double scale);
148148
* If PCNormals is provided to be an Nx6 matrix, then no new allocation
149149
* is made, instead the existing memory is overwritten.
150150
* @param [in] PC Input point cloud to compute the normals for.
151-
* @param [in] PCNormals Output point cloud
151+
* @param [out] PCNormals Output point cloud
152152
* @param [in] NumNeighbors Number of neighbors to take into account in a local region
153153
* @param [in] FlipViewpoint Should normals be flipped to a viewing direction?
154154
* @param [in] viewpoint
155155
* @return Returns 0 on success
156156
*/
157-
CV_EXPORTS int computeNormalsPC3d(const Mat& PC, Mat& PCNormals, const int NumNeighbors, const bool FlipViewpoint, const double viewpoint[3]);
157+
CV_EXPORTS_W int computeNormalsPC3d(const Mat& PC, CV_OUT Mat& PCNormals, const int NumNeighbors, const bool FlipViewpoint, const Vec3d& viewpoint);
158158

159159
//! @}
160160

modules/surface_matching/samples/ppf_normal_computation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int main(int argc, char** argv)
6565
cv::ppf_match_3d::loadPLYSimple(modelFileName.c_str(), 1).copyTo(points);
6666

6767
cout << "Computing normals\n";
68-
double viewpoint[3] = { 0.0, 0.0, 0.0 };
68+
cv::Vec3d viewpoint(0, 0, 0);
6969
cv::ppf_match_3d::computeNormalsPC3d(points, pointsAndNormals, 6, false, viewpoint);
7070

7171
std::cout << "Writing points\n";

modules/surface_matching/src/ppf_helpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ void meanCovLocalPCInd(const float* pc, const int* Indices, const int ws, const
720720

721721
}
722722

723-
CV_EXPORTS int computeNormalsPC3d(const Mat& PC, Mat& PCNormals, const int NumNeighbors, const bool FlipViewpoint, const double viewpoint[3])
723+
CV_EXPORTS int computeNormalsPC3d(const Mat& PC, Mat& PCNormals, const int NumNeighbors, const bool FlipViewpoint, const Vec3d& viewpoint)
724724
{
725725
int i;
726726

0 commit comments

Comments
 (0)