Skip to content

Commit

Permalink
Initial commit of more stereo bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelarusso committed Oct 2, 2023
1 parent 579545a commit 4f45958
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions calib3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,11 @@ Mat EstimateAffine2D(Point2fVector from, Point2fVector to) {
Mat EstimateAffine2DWithParams(Point2fVector from, Point2fVector to, Mat inliers, int method, double ransacReprojThreshold, size_t maxIters, double confidence, size_t refineIters) {
return new cv::Mat(cv::estimateAffine2D(*from, *to, *inliers, method, ransacReprojThreshold, maxIters, confidence, refineIters));
}

void TriangulatePoints(Mat projMatr1, Mat projMatr2, Point2fVector projPoints1, Point2fVector projPoints2, Mat points4D) {
return cv::triangulatePoints(*projMatr1, *projMatr2, *projPoints1, *projPoints2, *points4D);
}

void ConvertPointsFromHomogeneous(Mat src, Mat dst) {
return cv::convertPointsFromHomogeneous(*src, *dst);
}
8 changes: 8 additions & 0 deletions calib3d.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,11 @@ func EstimateAffine2D(from, to Point2fVector) Mat {
func EstimateAffine2DWithParams(from Point2fVector, to Point2fVector, inliers Mat, method int, ransacReprojThreshold float64, maxIters uint, confidence float64, refineIters uint) Mat {
return newMat(C.EstimateAffine2DWithParams(from.p, to.p, inliers.p, C.int(method), C.double(ransacReprojThreshold), C.size_t(maxIters), C.double(confidence), C.size_t(refineIters)))
}

func TriangulatePoints(projMatr1 Mat, projMatr2 Mat, projPoints1, projPoints2 Point2fVector, points4D *Mat) {
C.TriangulatePoints(projMatr1.Ptr(), projMatr2.Ptr(), projPoints1.p, projPoints2.p, points4D.Ptr())
}

func ConvertPointsFromHomogeneous(src Mat, dst *Mat) {
C.ConvertPointsFromHomogeneous(src.Ptr(), dst.Ptr())
}
2 changes: 2 additions & 0 deletions calib3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Mat EstimateAffinePartial2D(Point2fVector from, Point2fVector to);
Mat EstimateAffinePartial2DWithParams(Point2fVector from, Point2fVector to, Mat inliers, int method, double ransacReprojThreshold, size_t maxIters, double confidence, size_t refineIters);
Mat EstimateAffine2D(Point2fVector from, Point2fVector to);
Mat EstimateAffine2DWithParams(Point2fVector from, Point2fVector to, Mat inliers, int method, double ransacReprojThreshold, size_t maxIters, double confidence, size_t refineIters);
void TriangulatePoints(Mat projMatr1, Mat projMatr2, Point2fVector projPoints1, Point2fVector projPoints2, Mat points4D);
void ConvertPointsFromHomogeneous(Mat src, Mat dst);
#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 4 additions & 0 deletions calib3d_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,3 +668,7 @@ func TestEstimateAffine2DWithParams(t *testing.T) {
t.Errorf("TestEstimateAffine2DWithParams(): unexpected rows = %v, want = %v", m.Rows(), 2)
}
}

func TestTriangulatePoints(t *testing.T) {

}

0 comments on commit 4f45958

Please sign in to comment.