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
69c2ef5e
Commit
69c2ef5e
authored
Oct 03, 2013
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocl: update ocl samples
parent
7f0680fc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
10 additions
and
74 deletions
+10
-74
super_resolution.cpp
samples/gpu/super_resolution.cpp
+0
-8
adaptive_bilateral_filter.cpp
samples/ocl/adaptive_bilateral_filter.cpp
+1
-5
bgfg_segm.cpp
samples/ocl/bgfg_segm.cpp
+1
-4
clahe.cpp
samples/ocl/clahe.cpp
+0
-3
facedetect.cpp
samples/ocl/facedetect.cpp
+1
-11
hog.cpp
samples/ocl/hog.cpp
+0
-2
pyrlk_optical_flow.cpp
samples/ocl/pyrlk_optical_flow.cpp
+1
-8
squares.cpp
samples/ocl/squares.cpp
+1
-3
stereo_match.cpp
samples/ocl/stereo_match.cpp
+2
-12
surf_matcher.cpp
samples/ocl/surf_matcher.cpp
+2
-10
tvl1_optical_flow.cpp
samples/ocl/tvl1_optical_flow.cpp
+1
-8
No files found.
samples/gpu/super_resolution.cpp
View file @
69c2ef5e
...
...
@@ -132,17 +132,9 @@ int main(int argc, const char* argv[])
}
#endif
#if defined(HAVE_OPENCV_OCL)
std
::
vector
<
cv
::
ocl
::
Info
>
info
;
if
(
useCuda
)
{
CV_Assert
(
!
useOcl
);
info
.
clear
();
}
if
(
useOcl
)
{
CV_Assert
(
!
useCuda
);
cv
::
ocl
::
getDevice
(
info
);
}
#endif
Ptr
<
SuperResolution
>
superRes
;
...
...
samples/ocl/adaptive_bilateral_filter.cpp
View file @
69c2ef5e
...
...
@@ -25,9 +25,6 @@ int main( int argc, const char** argv )
return
-
1
;
}
std
::
vector
<
ocl
::
Info
>
infos
;
ocl
::
getDevice
(
infos
);
ocl
::
oclMat
dsrc
(
src
),
dABFilter
,
dBFilter
;
Size
ksize
(
ks
,
ks
);
...
...
@@ -48,4 +45,4 @@ int main( int argc, const char** argv )
waitKey
();
return
0
;
}
\ No newline at end of file
}
samples/ocl/bgfg_segm.cpp
View file @
69c2ef5e
...
...
@@ -24,7 +24,7 @@ int main(int argc, const char** argv)
if
(
cmd
.
get
<
bool
>
(
"help"
))
{
cout
<<
"Usage : bgfg_segm [options]"
<<
endl
;
cout
<<
"Avaible options:"
<<
endl
;
cout
<<
"Avai
la
ble options:"
<<
endl
;
cmd
.
printParams
();
return
0
;
}
...
...
@@ -54,9 +54,6 @@ int main(int argc, const char** argv)
return
-
1
;
}
std
::
vector
<
cv
::
ocl
::
Info
>
info
;
cv
::
ocl
::
getDevice
(
info
);
Mat
frame
;
cap
>>
frame
;
...
...
samples/ocl/clahe.cpp
View file @
69c2ef5e
...
...
@@ -45,9 +45,6 @@ int main(int argc, char** argv)
createTrackbar
(
"Tile Size"
,
"CLAHE"
,
&
tilesize
,
32
,
(
TrackbarCallback
)
TSize_Callback
);
createTrackbar
(
"Clip Limit"
,
"CLAHE"
,
&
cliplimit
,
20
,
(
TrackbarCallback
)
Clip_Callback
);
vector
<
ocl
::
Info
>
info
;
CV_Assert
(
ocl
::
getDevice
(
info
));
Mat
frame
,
outframe
;
ocl
::
oclMat
d_outframe
;
...
...
samples/ocl/facedetect.cpp
View file @
69c2ef5e
...
...
@@ -72,7 +72,7 @@ int main( int argc, const char** argv )
CommandLineParser
cmd
(
argc
,
argv
,
keys
);
if
(
cmd
.
get
<
bool
>
(
"help"
))
{
cout
<<
"Avaible options:"
<<
endl
;
cout
<<
"Avai
la
ble options:"
<<
endl
;
cmd
.
printParams
();
return
0
;
}
...
...
@@ -120,16 +120,6 @@ int main( int argc, const char** argv )
cvNamedWindow
(
"result"
,
1
);
vector
<
ocl
::
Info
>
oclinfo
;
int
devnums
=
ocl
::
getDevice
(
oclinfo
);
if
(
devnums
<
1
)
{
std
::
cout
<<
"no device found
\n
"
;
return
-
1
;
}
//if you want to use undefault device, set it here
//setDevice(oclinfo[0]);
ocl
::
setBinpath
(
"./"
);
if
(
capture
)
{
cout
<<
"In capture ..."
<<
endl
;
...
...
samples/ocl/hog.cpp
View file @
69c2ef5e
...
...
@@ -135,8 +135,6 @@ App::App(CommandLineParser& cmd)
void
App
::
run
()
{
vector
<
ocl
::
Info
>
oclinfo
;
ocl
::
getDevice
(
oclinfo
);
running
=
true
;
VideoWriter
video_writer
;
...
...
samples/ocl/pyrlk_optical_flow.cpp
View file @
69c2ef5e
...
...
@@ -86,13 +86,6 @@ static void drawArrows(Mat& frame, const vector<Point2f>& prevPts, const vector<
int
main
(
int
argc
,
const
char
*
argv
[])
{
static
std
::
vector
<
Info
>
ocl_info
;
ocl
::
getDevice
(
ocl_info
);
//if you want to use undefault device, set it here
setDevice
(
ocl_info
[
0
]);
//set this to save kernel compile time from second time you run
ocl
::
setBinpath
(
"./"
);
const
char
*
keys
=
"{ h | help | false | print help message }"
"{ l | left | | specify left image }"
...
...
@@ -109,7 +102,7 @@ int main(int argc, const char* argv[])
if
(
cmd
.
get
<
bool
>
(
"help"
))
{
cout
<<
"Usage: pyrlk_optical_flow [options]"
<<
endl
;
cout
<<
"Avaible options:"
<<
endl
;
cout
<<
"Avai
la
ble options:"
<<
endl
;
cmd
.
printParams
();
return
0
;
}
...
...
samples/ocl/squares.cpp
View file @
69c2ef5e
...
...
@@ -284,13 +284,11 @@ int main(int argc, char** argv)
string
outfile
=
cmd
.
get
<
string
>
(
"o"
);
if
(
inputName
.
empty
())
{
cout
<<
"Avaible options:"
<<
endl
;
cout
<<
"Avai
la
ble options:"
<<
endl
;
cmd
.
printParams
();
return
0
;
}
vector
<
ocl
::
Info
>
info
;
CV_Assert
(
ocl
::
getDevice
(
info
));
int
iterations
=
10
;
namedWindow
(
wndname
,
1
);
vector
<
vector
<
Point
>
>
squares_cpu
,
squares_ocl
;
...
...
samples/ocl/stereo_match.cpp
View file @
69c2ef5e
...
...
@@ -77,28 +77,18 @@ int main(int argc, char** argv)
"{ r | right | | specify right image }"
"{ m | method | BM | specify match method(BM/BP/CSBP) }"
"{ n | ndisp | 64 | specify number of disparity levels }"
"{ s | cpu_ocl | false | use cpu or gpu as ocl device to process the image }"
"{ o | output | stereo_match_output.jpg | specify output path when input is images}"
;
CommandLineParser
cmd
(
argc
,
argv
,
keys
);
if
(
cmd
.
get
<
bool
>
(
"help"
))
{
cout
<<
"Avaible options:"
<<
endl
;
cout
<<
"Avai
la
ble options:"
<<
endl
;
cmd
.
printParams
();
return
0
;
}
try
{
App
app
(
cmd
);
int
flag
=
CVCL_DEVICE_TYPE_GPU
;
if
(
cmd
.
get
<
bool
>
(
"s"
)
==
true
)
flag
=
CVCL_DEVICE_TYPE_CPU
;
vector
<
Info
>
info
;
if
(
getDevice
(
info
,
flag
)
==
0
)
{
throw
runtime_error
(
"Error: Did not find a valid OpenCL device!"
);
}
cout
<<
"Device name:"
<<
info
[
0
].
DeviceName
[
0
]
<<
endl
;
cout
<<
"Device name:"
<<
cv
::
ocl
::
Context
::
getContext
()
->
getDeviceInfo
().
deviceName
<<
endl
;
app
.
run
();
}
...
...
samples/ocl/surf_matcher.cpp
View file @
69c2ef5e
...
...
@@ -145,19 +145,11 @@ int main(int argc, char* argv[])
CommandLineParser
cmd
(
argc
,
argv
,
keys
);
if
(
cmd
.
get
<
bool
>
(
"help"
))
{
std
::
cout
<<
"Avaible options:"
<<
std
::
endl
;
std
::
cout
<<
"Avai
la
ble options:"
<<
std
::
endl
;
cmd
.
printParams
();
return
0
;
}
vector
<
cv
::
ocl
::
Info
>
info
;
if
(
cv
::
ocl
::
getDevice
(
info
)
==
0
)
{
std
::
cout
<<
"Error: Did not find a valid OpenCL device!"
<<
std
::
endl
;
return
-
1
;
}
ocl
::
setDevice
(
info
[
0
]);
Mat
cpu_img1
,
cpu_img2
,
cpu_img1_grey
,
cpu_img2_grey
;
oclMat
img1
,
img2
;
bool
useCPU
=
cmd
.
get
<
bool
>
(
"c"
);
...
...
@@ -190,7 +182,7 @@ int main(int argc, char* argv[])
{
std
::
cout
<<
"Device name:"
<<
info
[
0
].
DeviceName
[
0
]
<<
cv
::
ocl
::
Context
::
getContext
()
->
getDeviceInfo
().
deviceName
<<
std
::
endl
;
}
double
surf_time
=
0.
;
...
...
samples/ocl/tvl1_optical_flow.cpp
View file @
69c2ef5e
...
...
@@ -80,13 +80,6 @@ static void getFlowField(const Mat& u, const Mat& v, Mat& flowField)
int
main
(
int
argc
,
const
char
*
argv
[])
{
static
std
::
vector
<
Info
>
ocl_info
;
ocl
::
getDevice
(
ocl_info
);
//if you want to use undefault device, set it here
setDevice
(
ocl_info
[
0
]);
//set this to save kernel compile time from second time you run
ocl
::
setBinpath
(
"./"
);
const
char
*
keys
=
"{ h | help | false | print help message }"
"{ l | left | | specify left image }"
...
...
@@ -101,7 +94,7 @@ int main(int argc, const char* argv[])
if
(
cmd
.
get
<
bool
>
(
"help"
))
{
cout
<<
"Usage: pyrlk_optical_flow [options]"
<<
endl
;
cout
<<
"Avaible options:"
<<
endl
;
cout
<<
"Avai
la
ble options:"
<<
endl
;
cmd
.
printParams
();
return
0
;
}
...
...
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