Good afternoon,
I’m trying to execute a face detection .cpp file using OpenCV libraries on my Jetson TX1.
I’m able to execute the same file using my PC on which only Jetpack is installed.
On my TX1: I execute the “cmake .” command and the process returns no error, but when I launch the “make” command an error occurs.
http://imageshack.com/a/img921/9604/cmyFwE.png
the code of the facedetection.cpp is:
#include "opencv2/objdetect/objdetect.hpp"
#include "hwloc/cudart.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/gpu/gpu.hpp"
#include <iostream>
#include <stdio.h>
using namespace std;
using namespace cv;
using namespace cv::gpu;
int main( )
{
Mat image;
image = imread("/home/ubuntu/Desktop/Proj_OpenCV/FaceDetection/prova.jpg");
GpuMat d_image(image);
namedWindow( "window1", 2 );
imshow( "window1", image );
// Load Face cascade (.xml file)
CascadeClassifier face_cascade;
face_cascade.load( "/usr/share/OpenCV/haarcascades/haarcascade_frontalface_alt2.xml");
// Detect faces
std::vector<Rect> faces;
face_cascade.detectMultiScale( image, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(100, 100) );
// Draw circles on the detected faces
for( int i = 0; i < faces.size(); i++ )
{
Point center( faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5 );
ellipse( image, center, Size( faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 );
}
namedWindow("Detected faces", 2);
imshow( "Detected faces", image );
waitKey(0);
return 0;
}
Anyone can fix this?
Thanks!