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
97731c15
Commit
97731c15
authored
Aug 15, 2012
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed typo
parent
db79022b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+1
-1
hough.cu
modules/gpu/src/cuda/hough.cu
+6
-6
hough.cpp
modules/gpu/src/hough.cpp
+9
-9
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
97731c15
...
...
@@ -824,7 +824,7 @@ CV_EXPORTS void HoughLines(const GpuMat& src, GpuMat& lines, float rho, float th
CV_EXPORTS
void
HoughLines
(
const
GpuMat
&
src
,
GpuMat
&
lines
,
GpuMat
&
accum
,
GpuMat
&
buf
,
float
rho
,
float
theta
,
int
threshold
,
bool
doSort
=
false
,
int
maxLines
=
4096
);
CV_EXPORTS
void
HoughLinesTransform
(
const
GpuMat
&
src
,
GpuMat
&
accum
,
GpuMat
&
buf
,
float
rho
,
float
theta
);
CV_EXPORTS
void
HoughLinesGet
(
const
GpuMat
&
accum
,
GpuMat
&
lines
,
float
rho
,
float
theta
,
int
threshold
,
bool
doSort
=
false
,
int
maxLines
=
4096
);
CV_EXPORTS
void
HoughLinesDownload
(
const
GpuMat
&
d_lines
,
OutputArray
h_lines
,
OutputArray
h_vo
ic
es
=
noArray
());
CV_EXPORTS
void
HoughLinesDownload
(
const
GpuMat
&
d_lines
,
OutputArray
h_lines
,
OutputArray
h_vo
t
es
=
noArray
());
////////////////////////////// Matrix reductions //////////////////////////////
...
...
modules/gpu/src/cuda/hough.cu
View file @
97731c15
...
...
@@ -225,7 +225,7 @@ namespace cv { namespace gpu { namespace device
////////////////////////////////////////////////////////////////////////
// linesGetResult
__global__ void linesGetResult(const DevMem2Di accum, float2* out, int* vo
ic
es, const int maxSize, const float threshold, const float theta, const float rho, const int numrho)
__global__ void linesGetResult(const DevMem2Di accum, float2* out, int* vo
t
es, const int maxSize, const float threshold, const float theta, const float rho, const int numrho)
{
__shared__ int smem[8][32];
...
...
@@ -257,12 +257,12 @@ namespace cv { namespace gpu { namespace device
if (ind < maxSize)
{
out[ind] = make_float2(radius, angle);
vo
ic
es[ind] = smem[threadIdx.y][threadIdx.x];
vo
t
es[ind] = smem[threadIdx.y][threadIdx.x];
}
}
}
int linesGetResult_gpu(DevMem2Di accum, float2* out, int* vo
ic
es, int maxSize, float rho, float theta, float threshold, bool doSort)
int linesGetResult_gpu(DevMem2Di accum, float2* out, int* vo
t
es, int maxSize, float rho, float theta, float threshold, bool doSort)
{
void* counter_ptr;
cudaSafeCall( cudaGetSymbolAddress(&counter_ptr, g_counter) );
...
...
@@ -272,7 +272,7 @@ namespace cv { namespace gpu { namespace device
const dim3 block(32, 8);
const dim3 grid(divUp(accum.cols, block.x - 2), divUp(accum.rows, block.y - 2));
linesGetResult<<<grid, block>>>(accum, out, vo
ic
es, maxSize, threshold, theta, rho, accum.cols - 2);
linesGetResult<<<grid, block>>>(accum, out, vo
t
es, maxSize, threshold, theta, rho, accum.cols - 2);
cudaSafeCall( cudaGetLastError() );
cudaSafeCall( cudaDeviceSynchronize() );
...
...
@@ -285,8 +285,8 @@ namespace cv { namespace gpu { namespace device
if (doSort && total_count > 0)
{
thrust::device_ptr<float2> out_ptr(out);
thrust::device_ptr<int> vo
ices_ptr(voic
es);
thrust::sort_by_key(vo
ices_ptr, voic
es_ptr + total_count, out_ptr, thrust::greater<int>());
thrust::device_ptr<int> vo
tes_ptr(vot
es);
thrust::sort_by_key(vo
tes_ptr, vot
es_ptr + total_count, out_ptr, thrust::greater<int>());
}
return total_count;
...
...
modules/gpu/src/hough.cpp
View file @
97731c15
...
...
@@ -58,7 +58,7 @@ namespace cv { namespace gpu { namespace device
{
int
buildPointList_gpu
(
DevMem2Db
src
,
unsigned
int
*
list
);
void
linesAccum_gpu
(
const
unsigned
int
*
list
,
int
count
,
DevMem2Di
accum
,
float
rho
,
float
theta
,
size_t
sharedMemPerBlock
);
int
linesGetResult_gpu
(
DevMem2Di
accum
,
float2
*
out
,
int
*
vo
ic
es
,
int
maxSize
,
float
rho
,
float
theta
,
float
threshold
,
bool
doSort
);
int
linesGetResult_gpu
(
DevMem2Di
accum
,
float2
*
out
,
int
*
vo
t
es
,
int
maxSize
,
float
rho
,
float
theta
,
float
threshold
,
bool
doSort
);
}
}}}
...
...
@@ -116,13 +116,13 @@ void cv::gpu::HoughLines(const GpuMat& src, GpuMat& lines, GpuMat& accum, GpuMat
HoughLinesGet
(
accum
,
lines
,
rho
,
theta
,
threshold
,
doSort
,
maxLines
);
}
void
cv
::
gpu
::
HoughLinesDownload
(
const
GpuMat
&
d_lines
,
OutputArray
h_lines_
,
OutputArray
h_vo
ic
es_
)
void
cv
::
gpu
::
HoughLinesDownload
(
const
GpuMat
&
d_lines
,
OutputArray
h_lines_
,
OutputArray
h_vo
t
es_
)
{
if
(
d_lines
.
empty
())
{
h_lines_
.
release
();
if
(
h_vo
ic
es_
.
needed
())
h_vo
ic
es_
.
release
();
if
(
h_vo
t
es_
.
needed
())
h_vo
t
es_
.
release
();
return
;
}
...
...
@@ -132,12 +132,12 @@ void cv::gpu::HoughLinesDownload(const GpuMat& d_lines, OutputArray h_lines_, Ou
cv
::
Mat
h_lines
=
h_lines_
.
getMat
();
d_lines
.
row
(
0
).
download
(
h_lines
);
if
(
h_vo
ic
es_
.
needed
())
if
(
h_vo
t
es_
.
needed
())
{
h_vo
ic
es_
.
create
(
1
,
d_lines
.
cols
,
CV_32SC1
);
cv
::
Mat
h_vo
ices
=
h_voic
es_
.
getMat
();
cv
::
gpu
::
GpuMat
d_vo
ic
es
(
1
,
d_lines
.
cols
,
CV_32SC1
,
const_cast
<
int
*>
(
d_lines
.
ptr
<
int
>
(
1
)));
d_vo
ices
.
download
(
h_voic
es
);
h_vo
t
es_
.
create
(
1
,
d_lines
.
cols
,
CV_32SC1
);
cv
::
Mat
h_vo
tes
=
h_vot
es_
.
getMat
();
cv
::
gpu
::
GpuMat
d_vo
t
es
(
1
,
d_lines
.
cols
,
CV_32SC1
,
const_cast
<
int
*>
(
d_lines
.
ptr
<
int
>
(
1
)));
d_vo
tes
.
download
(
h_vot
es
);
}
}
...
...
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