<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi list,<br>
<br>
I'm in the process of writing a plugin to wrap OpenCV's stereo rectification functionality. Right now, it works by loading camera intrinsic/extrinsic files specified as plugin properties, and setting up the undistortion maps from stereoRectify() and initUndistortRectifyMap()
on the GST_EVENT_CAPS event. The transform function then calls remap() with the appropriate matrices to perform the rectification on the incoming buffer and sending it on down the pipeline.
<br>
<br>
To handle the two camera channels, I have another plugin parameter called cameraIndex that determines which set of maps are used for the remap() call. So, roughly, the pipeline looks like this:<br>
<br>
gst-launch-1.0 -vvv videomixer name=mix sink_0::xpos=0 sink_1::xpos=320 ! queue ! videoconvert ! x264enc speed-preset=superfast ! mp4mux ! filesink location=stereo-cams-rectified.mp4 v4l2src num-buffers=100 device=/dev/video0 ! video/x-raw,format=YUY2,width=320,height=240,framerate=30/1
! videoconvert ! cvstereorectify intrinsics-file=intrinsics.yml extrinsics-file=extrinsics.yml camera-index=2 ! mix.sink_0 v4l2src num-buffers=100 device=/dev/video1 ! video/x-raw,format=YUY2,width=320,height=240,framerate=30/1 ! videoconvert ! cvstereorectify
intrinsics-file=intrinsics.yml extrinsics-file=extrinsics.yml camera-index=1 ! mix.sink_1<br>
<br>
Ideally, though, I feel like the cvstereorectify plugin should have a left and right sink pad, as well as left and right source pads, so that there would only be one in the pipeline. GstOpenCVVideoFilter/GstBaseTransform seem fairly solidly geared to only
support one source and sink, though. Any advice on the least-hack-y route to take to integrate the extra pads?<br>
<br>
Thanks!<br>
Ryan<br>
</div>
</body>
</html>