Verified Commit 3d14149a authored by Mohcine Chraibi's avatar Mohcine Chraibi
Browse files

Use python3

parent f3abdd77
......@@ -375,7 +375,7 @@ int Analysis::RunAnalysis(const string& filename, const string& path)
Log->Write("INFO:\tSuccess with Method C using measurement area id %d!\n",_areaForMethod_C[i]->_id);
if(_plotTimeseriesC[i])
{
string parameters_Timeseries="python \""+_scriptsLocation+"/_Plot_timeseries_rho_v.py\" -p \""+ _projectRootDir+VORO_LOCATION + "\" -n "+filename+
string parameters_Timeseries="python3 \""+_scriptsLocation+"/_Plot_timeseries_rho_v.py\" -p \""+ _projectRootDir+VORO_LOCATION + "\" -n "+filename+
" -f "+boost::lexical_cast<std::string>(data.GetFps());
int res=system(parameters_Timeseries.c_str());
Log->Write("INFO:\t time series result: %d ",res);
......@@ -417,7 +417,7 @@ int Analysis::RunAnalysis(const string& filename, const string& path)
Log->Write("INFO:\tSuccess with Method D using measurement area id %d!\n",_areaForMethod_D[i]->_id);
if(_plotTimeseriesD[i])
{
string parameters_Timeseries="python \""+_scriptsLocation+"/_Plot_timeseries_rho_v.py\" -p \""+ _projectRootDir+VORO_LOCATION + "\" -n "+filename+
string parameters_Timeseries="python3 \""+_scriptsLocation+"/_Plot_timeseries_rho_v.py\" -p \""+ _projectRootDir+VORO_LOCATION + "\" -n "+filename+
" -f "+boost::lexical_cast<std::string>(data.GetFps());
int res=system(parameters_Timeseries.c_str());
Log->Write("INFO:\t time series result: %d ",res);
......
......@@ -528,7 +528,7 @@ bool ArgumentParser::ParseIniFile(const string& inifile)
else
{
_vComponent = MovementDirection;
Log->Write("INFO: \tThe instantaneous velocity in the direction of "+MovementDirection+"degree will be calculated over <"+FrameSteps+" frames>" );
Log->Write("INFO: \tThe instantaneous velocity in the direction of <"+MovementDirection+"> will be calculated over <"+FrameSteps+" frames>" );
}
}
......
......@@ -107,10 +107,12 @@ void Method_B::GetTinTout(int numFrames)
if(within(make<point_2d>( (x), (y)), _areaForMethod_B->_poly)&&!(IsinMeasurezone[ID])) {
_tIn[ID]=frameNr;
IsinMeasurezone[ID] = true;
std::cout << "IN x: " << x*CMtoM << " y: " << y*CMtoM<< std::endl;
}
if((!within(make<point_2d>( (x), (y)), _areaForMethod_B->_poly))&&IsinMeasurezone[ID]) {
_tOut[ID]=frameNr;
IsinMeasurezone[ID] = false;
std::cout << "OUT x: " << x*CMtoM << " y: " << y*CMtoM << std::endl;
}
}
_DensityPerFrame[frameNr] = pedsinMeasureArea/(area(_areaForMethod_B->_poly)*CMtoM*CMtoM);
......@@ -131,7 +133,7 @@ void Method_B::GetFundamentalTinTout(double *DensityPerFrame,double LengthMeasur
}
fprintf(fFD_TinTout,"#person Index\t density_i(m^(-2))\t velocity_i(m/s)\n");
for(int i=0; i<_NumPeds; i++)
{
{std::cout << "i: "<< i << ", Tin: " << _tIn[i] << ", Tout: " << _tOut[i] << ", fps: " << _fps << ", L: "<< LengthMeasurementarea<< std::endl;
double velocity_temp=_fps*LengthMeasurementarea/(_tOut[i]-_tIn[i]);
double density_temp=0;
for(int j=_tIn[i]; j<_tOut[i]; j++)
......
#!/usr/bin/env python3
from numpy import *
import matplotlib
import matplotlib.pyplot as plt
......
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