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
40600fa5
Commit
40600fa5
authored
Nov 09, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GPU version becomes algorithm
parent
e6eb1b99
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
40 deletions
+100
-40
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+39
-40
perf_softcascade.cpp
modules/gpu/perf/perf_softcascade.cpp
+0
-0
gpu_init.cpp
modules/gpu/src/gpu_init.cpp
+61
-0
softcascade.cpp
modules/gpu/src/softcascade.cpp
+0
-0
test_softcascade.cpp
modules/gpu/test/test_softcascade.cpp
+0
-0
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
40600fa5
...
...
@@ -1534,10 +1534,12 @@ public:
// ======================== GPU version for soft cascade ===================== //
class
CV_EXPORTS
SoftCascade
// Implementation of soft (stageless) cascaded detector.
class
CV_EXPORTS
SCascade
:
public
Algorithm
{
public
:
// Representation of detectors result.
struct
CV_EXPORTS
Detection
{
ushort
x
;
...
...
@@ -1549,47 +1551,44 @@ public:
enum
{
PEDESTRIAN
=
0
};
};
//! An empty cascade will be created.
SoftCascade
();
//! Cascade will be created from file for scales from minScale to maxScale.
//! Param filename is a path to xml-serialized cascade.
//! Param minScale is a minimum scale relative to the original size of the image on which cascade will be applyed.
//! Param minScale is a maximum scale relative to the original size of the image on which cascade will be applyed.
SoftCascade
(
const
string
&
filename
,
const
float
minScale
=
0.4
f
,
const
float
maxScale
=
5.
f
);
//! cascade will be loaded from file "filename". The previous cascade will be destroyed.
//! Param filename is a path to xml-serialized cascade.
//! Param minScale is a minimum scale relative to the original size of the image on which cascade will be applyed.
//! Param minScale is a maximum scale relative to the original size of the image on which cascade will be applyed.
bool
load
(
const
string
&
filename
,
const
float
minScale
=
0.4
f
,
const
float
maxScale
=
5.
f
);
virtual
~
SoftCascade
();
//! detect specific objects on in the input frame for all scales computed flom minScale and maxscale values
//! Param image is input frame for detector. Cascade will be applied to it.
//! Param rois is a mask
//! Param objects 4-channel matrix thet contain detected rectangles
//! Param rejectfactor used for final object box computing
virtual
void
detectMultiScale
(
const
GpuMat
&
image
,
const
GpuMat
&
rois
,
GpuMat
&
objects
,
int
rejectfactor
=
1
,
int
specificScale
=
-
1
)
const
;
//! detect specific objects on in the input frame for all scales computed flom minScale and maxscale values.
//! asynchronous version.
//! Param image is input frame for detector. Cascade will be applied to it.
//! Param rois is a mask
//! Param objects 4-channel matrix thet contain detected rectangles
//! Param rejectfactor used for final object box computing
//! Param ndet retrieves number of detections
//! Param stream wrapper for CUDA stream
virtual
void
detectMultiScale
(
const
GpuMat
&
image
,
const
GpuMat
&
rois
,
GpuMat
&
objects
,
int
rejectfactor
,
GpuMat
&
ndet
,
Stream
stream
)
const
;
cv
::
Size
getRoiSize
()
const
;
// An empty cascade will be created.
// Param minScale is a minimum scale relative to the original size of the image on which cascade will be applyed.
// Param minScale is a maximum scale relative to the original size of the image on which cascade will be applyed.
// Param scales is a number of scales from minScale to maxScale.
// Param rejfactor is used for NMS.
SCascade
(
const
double
minScale
=
0.4
,
const
double
maxScale
=
5.
,
const
int
scales
=
55
,
const
int
rejfactor
=
1
);
virtual
~
SCascade
();
cv
::
AlgorithmInfo
*
info
()
const
;
// Load cascade from FileNode.
// Param fn is a root node for cascade. Should be <cascade>.
virtual
bool
load
(
const
FileNode
&
fn
);
// Load cascade config.
virtual
void
read
(
const
FileNode
&
fn
);
// Return the vector of Decection objcts.
// Param image is a frame on which detector will be applied.
// Param rois is a vector of regions of interest. Only the objects that fall into one of the regions will be returned.
// Param objects is an output array of Detections
virtual
void
detect
(
InputArray
image
,
InputArray
rois
,
OutputArray
objects
,
Stream
&
stream
=
Stream
::
Null
())
const
;
virtual
void
detect
(
InputArray
image
,
InputArray
rois
,
OutputArray
objects
,
const
int
level
,
Stream
&
stream
=
Stream
::
Null
())
const
;
void
genRoi
(
InputArray
roi
,
OutputArray
mask
)
const
;
private
:
struct
Filds
;
Filds
*
filds
;
struct
Fields
;
Fields
*
fields
;
double
minScale
;
double
maxScale
;
int
scales
;
int
rejfactor
;
};
////////////////////////////////// SURF //////////////////////////////////////////
...
...
modules/gpu/perf/perf_softcascade.cpp
View file @
40600fa5
This diff is collapsed.
Click to expand it.
modules/gpu/src/gpu_init.cpp
0 → 100644
View file @
40600fa5
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include <precomp.hpp>
namespace
cv
{
namespace
gpu
{
CV_INIT_ALGORITHM
(
SCascade
,
"CascadeDetector.SCascade"
,
obj
.
info
()
->
addParam
(
obj
,
"minScale"
,
obj
.
minScale
);
obj
.
info
()
->
addParam
(
obj
,
"maxScale"
,
obj
.
maxScale
);
obj
.
info
()
->
addParam
(
obj
,
"scales"
,
obj
.
scales
);
obj
.
info
()
->
addParam
(
obj
,
"rejfactor"
,
obj
.
rejfactor
));
bool
initModule_gpu
(
void
)
{
Ptr
<
Algorithm
>
sc
=
createSCascade
();
return
sc
->
info
()
!=
0
;
}
}
}
\ No newline at end of file
modules/gpu/src/softcascade.cpp
View file @
40600fa5
This diff is collapsed.
Click to expand it.
modules/gpu/test/test_softcascade.cpp
View file @
40600fa5
This diff is collapsed.
Click to expand it.
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