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
3e8c35a3
Commit
3e8c35a3
authored
Aug 08, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added perf. test for GFF
parent
cbfee83b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
ccomponetns.cu
modules/gpu/src/cuda/ccomponetns.cu
+6
-6
graphcuts.cpp
modules/gpu/src/graphcuts.cpp
+2
-2
No files found.
modules/gpu/src/cuda/ccomponetns.cu
View file @
3e8c35a3
...
...
@@ -485,7 +485,9 @@ namespace cv { namespace gpu { namespace device
comps(y, x) = root(comps, comps(y, x));
}
void labelComponents(const DevMem2D& edges, DevMem2Di comps, cudaStream_t stream)
enum {CC_NO_COMPACT = 0, CC_COMPACT_LABELS = 1};
void labelComponents(const DevMem2D& edges, DevMem2Di comps, int flags, cudaStream_t stream)
{
dim3 block(CTA_SIZE_X, CTA_SIZE_Y);
dim3 grid(divUp(edges.cols, TILE_COLS), divUp(edges.rows, TILE_ROWS));
...
...
@@ -494,15 +496,12 @@ namespace cv { namespace gpu { namespace device
cudaSafeCall( cudaGetLastError() );
int tileSizeX = TILE_COLS, tileSizeY = TILE_ROWS;
cudaSafeCall( cudaGetLastError() );
// cudaSafeCall( cudaDeviceSynchronize() );
while (grid.x > 1 || grid.y > 1)
{
dim3 mergeGrid(ceilf(grid.x / 2.0), ceilf(grid.y / 2.0));
dim3 mergeBlock(STA_SIZE_MARGE_X, STA_SIZE_MARGE_Y);
std::cout << "merging: " << grid.y << " x " << grid.x << " ---> " << mergeGrid.y << " x " << mergeGrid.x << " for tiles: " << tileSizeY << " x " << tileSizeX << std::endl;
// debug log
// std::cout << "merging: " << grid.y << " x " << grid.x << " ---> " << mergeGrid.y << " x " << mergeGrid.x << " for tiles: " << tileSizeY << " x " << tileSizeX << std::endl;
crossMerge<<<mergeGrid, mergeBlock, 0, stream>>>(2, 2, tileSizeY, tileSizeX, edges, comps, ceilf(grid.y / 2.0) - grid.y / 2, ceilf(grid.x / 2.0) - grid.x / 2);
tileSizeX <<= 1;
tileSizeY <<= 1;
...
...
@@ -515,6 +514,7 @@ namespace cv { namespace gpu { namespace device
grid.y = divUp(edges.rows, block.y);
flatten<<<grid, block, 0, stream>>>(edges, comps);
cudaSafeCall( cudaGetLastError() );
if (stream == 0)
cudaSafeCall( cudaDeviceSynchronize() );
}
...
...
modules/gpu/src/graphcuts.cpp
View file @
3e8c35a3
...
...
@@ -56,7 +56,7 @@ namespace cv { namespace gpu { namespace device
{
namespace
ccl
{
void
labelComponents
(
const
DevMem2D
&
edges
,
DevMem2Di
comps
,
cudaStream_t
stream
);
void
labelComponents
(
const
DevMem2D
&
edges
,
DevMem2Di
comps
,
int
flags
,
cudaStream_t
stream
);
template
<
typename
T
>
void
computeEdges
(
const
DevMem2D
&
image
,
DevMem2D
edges
,
const
float4
&
lo
,
const
float4
&
hi
,
cudaStream_t
stream
);
...
...
@@ -114,7 +114,7 @@ void cv::gpu::labelComponents(const GpuMat& mask, GpuMat& components, Stream& s)
components
.
create
(
mask
.
size
(),
CV_32SC1
);
cudaStream_t
stream
=
StreamAccessor
::
getStream
(
s
);
device
::
ccl
::
labelComponents
(
mask
,
components
,
stream
);
device
::
ccl
::
labelComponents
(
mask
,
components
,
0
,
stream
);
}
namespace
...
...
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