Transformations
Примеры с cv2.imshow требуют сборки OpenCV с GUI. В ноутбуке с headless-версией используйте вывод изображений через Matplotlib.
Transformations
Prev Tutorial: Pose of a widget
Next Tutorial: Creating Widgets
In this tutorial you will learn how to
- How to use makeTransformToGlobal to compute pose
- How to use makeCameraPose and Viz3d::setViewerPose
- How to visualize camera position by axes and by viewing frustum
Code
You can download the code from here.
#include <opencv2/viz.hpp>
#include <iostream>
#include <fstream>
;
;
()
{
<< <<
<<
<<
<< <<
<< <<
<< <<
<< ;
}
()
{
(, , );
();
;
( = ; < ; ++)
(, );
* = .<::>();
, ;
( = ; < ; ++)
>> []. >> []. >> []. >> >> ;
*= .0f;
;
}
( , **)
{
();
( < )
{
<< << ;
;
}
= ([][] == );
:: ();
.(, ::());
(.0f,.0f,.0f), (.0f,.0f,.0f), (-.0f,.0f,.0f);
= ::(, , );
= ::((.0f,-.0f,.0f), (-.0f,.0f,.0f), (.0f,.0f,-.0f), );
= ();
:: (, ::::());
= ().((.0f,.0f,.0f));
= * ;
(!)
{
:: ();
:: ((, ));
.(, , );
.(, , );
}
.(, , );
()
.();
.();
;
}