How to copy cv::Mat *img to cv::Mat img
Hi I have started exploring something in Darkent YOLO object detection. Where Video capture is done as below
mat_cv* get_capture_frame_cv(cap_cv *cap) {
cv::Mat *mat = new cv::Mat();
try {
if (cap) {
cv::VideoCapture &cpp_cap = *(cv::VideoCapture *)cap;
if (cpp_cap.isOpened())
{
cpp_cap >> *mat;
}
else std::cout << " Video-stream stopped! \n";
}
else cerr << " cv::VideoCapture isn't created \n";
}
catch (...) {
std::cout << " OpenCV exception: Video-stream stoped! \n";
}
return (mat_cv *)mat;
}
Where cpp_cap >> *mat; catures the frame where I want to take Perspective and returns output at return (mat_cv *)mat;
Here I stuck how to pass cv::Mat *mat to warpPerspective function where its input is Mat type. Please help me.
Regards, Prabhakar M