0

I'm trying to get frames from a IP camera using cv2.VideoCapture function of Python OpenCV. I'm using PythonNet to retrieve this frames to a C# Console Application. But I can't retrieve the boolean and the image that return cv2.VideoCapture in C# variables. Anyone knows how do it?

dynamic cap = cv2.VideoCapture("camerastream");
dynamic frame1 = cap.read;

So, I already know that frame1 have the output of cv2.VideoCapture, that is a boolean and a numpy array. And that frame1 is a Python object type. But I don't know how to retrieve the boolean and the array from frame1.

  • if you are using C#, why not just use EMGU CV which is C# wrapper http://www.emgu.com/wiki/index.php/Tutorial After using this, the data will be in C# variables like Image or bitmap – Dr Yuan Shenghai Jun 03 '19 at 17:13
  • Thank you but I already know Emgu. I want to use Python and their scientific libraries. I must to use C# by compatibility with old software of the company ... :-( – Omnivision Jun 04 '19 at 07:11

1 Answers1

0

Solved! This is working.

bool retrieved;
dynamic image = np.ndarray;
dynamic cap = cv2.VideoCapture("camerastream");
dynamic frame1 = cap.read();
retrieved = frame1[0];
image = frame1[1];

I had forgotten the () in the function ... :-D