Pose of a widget
Примеры с cv2.imshow требуют сборки OpenCV с GUI. В ноутбуке с headless-версией используйте вывод изображений через Matplotlib.
Pose of a widget
Prev Tutorial: Launching Viz
Next Tutorial: Transformations
In this tutorial you will learn how to
- Add widgets to the visualization window
- Use Affine3 to set pose of a widget
- Rotating and translating a widget along an axis
Code
You can download the code from here.
#include <opencv2/viz.hpp>
#include <opencv2/calib3d.hpp>
#include <>
;
;
()
{
<< <<
<<
<< <<
<< <<
<< <<
<< ;
}
()
{
();
:: ();
.(, ::());
:: ((-.0f,-.0f,-.0f), (.0f,.0f,.0f));
.(::, );
.(, );
:: ((,,), (,,-), , ::::());
.(::, );
.(, );
= ::(,,);
= , = ;
.<>(, ) += () * .01f;
.<>(, ) += () * .01f;
.<>(, ) += () * .01f;
+= () * .01f;
= ();
;
(, );
<< << << ;
(, (, , ));
(.);
<< << . << ;
<< << . << ;
(!.())
{
.<>(,) += () * .01f;
.<>(,) += () * .01f;
.<>(,) += () * .01f;
+= () * .01f;
= ();
;
(, );
(, (, , ));
.(, );
.(, );
}
;
}