title: Opencv cvvideocamera output capture session
body: <p>I am doing some real-time video processing with openCV.  So much in fact that the screen is a bit choppy while doing the processing.  What I'd like to do is still process the images through the CvVideoCameraDelegate method as usual, but show the user just the capture session video output, which <em>should</em> be less choppy.  </p>
  
  <p>I do all the video processing in the delegate callback method</p>
  
  <pre><code>- (void)processImage:(Mat&amp;)image;
  </code></pre>
  
  <p>So when I load the view, I try to set it up so that the capture session is what is being outputted.  It looks like you can access the capture session of the CVVideoCamera like this:</p>
  
  <pre><code>AVCaptureSession *session = videoCamera.captureSession;
  </code></pre>
  
  <p>So then, I have a view in my layout file that I'd like to connect it to called baseView.  I try to do so like this:</p>
  
  <pre><code>AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:session];
  CGRect screenRect = baseView.bounds;
  previewLayer.frame = screenRect; // Assume you want the preview layer to fill the view.
  [baseView.layer addSublayer:previewLayer];
  </code></pre>
  
  <p>However this does not work.  Just a plain white screen.  I can tell though that video processing is still being done in the background, but no video is being outputted anyway.</p>
  
  <p>Edit: notice that I didn't just set up an additional capture session to do this because I am trying to limit CPU tasks </p>