[vtkusers] Oculus Rift: vtkLensWarp - failure for request: vtkInformation
Citizen Snips
amb2189 at rit.edu
Sun Jul 27 18:21:34 EDT 2014
Here is the code segment in question (Not full file, but the rest is just
setting up renderers, actors, etc.
Citizen Snips wrote
> # Set up webcam feed for background video
> cb.webcam = cv2.VideoCapture(0)
> ret, tmp = cb.webcam.read()
> cv2.cvtColor(tmp, cv2.COLOR_BGR2RGB)
>
> width = cb.webcam.get(3)
> height = cb.webcam.get(4)
>
> # image converter for openCV frame to vtkImageData
> cb.imgPort = vtkImageImport()
> cb.imgPort.SetDataSpacing(1,1,1)
> cb.imgPort.SetDataOrigin(0,0,0)
> cb.imgPort.SetWholeExtent(0, width-1,0,height-1,0,0)
> cb.imgPort.SetDataExtentToWholeExtent()
> cb.imgPort.SetDataScalarTypeToUnsignedChar()
> cb.imgPort.SetNumberOfScalarComponents(3)
> cb.imgPort.SetImportVoidPointer(tmp)
> cb.imgPort.Update()
>
>
> #Warp image
> cb.wl = vtk.vtkWarpLens()
> cb.wl.SetInputConnection(cb.imgPort.GetOutputPort())
> cb.wl.SetPrincipalPoint(2.4507, 1.7733)
> cb.wl.SetFormatWidth(4.792)
> cb.wl.SetFormatHeight(3.6)
> cb.wl.SetImageWidth(width)
> cb.wl.SetImageHeight(height)
> cb.wl.SetK1(0.01307)
> cb.wl.SetK2(0.0003102)
> cb.wl.SetP1(1.953e-005)
> cb.wl.SetP2(-9.655e-005)
--
View this message in context: http://vtk.1045678.n5.nabble.com/Oculus-Rift-vtkLensWarp-failure-for-request-vtkInformation-tp5727984p5727985.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list