Use std_vector instead of wrapping ourself.
This commit is contained in:
parent
49c0f9831b
commit
9dbdf34f32
3 changed files with 13 additions and 51 deletions
|
|
@ -10,6 +10,6 @@
|
|||
%include "gcv_core.hpp"
|
||||
|
||||
namespace std {
|
||||
%template(IntVector) vector<int>;
|
||||
%template(DoubleVector) vector<double>;
|
||||
%template(GcvPoint3fVector) vector<cv::Point3f>;
|
||||
%template(GcvPoint2fVector) vector<cv::Point2f>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,17 +16,17 @@ import "testing"
|
|||
// [ 0.00000000e+00 0.00000000e+00 1.00000000e+00]]
|
||||
|
||||
func TestGcvInitCameraMatrix2D(t *testing.T) {
|
||||
objPts := NewGcvVecPoint3f()
|
||||
objPts.PushBack(NewGcvPoint3f(0, 25, 0).Get())
|
||||
objPts.PushBack(NewGcvPoint3f(0, -25, 0).Get())
|
||||
objPts.PushBack(NewGcvPoint3f(-47, 25, 0).Get())
|
||||
objPts.PushBack(NewGcvPoint3f(-47, -25, 0).Get())
|
||||
objPts := NewGcvPoint3fVector(int64(4))
|
||||
objPts.Set(0, NewGcvPoint3f(0, 25, 0).Get())
|
||||
objPts.Set(1, NewGcvPoint3f(0, -25, 0).Get())
|
||||
objPts.Set(2, NewGcvPoint3f(-47, 25, 0).Get())
|
||||
objPts.Set(3, NewGcvPoint3f(-47, -25, 0).Get())
|
||||
|
||||
imgPts := NewGcvVecPoint2f()
|
||||
imgPts.PushBack(NewGcvPoint2f(1136.4140625, 1041.89208984).Get())
|
||||
imgPts.PushBack(NewGcvPoint2f(1845.33190918, 671.39581299).Get())
|
||||
imgPts.PushBack(NewGcvPoint2f(302.73373413, 634.79998779).Get())
|
||||
imgPts.PushBack(NewGcvPoint2f(1051.46154785, 352.76107788).Get())
|
||||
imgPts := NewGcvPoint2fVector(int64(4))
|
||||
imgPts.Set(0, NewGcvPoint2f(1136.4140625, 1041.89208984).Get())
|
||||
imgPts.Set(1, NewGcvPoint2f(1845.33190918, 671.39581299).Get())
|
||||
imgPts.Set(2, NewGcvPoint2f(302.73373413, 634.79998779).Get())
|
||||
imgPts.Set(3, NewGcvPoint2f(1051.46154785, 352.76107788).Get())
|
||||
|
||||
GcvInitCameraMatrix2D(objPts.Get(), imgPts.Get())
|
||||
GcvInitCameraMatrix2D(objPts, imgPts)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,25 +18,6 @@ private:
|
|||
cv::Point3f _data;
|
||||
};
|
||||
|
||||
class GcvVecPoint3f
|
||||
{
|
||||
public:
|
||||
GcvVecPoint3f () {};
|
||||
~GcvVecPoint3f () {};
|
||||
|
||||
void PushBack(cv::Point3f pt) {
|
||||
_data.push_back(pt);
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
_data.clear();
|
||||
}
|
||||
|
||||
std::vector<cv::Point3f> Get() { return _data; }
|
||||
private:
|
||||
std::vector<cv::Point3f> _data;
|
||||
};
|
||||
|
||||
class GcvPoint2f
|
||||
{
|
||||
public:
|
||||
|
|
@ -51,22 +32,3 @@ public:
|
|||
private:
|
||||
cv::Point2f _data;
|
||||
};
|
||||
|
||||
class GcvVecPoint2f
|
||||
{
|
||||
public:
|
||||
GcvVecPoint2f () {};
|
||||
~GcvVecPoint2f () {};
|
||||
|
||||
void PushBack(cv::Point2f pt) {
|
||||
_data.push_back(pt);
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
_data.clear();
|
||||
}
|
||||
|
||||
std::vector<cv::Point2f> Get() { return _data; }
|
||||
private:
|
||||
std::vector<cv::Point2f> _data;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue