Skip to content

Commit

Permalink
load camera data and coefficients in the Tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
kalwalt committed Oct 27, 2023
1 parent a1101f0 commit 5e986a9
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ class WebARKitTracker::WebARKitTrackerImpl {
public:
WebARKitTrackerImpl()
: corners(4), initialized(false), output(17, 0.0), _valid(false), _isDetected(false), numMatches(0),
minNumMatches(MIN_NUM_MATCHES), _nn_match_ratio(0.7f){};
minNumMatches(MIN_NUM_MATCHES), _nn_match_ratio(0.7f){
m_camMatrix = cv::Mat();
m_distortionCoeff = cv::Mat();
};
~WebARKitTrackerImpl() = default;

void initialize(webarkit::TRACKER_TYPE trackerType, int frameWidth, int frameHeight) {
Expand All @@ -24,6 +27,8 @@ class WebARKitTracker::WebARKitTrackerImpl {
}
_camera->setupCamera(frameWidth, frameHeight);
_camera->printSettings();
m_camMatrix = cv::Mat(3,3, CV_64FC1, _camera->getCameraData().data());
m_distortionCoeff = cv::Mat(6, 1, CV_64FC1, _camera->getDistortionCoefficients().data());
}

void initTracker(uchar* refData, size_t refCols, size_t refRows) {
Expand Down Expand Up @@ -292,6 +297,9 @@ class WebARKitTracker::WebARKitTrackerImpl {

WebARKitCamera* _camera = new WebARKitCamera();

cv::Mat m_camMatrix;
cv::Mat m_distortionCoeff;

private:
std::vector<double> output; // 9 from homography matrix, 8 from warped corners*/

Expand Down

0 comments on commit 5e986a9

Please sign in to comment.