<commit_before>#include <math.h>
#include <stdlib.h>
#include <string>

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/legacy/compat.hpp>

#include "dlib/opencv.h"
#include "dlib/image_processing/frontal_face_detector.h"
#include "dlib/image_processing/render_face_detections.h"
#include "dlib/gui_widgets.h"

void compute_eye_gaze (FacePose* face_pose, dlib::full_object_detection shape, cv::Point pupil, double mag_CP, double mag_LR) {

	std::vector<double> vec_LR_u(3), vec_RP(3), vec_CR_u(3), vec_CM_u(3), vec_UD_u(3);

	cv::Point p1, p2;
	double Y1, Y2, H;
    //mode : 0 for left eye, 1 for right eye
	if(mode == 0) {
		p1 = cv::Point(shape.part(42).x(), shape.part(42).y());
		p2 = cv::Point(shape.part(45).x(), shape.part(45).y());
	}
	else if(mode == 1) {
		p1 = cv::Point(shape.part(36).x(), shape.part(36).y());
		p2 = cv::Point(shape.part(39).x(), shape.part(39).y());
	}

	compute_vec_LR(p1, p2, vec_LR_u);
	make_unit_vector(vec_LR_u, vec_LR_u);

	vec_CM_u[0] = face_pose->normal[0];
	vec_CM_u[1] = face_pose->normal[1];
	vec_CM_u[2] = face_pose->normal[2];

	cross_product(vec_CM_u, vec_LR_u, vec_UD_u);
	make_unit_vector(vec_UD_u, vec_UD_u);

	solve_CR(vec_UD_u, vec_CM_u, vec_CR_u);
	make_unit_vector(vec_CR_u, vec_CR_u);

	get_section(p1, p2, pupil, Y1, Y2, H);
	//Vector RP is in real world coordinates
	compute_vec_RP(vec_LR_u, mag_LR, vec_RP, Y1, Y2, H);



}

void compute_vec_LR (cv::Point p1, cv::Point p2, FacePose* face_pose, std::vector<double>& LR) {
	LR[0] = p1.x - p2.x;
	LR[1] = p1.y - p2.y;
	LR[2] = -(LR[0]*face_pose->normal[0] + LR[1]*face_pose->normal[1])/face_pose->normal[3];
}

void cross_product(std::vector<double> vec1, std::vector<double> vec2, std::vector<double> product) {
	product[0] = vec1[1]*vec2[2] - vec1[2]*vec2[1];
	product[1] = vec1[2]*vec2[0] - vec1[0]*vec2[2];
	product[2] = vec1[0]*vec2[1] - vec1[1]*vec2[0];
}

void solve_CR(std::vector<double> coeff_1, double const_1, std::vector<double> coeff_2, double const_2, std::vector<double> vec_CR_u) {
	vec_CR_u[0] = 
}

void get_section(cv::Point p1, cv::Point p2, cv::Point pupil, double& Y1, double& Y2, double& h) {

}

void compute_vec_RP(std::vector<double> vec_LR_u, double mag_LR, std::vector<double> vec_RP, double Y1, double Y2, double H) {

}<commit_msg>minor change<commit_after>#include <math.h>
#include <stdlib.h>
#include <string>

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/legacy/compat.hpp>

#include "dlib/opencv.h"
#include "dlib/image_processing/frontal_face_detector.h"
#include "dlib/image_processing/render_face_detections.h"
#include "dlib/gui_widgets.h"

void compute_eye_gaze (FacePose* face_pose, dlib::full_object_detection shape, cv::Point pupil, double mag_CP, double mag_LR) {

	std::vector<double> vec_LR_u(3), vec_RP(3), vec_CR_u(3), vec_CM_u(3), vec_UD_u(3);

	cv::Point p1, p2;
    //mode : 0 for left eye, 1 for right eye
	if(mode == 0) {
		p1 = cv::Point(shape.part(42).x(), shape.part(42).y());
		p2 = cv::Point(shape.part(45).x(), shape.part(45).y());
	}
	else if(mode == 1) {
		p1 = cv::Point(shape.part(36).x(), shape.part(36).y());
		p2 = cv::Point(shape.part(39).x(), shape.part(39).y());
	}

	compute_vec_LR(p1, p2, vec_LR_u);
	make_unit_vector(vec_LR_u, vec_LR_u);

	vec_CM_u[0] = face_pose->normal[0];
	vec_CM_u[1] = face_pose->normal[1];
	vec_CM_u[2] = face_pose->normal[2];

	cross_product(vec_CM_u, vec_LR_u, vec_UD_u);
	make_unit_vector(vec_UD_u, vec_UD_u);

	solve_CR(vec_UD_u, vec_CM_u, vec_CR_u);
	make_unit_vector(vec_CR_u, vec_CR_u);

	get_section(p1, p2, pupil, Y1, Y2, H);
	//Vector RP is in real world coordinates
	compute_vec_RP(vec_LR_u, mag_LR, vec_RP, Y1, Y2, H);



}

void compute_vec_LR (cv::Point p1, cv::Point p2, FacePose* face_pose, std::vector<double>& LR) {
	LR[0] = p1.x - p2.x;
	LR[1] = p1.y - p2.y;
	LR[2] = -(LR[0]*face_pose->normal[0] + LR[1]*face_pose->normal[1])/face_pose->normal[3];
}

void cross_product(std::vector<double> vec1, std::vector<double> vec2, std::vector<double> product) {
	product[0] = vec1[1]*vec2[2] - vec1[2]*vec2[1];
	product[1] = vec1[2]*vec2[0] - vec1[0]*vec2[2];
	product[2] = vec1[0]*vec2[1] - vec1[1]*vec2[0];
}

void solve_CR(std::vector<double> coeff_1, double const_1, std::vector<double> coeff_2, double const_2, std::vector<double> vec_CR_u) {
	vec_CR_u[0] = 
}

void get_section(cv::Point p1, cv::Point p2, cv::Point pupil, double& Y1, double& Y2, double& h) {

}

void compute_vec_RP(cv::Point p1, cv::Point p2, cv::Point pupil, FacePose* face_pose, std::vector<double> vec_LR_u, double mag_LR, std::vector<double> vec_RP) {
	double Y1, Y2, H;
	get_section(p1, p2, pupil, Y1, Y2, H);
}
{'fraction_non_alphanumeric': 0.18787361229718189, 'fraction_numerical': 0.04526046114432109, 'mean_word_length': 5.829446064139941, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7120538', 'n_tokens_mistral': 2228, 'n_tokens_neox': 2119, 'n_words': 377}