BitmapToolkit Scol plugin
|
ArMarker.cpp
Go to the documentation of this file.
138 cv::rectangle(image, (*this)[0]-cv::Point2f(2,2), (*this)[0]+cv::Point2f(2,2), cv::Scalar(0,0,255), lineWidth, cv::LINE_AA);
139 cv::rectangle(image, (*this)[1]-cv::Point2f(2,2), (*this)[1]+cv::Point2f(2,2), cv::Scalar(0,255,0), lineWidth, cv::LINE_AA);
140 cv::rectangle(image, (*this)[2]-cv::Point2f(2,2), (*this)[2]+cv::Point2f(2,2), cv::Scalar(255,0,0), lineWidth, cv::LINE_AA);
194 pixelPosition.z = sqrt(pow((marker[1].x - marker[0].x),2) + pow((marker[1].y - marker[0].y),2));
195 pixelPosition.z += sqrt(pow((marker[2].x - marker[1].x),2) + pow((marker[2].y - marker[1].y),2));
196 pixelPosition.z += sqrt(pow((marker[3].x - marker[2].x),2) + pow((marker[3].y - marker[2].y),2));
197 pixelPosition.z += sqrt(pow((marker[0].x - marker[3].x),2) + pow((marker[0].y - marker[3].y),2));
203 //cv::circle(image, Point(pixelPosition.x, pixelPosition.y),pixelPosition.z/2,cv::Scalar(255,0,255));
208 SetPosition(Vector3(static_cast<float>(reverse ? -modelview_matrix[12] : modelview_matrix[12]) + offset.x, static_cast<float>(modelview_matrix[13]) + offset.y, static_cast<float>(modelview_matrix[14]) + offset.z));
209 SetOrientation(BtQuaternion::FromRotationMatrix(modelview_matrix, reverse));// *BtQuaternion(sqrt(0.5f), 0.0f, sqrt(0.5f), 0.0f));
213void ArMarker::Update(cv::Mat frame, cv::Mat color, aruco::CameraParameters& camparam, bool reverse)
243 //bool found = (m_visible && m_fmarker->detectMotionFlow(m_lastFrame)) ? true : m_fmarker->detectFeatured(m_lastFrame);
280 pixelPosition.z = sqrt(pow((m_fmarker->at(1).x - m_fmarker->at(0).x),2) + pow((m_fmarker->at(1).y - m_fmarker->at(0).y),2));
281 pixelPosition.z += sqrt(pow((m_fmarker->at(2).x - m_fmarker->at(1).x),2) + pow((m_fmarker->at(2).y - m_fmarker->at(1).y),2));
282 pixelPosition.z += sqrt(pow((m_fmarker->at(3).x - m_fmarker->at(2).x),2) + pow((m_fmarker->at(3).y - m_fmarker->at(2).y),2));
283 pixelPosition.z += sqrt(pow((m_fmarker->at(0).x - m_fmarker->at(3).x),2) + pow((m_fmarker->at(0).y - m_fmarker->at(3).y),2));
289 //cv::circle(image, Point(pixelPosition.x, pixelPosition.y),pixelPosition.z/2,cv::Scalar(255,0,255));
293 SetPosition(Vector3(static_cast<float>(m_lastReverse ? -modelview_matrix[12] : modelview_matrix[12]), static_cast<float>(modelview_matrix[13]), static_cast<float>(modelview_matrix[14])));
Definition ArCameraParam.h:43
void Update(ArCameraParam &camparam, aruco::Marker &marker, bool reverse)
Definition ArMarker.cpp:167
ArMarker(unsigned int nid, float markerSize=-1, MarkerType type=AR_ARUCO_MARKER)
Definition ArMarker.cpp:29
Definition Prerequisites.h:284
static BtQuaternion FromRotationMatrix(double rotMatrix[16], bool reverseX=false, bool reverseY=true)
Definition Prerequisites.h:396
Definition Prerequisites.h:177
Generated by 1.9.8