mostafi1391
شنبه 18 مرداد 1393, 16:06 عصر
با سلام من دارم سی ++ رو همزمان با پردازش تصویر (اوپن سی وی) کار میکنم متاسفانه چون هنوز با سبنتاکس مشکل دارم تو بعضی جاها به مشکل بر میخورم اگه مقدوره کدی رو میذارم بعضی جاهاش برام توضیح بدین ممنون
The following code contains a declaration of the ARDrawingContext class:
class ARDrawingContext
{
public:
ARDrawingContext(const CameraCalibration& c);
bool patternPresent;
Transformation patternPose;
//! Request the redraw of the OpenGl window
void draw();
//! Set the new frame for the background
void updateBackground(const cv::Mat& frame);
private:
//! Draws the background with video
void drawCameraFrame ();
بفرما که تو خط 5--- CameraCalibration& c دقیقا معنیش چیه و چیکار میکنه؟
تو خط 7-- Transformation patternPose آیا متغییری ار نوع Transformationساخته میشه؟
تو خط 11-- Mat& frame ---- معنی مت میدونم ولی با رفررنس و فریم مشکل دارم
بعدا تو کد زیر
As we now have a separate class for storing the visualization state, we modify the
cv::setOpenGlDrawCallback call and pass an instance of ARDrawingContext
as the parameter.
The modifed callback function is as follows:
void ARDrawingContextDrawCallback(void* param)
{
ARDrawingContext * ctx = static_cast<ARDrawingContext*>(param);
if (ctx)
{
ctx->draw();
}
}
تو خط 7--- منظور از آستریک ردر انتهای static_cast<ARDrawingContext*> و (param)چیه؟
if (isPatternPresent)
{
// Set the pattern transformation
Matrix44 glMatrix = patternPose.getMat44();
glLoadMatrixf(reinterpret_cast<const
GLfloat*>(&glMatrix.data[0]));
// Render model
drawCoordinateAxis();
drawCubeModel();
}
}
خط 4-- برام توضیح بدین
تو خط 6---- بعد ار کست کردن چی شده GLfloat*>(&glMatrix.data[0]));
شرمنده این یادم رفت بود
bool CheckCoherentRotation(cv::Mat_<double>& R) {
if(fabsf(determinant(R))-1.0 > 1e-07) {
cerr<<"det(R) != +-1.0, this is not a rotation matrix"<<endl;
return false;
}
return true;
تو خط اول چه اتفاقی میفته (cv::Mat_<double>& R)
The following code contains a declaration of the ARDrawingContext class:
class ARDrawingContext
{
public:
ARDrawingContext(const CameraCalibration& c);
bool patternPresent;
Transformation patternPose;
//! Request the redraw of the OpenGl window
void draw();
//! Set the new frame for the background
void updateBackground(const cv::Mat& frame);
private:
//! Draws the background with video
void drawCameraFrame ();
بفرما که تو خط 5--- CameraCalibration& c دقیقا معنیش چیه و چیکار میکنه؟
تو خط 7-- Transformation patternPose آیا متغییری ار نوع Transformationساخته میشه؟
تو خط 11-- Mat& frame ---- معنی مت میدونم ولی با رفررنس و فریم مشکل دارم
بعدا تو کد زیر
As we now have a separate class for storing the visualization state, we modify the
cv::setOpenGlDrawCallback call and pass an instance of ARDrawingContext
as the parameter.
The modifed callback function is as follows:
void ARDrawingContextDrawCallback(void* param)
{
ARDrawingContext * ctx = static_cast<ARDrawingContext*>(param);
if (ctx)
{
ctx->draw();
}
}
تو خط 7--- منظور از آستریک ردر انتهای static_cast<ARDrawingContext*> و (param)چیه؟
if (isPatternPresent)
{
// Set the pattern transformation
Matrix44 glMatrix = patternPose.getMat44();
glLoadMatrixf(reinterpret_cast<const
GLfloat*>(&glMatrix.data[0]));
// Render model
drawCoordinateAxis();
drawCubeModel();
}
}
خط 4-- برام توضیح بدین
تو خط 6---- بعد ار کست کردن چی شده GLfloat*>(&glMatrix.data[0]));
شرمنده این یادم رفت بود
bool CheckCoherentRotation(cv::Mat_<double>& R) {
if(fabsf(determinant(R))-1.0 > 1e-07) {
cerr<<"det(R) != +-1.0, this is not a rotation matrix"<<endl;
return false;
}
return true;
تو خط اول چه اتفاقی میفته (cv::Mat_<double>& R)