I have a c++ facerecognition code and a python code in opencv. In python code i read frames from a robot and i want to send this fram to my c++ code. I use this link tho call p
For Python 3.x C-API:
In Python side return the frame in bytearray format:
frame
bytearray
return bytearray(frame)
and in cpp side get it by PyByteArray_AsString function:
PyByteArray_AsString
pData = PyObject_CallObject(pFunc, pArgs); uchar *data = (uchar *)PyByteArray_AsString(pData ); cv::Mat img(rows, cols, CV_8UC3, data)