Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mohcine Chraibi
JPSreport
Commits
3d14149a
Verified
Commit
3d14149a
authored
Sep 29, 2017
by
Mohcine Chraibi
Browse files
Use python3
parent
f3abdd77
Changes
4
Hide whitespace changes
Inline
Side-by-side
Analysis.cpp
View file @
3d14149a
...
...
@@ -375,7 +375,7 @@ int Analysis::RunAnalysis(const string& filename, const string& path)
Log
->
Write
(
"INFO:
\t
Success 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
=
"python
3
\"
"
+
_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:
\t
Success 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
=
"python
3
\"
"
+
_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
);
...
...
general/ArgumentParser.cpp
View file @
3d14149a
...
...
@@ -528,7 +528,7 @@ bool ArgumentParser::ParseIniFile(const string& inifile)
else
{
_vComponent
=
MovementDirection
;
Log
->
Write
(
"INFO:
\t
The instantaneous velocity in the direction of "
+
MovementDirection
+
"
degree
will be calculated over <"
+
FrameSteps
+
" frames>"
);
Log
->
Write
(
"INFO:
\t
The instantaneous velocity in the direction of
<
"
+
MovementDirection
+
"
>
will be calculated over <"
+
FrameSteps
+
" frames>"
);
}
}
...
...
methods/Method_B.cpp
View file @
3d14149a
...
...
@@ -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
++
)
...
...
scripts/_Plot_timeseries_rho_v.py
View file @
3d14149a
#!/usr/bin/env python3
from
numpy
import
*
import
matplotlib
import
matplotlib.pyplot
as
plt
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment