Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Numpy Arrays

I am using python bindings to convert a project ,initially made in C++ , in python. The following is the snapshot of some part of the code :

cv::Mat debugImage;
CvCapture* capture;
cv::Mat frame;
capture = cvCaptureFromCAM( -1 );
  if( capture )
  {
      while( true ) 
      {
        frame = cvQueryFrame( capture );
        // mirror it
        cv::flip(frame, frame, 1);
        frame.copyTo(debugImage);
       }
   }

Here frame is defined as matrix which is then copied to the debugImage matrix inside the loop. But if I use numpy arrays declaration for frame and debugimage and then copy it using the copyto method of numpy, it throws error. Please help me to covert this code into python.