-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHelpers.cpp
More file actions
46 lines (42 loc) · 1.48 KB
/
Helpers.cpp
File metadata and controls
46 lines (42 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//Librerias
/*#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/image_processing.h>
#include <boost/numeric/ublas/matrix.hpp> //matriz
#include <boost/numeric/ublas/io.hpp> //matriz
#include <iostream> //matriz
class Helpers{
//Falta el tipo de shape
private:
shapePredictor sp;
public:
//For dlib’s 68-point facial landmark detector:
//Cambiar a mapa
int[][] shapeToNP(full_object_detection shape){
//Crea matriz de 68 x 2 de tipo int llena de ceros y la llama coords
boost::numeric::ublas::zero_matrix<int> coords(68, 2);
std::cout << m << '\n';
//Convierte las 68 marcas en una tupla de 2 de coordenadas
for (int i = 0; i<68;i++){
//Regresa las coordenadas de cada rasgo de la cara
for (j = 0; i<=1;i++){
if(j == 0){
coords[i][j] = cv::Point landmark(shape.part(idx[i]).x());
}
else {
coords[i][j] = cv::Point landmark(shape.part(idx[i]).y());
}
}
}
return coords;
}
public:
int[] rectToBB(Rect rect){ //puede ser tipo std::vector<rectangle>
//Convert to format (x,y,w,h)
int x = rect.left(); //depende de la librería que encontremos
int y = rect.top();
int w = rect.right() - x;
int h = rect.bottom() - y;
int vector[] = {x,y,w,h};
return vector;
}
}*/