33 cv::Mat Distorsion=cv::Mat::zeros(5,1,CV_32FC1);
34 cv::Mat CameraMatrix=cv::Mat::eye(3,3,CV_32FC1);
37 float f = std::max(bitmapSize.width, bitmapSize.height);
39 CameraMatrix.at<
float>(0, 0) = f;
40 CameraMatrix.at<
float>(0, 2) =
static_cast<float>(bitmapSize.width) * 0.5f;
41 CameraMatrix.at<
float>(1, 1) = f;
42 CameraMatrix.at<
float>(1, 2) =
static_cast<float>(bitmapSize.height) * 0.5f;
44 Distorsion.at<
float>(0, 0) = 0.0f;
45 Distorsion.at<
float>(1, 0) = 0.0f;
46 Distorsion.at<
float>(2, 0) = 0.0f;
47 Distorsion.at<
float>(3, 0) = 0.0f;
48 Distorsion.at<
float>(4, 0) = 0.0f;
50 camParam = aruco::CameraParameters(CameraMatrix, Distorsion, bitmapSize);
59 cv::Mat Distorsion = cv::Mat::zeros(5, 1, CV_32FC1);
60 cv::Mat CameraMatrix = cv::Mat::eye(3, 3, CV_32FC1);
62 CameraMatrix.at<
float>(0, 0) = flength.
x;
63 CameraMatrix.at<
float>(0, 2) = center.
x;
64 CameraMatrix.at<
float>(1, 1) = flength.
y;
65 CameraMatrix.at<
float>(1, 2) = center.
y;
67 Distorsion.at<
float>(0, 0) = 0.0f;
68 Distorsion.at<
float>(1, 0) = 0.0f;
69 Distorsion.at<
float>(2, 0) = 0.0f;
70 Distorsion.at<
float>(3, 0) = 0.0f;
71 Distorsion.at<
float>(4, 0) = 0.0f;
73 camParam = aruco::CameraParameters(CameraMatrix, Distorsion, bitmapSize);
82 bitmapSize = CI.bitmapSize;
84 clipping = CI.clipping;
89 std::vector<ArImuData> imuCpy;
90 for (
unsigned int i = 0; i < cimu.size(); i++)
103 if (!yamlfile.empty())
107 camParam.readFromXMLFile(yamlfile.c_str());
109 catch (cv::Exception e)
111 MMechostr(MSKDEBUG,
"ArCameraParam::SetCameraParameter cloud not read file : %s", yamlfile.c_str());
123 bitmapSize.height = height;
124 bitmapSize.width = width;
134 clipping.x = std::max(0.001f, nearclip);
135 clipping.y = std::max(0.002f, std::min(100000.0f, farclip));
142 camParam.glGetProjectionMatrix(bitmapSize, screensize, m_proj, clipping.x, clipping.y,
true);
144 catch(cv::Exception e)
146 MMechostr(MSKDEBUG,
"error : %s \n", e.what());
cv::Point2f GetClipping()
void SetCameraOffset(Vector3 offset)
void SetCameraQuat(BtQuaternion quat)
BtQuaternion GetCameraQuat()
void GetProjectionMatrix(double m_proj[16], cv::Size screensize)
void AddCameraImu(Vector3 gyro, Vector3 accel, double delta)
void SetClipping(float nearclip, float farclip)
std::vector< ArImuData > GetCameraImu() const
Vector3 GetCameraOffset()
void SetBitmapSize(int width, int height)
void SetCameraParameter(std::string yamlfile)
std::vector< ArImuData > mImuData
aruco::CameraParameters GetCameraParameter()
aruco::CameraParameters camParam