From the OpenCV documentation, InputArray
is
a class that can be constructed from Mat, Mat_, Matx, std::vector, std::vector > or std::vector. It can also be constructed from a matrix expression.
You are trying to pass an IplImage
where an InputArray
is required and this is not allowed.
You could use
cvShowImage("Video", frame);
Or convert your IplImage
to a Mat
and pass that to imshow()
:
IplImage* frame;
// write to frame
...
// convert to cv::Mat and show the converted image
cv::Mat mat_frame(frame);
cv::imshow("Video", mat_frame)
Even better would be to not use IplImage at all, it is part of the legacy API. Mat is preferred.
cv::VideoCapture capture;
capture.open(0);
cv::Mat frame;
cv::namedWindow("Video");
if (capture.isOpened()) {
while (true) {
capture >> frame;
if (!frame.empty()) {
cv::imshow("Video", frame);
int c = cv::waitKey(10);
if ((char) c == 27) {
break;
}
}
}
}
In theory you could write wrappers for everything to allow calling from Lisp CFFI, but it is probably not worth the time and pain. I would code the OpenCV part of your application in C++ and then use C/CFFI to call that from Lisp.