How to show webcam capture in Plone site using OpenCV?
Question: I am using Plone 4.3. I am trying to create a face recognition system on the
Plone site. I need to show webcam captures using a template page. My sample
code is below. However, when I run this code, I can't get the captured image
in the template file.

sample.py:

    
    
    class video(BrowserView):
     video=ViewPageTemplateFile('video.pt')
     def chow(self):
       return self.video()
     def show_video(self):
      import cv2.cv as cv
      cv.NamedWindow("camera", 1)
      capture = cv.CaptureFromCAM(0)
      while True:
         img = cv.QueryFrame(capture)
      return img
    

video.pt:

    
    
    <div id="res">
     <!--Here face is url name-->
     <img id="draw" tal:attributes="src python:context.absolute_url() + '/face'">
     <!--the above line refers to call a method of show_video()-->
    </div>
    


Answer: This is a good starting point:
<http://plone.org/products/collective.takeaportrait> (activate the optional
OpenCV integration).

Keep in mind that there's a **big** difference between showing the camera
output on the screen (that is simply HTML 5) and performing face recognition
server side.

