From ce2a65db85f811aef08c718d7a7db11b5a66e55a Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Sun, 11 Feb 2018 20:08:53 +0800 Subject: [PATCH] fix issue #9486. --- modules/viz/src/widget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/viz/src/widget.cpp b/modules/viz/src/widget.cpp index b324a4e26c..6e56e04155 100644 --- a/modules/viz/src/widget.cpp +++ b/modules/viz/src/widget.cpp @@ -284,6 +284,10 @@ cv::Affine3d cv::viz::Widget3D::getPose() const { vtkProp3D *actor = vtkProp3D::SafeDownCast(WidgetAccessor::getProp(*this)); CV_Assert("Widget is not 3D." && actor); + if (!actor->GetUserMatrix()) + { + return Affine3d(); // empty user matrix, return an identity transform. + } return Affine3d(*actor->GetUserMatrix()->Element); }