Skip to content

Commit ce2a65d

Browse files
committed
fix issue opencv#9486.
1 parent e2a99d2 commit ce2a65d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/viz/src/widget.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ cv::Affine3d cv::viz::Widget3D::getPose() const
284284
{
285285
vtkProp3D *actor = vtkProp3D::SafeDownCast(WidgetAccessor::getProp(*this));
286286
CV_Assert("Widget is not 3D." && actor);
287+
if (!actor->GetUserMatrix())
288+
{
289+
return Affine3d(); // empty user matrix, return an identity transform.
290+
}
287291
return Affine3d(*actor->GetUserMatrix()->Element);
288292
}
289293

0 commit comments

Comments
 (0)