diff --git a/modules/viz/src/vtk/vtkImageMatSource.cpp b/modules/viz/src/vtk/vtkImageMatSource.cpp index 58a5642d4..658617523 100644 --- a/modules/viz/src/vtk/vtkImageMatSource.cpp +++ b/modules/viz/src/vtk/vtkImageMatSource.cpp @@ -52,7 +52,7 @@ namespace cv { namespace viz cv::viz::vtkImageMatSource::vtkImageMatSource() { this->SetNumberOfInputPorts(0); - this->ImageData = vtkImageData::New(); + this->ImageData = vtkSmartPointer::New(); } int cv::viz::vtkImageMatSource::RequestInformation(vtkInformation *, vtkInformationVector**, vtkInformationVector *outputVector)