[vtkusers] vtkImageData Reflection
Cameron Lowell Palmer
cameron.palmer at ntnu.no
Mon Jan 26 07:29:21 EST 2015
When receiving a camera frame I’m converting to vtkImageData like this:
auto imageImport = vtkSmartPointer<vtkImageImport>::New();
imageImport->SetDataSpacing(1.0f, 1.0f, 1.0f);
imageImport->SetDataOrigin(0.f, 0.f, 0.f);
imageImport->SetWholeExtent(0.f, videoFrame.width - 1.f, 0.f, videoFrame.height - 1.f, 0.f, 0.f);
imageImport->SetDataExtentToWholeExtent();
imageImport->SetDataScalarTypeToUnsignedChar();
imageImport->SetNumberOfScalarComponents(4);
imageImport->SetImportVoidPointer(videoFrame.rawPixelData);
imageImport->Update();
vtkSmartPointer<vtkImageData> imageData = imageImport->GetOutput();
It works, but adding this to an image plane the image is mirrored across the Y-axis (right-left). Am I doing this image conversion correctly?
cameron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150126/64f8c716/attachment.html>
More information about the vtkusers
mailing list