I am trying to run a simple face detection on an ARMs target. I managed to cross compile all libraries and my source code but when executing on the target i get this error:
terminated call after throwing an isntance of ‘cv::Exception’ what(): OpenCV(4.8.0-dev) /home/…/highgui/src/window.cpp:1272 error: (-2: Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function ‘cvShowImage’
I read on a defferent entry that reinstalling python-opencv with pip solved the problem. Since i am on a ARMs target, thats not an option. I am also not sure if the opencv_python is inckuded in the normal opencv source (GitHub - opencv/opencv: Open Source Computer Vision Library) ?
Thank you for help
----> Code
#include<opencv2/imgcodecs.hpp>
#include<opencv2/highgui.hpp>
#include<opencv2/imgproc.hpp>
#include<opencv2/objdetect.hpp>
#include
using namespace std;
using namespace cv;
/void main() {
string path = “chando.jpg”;
Mat img = imread(path);
imshow(“Frame”, img);
waitKey(0);
}/
int main(int argc, char **argv) {
VideoCapture video(3);
CascadeClassifier facedetect;
Mat img;
facedetect.load(“haarcascade_frontalface_default.xml”);
while (true) {
video.read(img);
vector faces;
facedetect.detectMultiScale(img, faces, 1.3, 5);
cout << faces.size() << endl;
for (int i = 0; i < faces.size(); i++) {
rectangle(img, faces[i].tl(), faces[i].br(), Scalar(50, 50, 255), 3);
rectangle(img, Point(0,0), Point(250,70), Scalar(50, 50, 255), FILLED);
putText(img, to_string(faces.size())+" Face Found", Point(10, 40), FONT_HERSHEY_DUPLEX, 1, Scalar(255, 255, 255), 1);
}
imshow(“Frame”, img);
waitKey(1);
}
return 0;
}