Commit e8c8ad89 authored by Thiago Santini's avatar Thiago Santini

Standard encoding is utf8, fixes some files

parent 01ad783f
......@@ -5,12 +5,12 @@
/*
Version 1.0, 17.12.2015, Copyright University of Tbingen.
Version 1.0, 17.12.2015, Copyright University of Tübingen.
The Code is created based on the method from the paper:
"ElSe: Ellipse Selection for Robust Pupil Detection in Real-World Environments", W. Fuhl, T. C. Santini, T. C. Kbler, E. Kasneci
"ElSe: Ellipse Selection for Robust Pupil Detection in Real-World Environments", W. Fuhl, T. C. Santini, T. C. Kübler, E. Kasneci
ETRA 2016 : Eye Tracking Research and Application 2016
The code and the algorithm are for non-comercial use only.
*/
......@@ -130,7 +130,7 @@ static void gen_blob_neu(int rad, cv::Mat *all_mat, cv::Mat *all_mat_neg){
for(int i=0;i<len;i++){
p=all_mat->ptr<float>(i);
p_neg=all_mat_neg->ptr<float>(i);
......@@ -163,7 +163,7 @@ static bool is_good_ellipse_evaluation(cv::RotatedRect *ellipse, cv::Mat *pic){
if(ellipse->center.x==0 && ellipse->center.y==0)
return false;
float x0 =ellipse->center.x;
float y0 =ellipse->center.y;
......@@ -261,11 +261,11 @@ static cv::RotatedRect blob_finder(cv::Mat *pic){
gen_blob_neu(fakk,&blob_mat,&blob_mat_neg);
img.convertTo(img, CV_32FC1);
filter2D(img, result, -1 , blob_mat, cv::Point( -1, -1 ), 0, cv::BORDER_REPLICATE );
float * p_res, *p_neg_res;
for(int i=0; i<result.rows;i++){
p_res=result.ptr<float>(i);
......@@ -277,7 +277,7 @@ static cv::RotatedRect blob_finder(cv::Mat *pic){
}
filter2D(img, result_neg, -1 , blob_mat_neg, cv::Point( -1, -1 ), 0, cv::BORDER_REPLICATE );
for(int i=0; i<result.rows;i++){
p_res=result.ptr<float>(i);
......@@ -314,7 +314,7 @@ static cv::RotatedRect blob_finder(cv::Mat *pic){
if(pos.y>0 && pos.y<pic->rows && pos.x>0 && pos.x<pic->cols){
//calc th
int opti_x=0;
int opti_y=0;
......@@ -400,9 +400,9 @@ if(pos.y>0 && pos.y<pic->rows && pos.x>0 && pos.x<pic->cols){
return ellipse;
}
}
\ No newline at end of file
}
......@@ -3,12 +3,12 @@
#include <opencv2/core/core.hpp>
/*
Version 1.0, 17.12.2015, Copyright University of Tbingen.
Version 1.0, 17.12.2015, Copyright University of Tübingen.
The Code is created based on the method from the paper:
"ElSe: Ellipse Selection for Robust Pupil Detection in Real-World Environments", W. Fuhl, T. C. Santini, T. C. Kbler, E. Kasneci
"ElSe: Ellipse Selection for Robust Pupil Detection in Real-World Environments", W. Fuhl, T. C. Santini, T. C. Kübler, E. Kasneci
ETRA 2016 : Eye Tracking Research and Application 2016
The code and the algorithm are for non-comercial use only.
*/
......@@ -106,7 +106,7 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
box[12]=(int)edge->data[(edge->cols*(j-1))+(i+2)];
box[13]=(int)edge->data[(edge->cols*(j+1))+(i+2)];
box[14]=(int)edge->data[(edge->cols*(j+3))+(i)];
box[15]=(int)edge->data[(edge->cols*(j+2))+(i-1)];
box[16]=(int)edge->data[(edge->cols*(j+2))+(i+1)];
......@@ -119,7 +119,7 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
edge->data[(edge->cols*(j+1))+(i)]=255;
}
if( (box[14] && !box[7] && !box[10]) && ( (box[8] || box[6]) && (box[16] || box[15]) ) ){
edge->data[(edge->cols*(j+1))+(i+1)]=0;
edge->data[(edge->cols*(j+1))+(i-1)]=0;
......@@ -128,7 +128,7 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
edge->data[(edge->cols*(j+1))+(i)]=255;
edge->data[(edge->cols*(j+2))+(i)]=255;
}
if( (box[9] && !box[5]) && (box[8] || box[2]) ){
......@@ -137,7 +137,7 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
edge->data[(edge->cols*(j))+(i+1)]=255;
}
if( (box[11] && !box[5] && !box[9]) && ( (box[8] || box[2]) && (box[13] || box[12]) ) ){
edge->data[(edge->cols*(j+1))+(i+1)]=0;
edge->data[(edge->cols*(j-1))+(i+1)]=0;
......@@ -146,7 +146,7 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
edge->data[(edge->cols*(j))+(i+1)]=255;
edge->data[(edge->cols*(j))+(i+2)]=255;
}
......@@ -155,8 +155,8 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
}
}
for(int j=start_y; j<end_y; j++)
for(int i=start_x; i<end_x; i++){
......@@ -210,7 +210,7 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
if( box[7] && box[2] && box[9] )
edge->data[(edge->cols*(j))+(i)]=0;
if( box[7] && box[0] && box[10] )
......@@ -219,8 +219,8 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
edge->data[(edge->cols*(j))+(i)]=0;
if( box[1] && box[6] && box[12] )
edge->data[(edge->cols*(j))+(i)]=0;
if( box[0] && box[13] && box[17] && box[8] && box[11] && box[21] )
edge->data[(edge->cols*(j))+(i)]=0;
if( box[2] && box[14] && box[18] && box[6] && box[12] && box[22] )
......@@ -245,7 +245,7 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
int box2[18];
box2[1]=(int)edge->data[(edge->cols*(j))+(i-1)];
......@@ -268,7 +268,7 @@ static void filter_edges(cv::Mat *edge, int start_xx, int end_xx, int start_yy,
box2[15]=(int)edge->data[(edge->cols*(j-1))+(i-1)];
box2[16]=(int)edge->data[(edge->cols*(j-2))+(i-2)];
box2[11]=(int)edge->data[(edge->cols*(j+2))+(i+1)];
box2[12]=(int)edge->data[(edge->cols*(j+3))+(i+2)];
......
......@@ -2,12 +2,12 @@
/*
Version 1.0, 17.12.2015, Copyright University of Tbingen.
Version 1.0, 17.12.2015, Copyright University of Tübingen.
The Code is created based on the method from the paper:
"ElSe: Ellipse Selection for Robust Pupil Detection in Real-World Environments", W. Fuhl, T. C. Santini, T. C. Kbler, E. Kasneci
"ElSe: Ellipse Selection for Robust Pupil Detection in Real-World Environments", W. Fuhl, T. C. Santini, T. C. Kübler, E. Kasneci
ETRA 2016 : Eye Tracking Research and Application 2016
The code and the algorithm are for non-comercial use only.
*/
......@@ -29,7 +29,7 @@ static bool is_good_ellipse_eval(cv::RotatedRect *ellipse, cv::Mat *pic, int *er
if(ellipse->center.x==0 && ellipse->center.y==0)
return false;
float x0 =ellipse->center.x;
float y0 =ellipse->center.y;
......@@ -170,14 +170,14 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
if(end_x>pic->cols-2) end_x=pic->cols-2;
if(end_y>pic->rows-2) end_y=pic->rows-2;
int all_curves_idx=0;
int curve_idx=0;
cv::Point mean_p;
bool add_curve;
int mean_inner_gray;
int mean_inner_gray_last=1000000;
all_curves.clear();
all_means.clear();
......@@ -194,18 +194,18 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
//get all lines
//get all lines
for(int i=start_x; i<end_x; i++)
for(int j=start_y; j<end_y; j++){
if(edge->data[(edge->cols*(j))+(i)]>0 && !check[i][j]){
check[i][j]=1;
curve.clear();
curve_idx=0;
......@@ -214,7 +214,7 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
mean_p.y=j;
curve_idx++;
int akt_idx=0;
while(akt_idx<curve_idx){
......@@ -227,13 +227,13 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
if(!check[akt_pos.x+k1][akt_pos.y+k2] )
if( edge->data[(edge->cols*(akt_pos.y+k2))+(akt_pos.x+k1)]>0){
check[akt_pos.x+k1][akt_pos.y+k2]=1;
mean_p.x+=akt_pos.x+k1;
mean_p.y+=akt_pos.y+k2;
curve.push_back(cv::Point(akt_pos.x+k1,akt_pos.y+k2));
curve_idx++;
}
}
akt_idx++;
......@@ -251,7 +251,7 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
all_means.push_back(mean_p);
all_lines.push_back(curve);
}
......@@ -275,7 +275,7 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
cv::RotatedRect ellipse;
for(int i=0;i<curve.size();i++)
for(int i=0;i<curve.size();i++)
if( abs(mean_p.x-curve[i].x)<= mean_dist && abs(mean_p.y-curve[i].y) <= mean_dist)
add_curve=false;
......@@ -288,20 +288,20 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
ellipse=cv::fitEllipse( cv::Mat(curve) );
if(ellipse.center.x<0 || ellipse.center.y<0 ||
if(ellipse.center.x<0 || ellipse.center.y<0 ||
ellipse.center.x>pic->cols || ellipse.center.y>pic->rows){
add_curve=false;
}
if(ellipse.size.height > 3*ellipse.size.width ||
ellipse.size.width > 3*ellipse.size.height){
add_curve=false;
}
if(add_curve){ // pupil area
......@@ -310,12 +310,12 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
add_curve=false;
}
if(add_curve){
if(!is_good_ellipse_eval(&ellipse,pic,&ergebniss))
add_curve=false;
}
}
......@@ -323,7 +323,7 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
if(add_curve) {
if(inner_color_range>=0){
mean_inner_gray=0;
......@@ -333,7 +333,7 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
mean_inner_gray=calc_inner_gray(pic,curve,ellipse);
mean_inner_gray=mean_inner_gray*(1+abs(ellipse.size.height-ellipse.size.width));
if(mean_inner_gray_last>mean_inner_gray){
mean_inner_gray_last=mean_inner_gray;
all_curves.clear();
......@@ -347,7 +347,7 @@ static std::vector<std::vector<cv::Point>> get_curves(cv::Mat *pic, cv::Mat *edg
selected_ellipse=ellipse;
}
}
......@@ -412,4 +412,4 @@ static cv::RotatedRect find_best_edge(cv::Mat *pic,cv::Mat *edge, cv::Mat *magni
}
}
\ No newline at end of file
}
// excuse.cpp : Definiert den Einstiegspunkt fr die Konsolenanwendung.
// excuse.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//
#include "stdafx.h"
......@@ -7,7 +7,7 @@
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <iostream>
#include <iostream>
#include <fstream>
#include <time.h>
......@@ -28,7 +28,7 @@ void imshowscale(const std::string& name, cv::Mat& m, double scale)
int _tmain(int argc, _TCHAR* argv[])
{
......@@ -97,10 +97,10 @@ int _tmain(int argc, _TCHAR* argv[])
std::string line1, line2, line_x, line_y;
std::fstream Quelldatei; // neuen Lese-Stream erzeugen
Quelldatei.open(pfad+bezer[kk]+".txt");
Quelldatei.open(pfad+bezer[kk]+".txt");
// std::fstream Zieldatei; // neuen Lese-Stream erzeugen
//Zieldatei.open(pfad+"erg_"+bezer[kk]+".txt",std::fstream::in | std::fstream::out | std::fstream::trunc);
//Zieldatei.open(pfad+"erg_"+bezer[kk]+".txt",std::fstream::in | std::fstream::out | std::fstream::trunc);
//avoid first line
......@@ -121,9 +121,9 @@ Quelldatei.open(pfad+bezer[kk]+".txt");
//std::cout<<line2<<std::endl;
//std::cout<<line_x<<std::endl;
//std::cout<<line_y<<std::endl;
str_number=sprintf (buffer, "%010d", val2);
str_number=buffer;
......@@ -145,13 +145,13 @@ std::string path_images1 = pfad+bezer[kk]+"\\"+str_number+".png";
cv::Mat th_edges = cv::Mat::zeros(m.rows, m.cols, CV_8U);
zeit1 = clock();
cv::RotatedRect pos=run(&m,&pic_th,&th_edges);
//cv::RotatedRect pos=run_solo(&m,&pic_th,&th_edges);
zeit2 = clock();
zeit2 = clock();
sum_all+=zeit2-zeit1;
......
// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet.
// excuse.pch ist der vorkompilierte Header.
// stdafx.obj enthält die vorkompilierten Typinformationen.
// stdafx.obj enthält die vorkompilierten Typinformationen.
#include "stdafx.h"
// TODO: Auf zusätzliche Header verweisen, die in STDAFX.H
// TODO: Auf zusätzliche Header verweisen, die in STDAFX.H
// und nicht in dieser Datei erforderlich sind.
// stdafx.h : Includedatei für Standardsystem-Includedateien
// oder häufig verwendete projektspezifische Includedateien,
// die nur in unregelmäßigen Abständen geändert werden.
// stdafx.h : Includedatei für Standardsystem-Includedateien
// oder häufig verwendete projektspezifische Includedateien,
// die nur in unregelmäßigen Abständen geändert werden.
//
#pragma once
......@@ -12,4 +12,4 @@
// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
#pragma once
// Durch Einbeziehen von"SDKDDKVer.h" wird die höchste verfügbare Windows-Plattform definiert.
// Durch Einbeziehen von"SDKDDKVer.h" wird die höchste verfügbare Windows-Plattform definiert.
// Wenn Sie die Anwendung für eine frühere Windows-Plattform erstellen möchten, schließen Sie "WinSDKVer.h" ein, und
// legen Sie das _WIN32_WINNT-Makro auf die zu unterstützende Plattform fest, bevor Sie "SDKDDKVer.h" einschließen.
// Wenn Sie die Anwendung für eine frühere Windows-Plattform erstellen möchten, schließen Sie "WinSDKVer.h" ein, und
// legen Sie das _WIN32_WINNT-Makro auf die zu unterstützende Plattform fest, bevor Sie "SDKDDKVer.h" einschließen.
#include <SDKDDKVer.h>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment