Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
4e52df75
Commit
4e52df75
authored
Nov 22, 2010
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed compiling bug under g++ in gpi HOG sample
parent
fbb6b6f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
gpu_hog.cpp
samples/gpu/gpu_hog.cpp
+9
-9
No files found.
samples/gpu/gpu_hog.cpp
View file @
4e52df75
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#include <string>
#include <string>
#include <sstream>
#include <sstream>
#include <iomanip>
#include <iomanip>
#include <stdexcept>
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui/highgui.hpp"
...
@@ -39,7 +40,7 @@ public:
...
@@ -39,7 +40,7 @@ public:
/** Describes aplication logic */
/** Describes aplication logic */
class
App
class
App
{
{
public
:
public
:
/** Initializes application */
/** Initializes application */
App
(
const
Settings
&
s
);
App
(
const
Settings
&
s
);
...
@@ -86,7 +87,7 @@ int main(int argc, char** argv)
...
@@ -86,7 +87,7 @@ int main(int argc, char** argv)
{
{
if
(
argc
<
2
)
if
(
argc
<
2
)
{
{
cout
<<
"Usage:
\n
sample_hog
\n
"
cout
<<
"Usage:
\n
sample_hog
\n
"
<<
" -src <path_to_the_source>
\n
"
<<
" -src <path_to_the_source>
\n
"
<<
" [-src_is_video <true/false>] # says to interp. src as img or as video
\n
"
<<
" [-src_is_video <true/false>] # says to interp. src as img or as video
\n
"
<<
" [-make_gray <true/false>] # convert image to gray one or not
\n
"
<<
" [-make_gray <true/false>] # convert image to gray one or not
\n
"
...
@@ -216,7 +217,7 @@ void App::RunOpencvGui()
...
@@ -216,7 +217,7 @@ void App::RunOpencvGui()
{
{
VideoCapture
vc
;
VideoCapture
vc
;
Mat
frame
;
Mat
frame
;
if
(
settings
.
src_is_video
)
if
(
settings
.
src_is_video
)
{
{
vc
.
open
(
settings
.
src
.
c_str
());
vc
.
open
(
settings
.
src
.
c_str
());
...
@@ -353,7 +354,7 @@ void App::HandleKey(char key)
...
@@ -353,7 +354,7 @@ void App::HandleKey(char key)
inline
void
App
::
HogWorkBegin
()
{
hog_work_begin
=
getTickCount
();
}
inline
void
App
::
HogWorkBegin
()
{
hog_work_begin
=
getTickCount
();
}
inline
void
App
::
HogWorkEnd
()
inline
void
App
::
HogWorkEnd
()
{
{
int64
delta
=
getTickCount
()
-
hog_work_begin
;
int64
delta
=
getTickCount
()
-
hog_work_begin
;
double
freq
=
getTickFrequency
();
double
freq
=
getTickFrequency
();
...
@@ -367,7 +368,7 @@ inline double App::HogWorkFps() const { return hog_work_fps; }
...
@@ -367,7 +368,7 @@ inline double App::HogWorkFps() const { return hog_work_fps; }
inline
void
App
::
WorkBegin
()
{
work_begin
=
getTickCount
();
}
inline
void
App
::
WorkBegin
()
{
work_begin
=
getTickCount
();
}
inline
void
App
::
WorkEnd
()
inline
void
App
::
WorkEnd
()
{
{
int64
delta
=
getTickCount
()
-
work_begin
;
int64
delta
=
getTickCount
()
-
work_begin
;
double
freq
=
getTickFrequency
();
double
freq
=
getTickFrequency
();
...
@@ -378,10 +379,10 @@ inline void App::WorkEnd()
...
@@ -378,10 +379,10 @@ inline void App::WorkEnd()
inline
double
App
::
WorkFps
()
const
{
return
work_fps
;
}
inline
double
App
::
WorkFps
()
const
{
return
work_fps
;
}
inline
const
string
App
::
GetPerformanceSummary
()
const
inline
const
string
App
::
GetPerformanceSummary
()
const
{
{
stringstream
ss
;
stringstream
ss
;
ss
<<
(
use_gpu
?
"GPU"
:
"CPU"
)
<<
" HOG FPS: "
<<
setiosflags
(
ios
::
left
)
<<
setprecision
(
4
)
<<
ss
<<
(
use_gpu
?
"GPU"
:
"CPU"
)
<<
" HOG FPS: "
<<
setiosflags
(
ios
::
left
)
<<
setprecision
(
4
)
<<
setw
(
7
)
<<
HogWorkFps
()
<<
" Total FPS: "
<<
setprecision
(
4
)
<<
setw
(
7
)
<<
WorkFps
();
setw
(
7
)
<<
HogWorkFps
()
<<
" Total FPS: "
<<
setprecision
(
4
)
<<
setw
(
7
)
<<
WorkFps
();
return
ss
.
str
();
return
ss
.
str
();
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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