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
05cd88ae
Commit
05cd88ae
authored
Nov 26, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean code; fix problems in documentation
parent
bd3179bd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
98 deletions
+9
-98
object_detection.rst
modules/gpu/doc/object_detection.rst
+3
-3
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+3
-1
perf_softcascade.cpp
modules/gpu/perf/perf_softcascade.cpp
+0
-35
icf-sc.cu
modules/gpu/src/cuda/icf-sc.cu
+1
-1
icf.hpp
modules/gpu/src/icf.hpp
+1
-7
softcascade.cpp
modules/gpu/src/softcascade.cpp
+1
-1
test_softcascade.cpp
modules/gpu/test/test_softcascade.cpp
+0
-50
No files found.
modules/gpu/doc/object_detection.rst
View file @
05cd88ae
...
...
@@ -200,7 +200,7 @@ The function is mainly used to learn the classifier.
Soft Cascade Classifier
======================
======================
====
Soft Cascade Classifier for Object Detection
----------------------------------------------------------
...
...
@@ -226,7 +226,7 @@ The sample has been rejected if it fall rejection threshold. So stageless cascad
SCascade
----------------
.. ocv:class:: SCascade
.. ocv:class:: SCascade
: public Algorithm
Implementation of soft (stageless) cascaded detector. ::
...
...
@@ -248,7 +248,7 @@ Implementation of soft (stageless) cascaded detector. ::
virtual ~SCascade();
virtual bool load(const FileNode& fn);
virtual void detect(InputArray image, InputArray rois, OutputArray objects, Stream& stream = Stream::Null()) const;
void genRoi(InputArray roi, OutputArray mask, Stream& stream = Stream::Null()) const;
v
irtual v
oid genRoi(InputArray roi, OutputArray mask, Stream& stream = Stream::Null()) const;
};
...
...
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
05cd88ae
...
...
@@ -1586,7 +1586,7 @@ public:
// There non zero value mean that detector should be executed in this point.
// Param mask is an output mask
// Param stream is stream is a high-level CUDA stream abstraction used for asynchronous execution
void
genRoi
(
InputArray
roi
,
OutputArray
mask
,
Stream
&
stream
=
Stream
::
Null
())
const
;
v
irtual
v
oid
genRoi
(
InputArray
roi
,
OutputArray
mask
,
Stream
&
stream
=
Stream
::
Null
())
const
;
private
:
...
...
@@ -1600,6 +1600,8 @@ private:
int
rejCriteria
;
};
CV_EXPORTS
bool
initModule_gpu
(
void
);
////////////////////////////////// SURF //////////////////////////////////////////
class
CV_EXPORTS
SURF_GPU
...
...
modules/gpu/perf/perf_softcascade.cpp
View file @
05cd88ae
...
...
@@ -33,18 +33,6 @@ namespace {
else
if
(
a
.
w
!=
b
.
w
)
return
a
.
w
<
b
.
w
;
else
return
a
.
h
<
b
.
h
;
}
// bool operator()(const cv::SoftCascade::Detection& a,
// const cv::SoftCascade::Detection& b) const
// {
// const cv::Rect& ra = a.rect;
// const cv::Rect& rb = b.rect;
// if (ra.x != rb.x) return ra.x < rb.x;
// else if (ra.y != rb.y) return ra.y < rb.y;
// else if (ra.width != rb.width) return ra.width < rb.width;
// else return ra.height < rb.height;
// }
};
cv
::
Mat
sortDetections
(
cv
::
gpu
::
GpuMat
&
objects
)
...
...
@@ -99,29 +87,6 @@ RUN_GPU(SCascadeTest, detect)
NO_CPU
(
SCascadeTest
,
detect
)
// RUN_CPU(SCascadeTest, detect)
// {
// cv::Mat colored = readImage(GET_PARAM(1));
// ASSERT_FALSE(colored.empty());
// cv::SCascade cascade;
// ASSERT_TRUE(cascade.load(getDataPath(GET_PARAM(0))));
// std::vector<cv::Rect> rois;
// typedef cv::SCascade::Detection Detection;
// std::vector<Detection>objects;
// cascade.detectMultiScale(colored, rois, objects);
// TEST_CYCLE()
// {
// cascade.detectMultiScale(colored, rois, objects);
// }
// std::sort(objects.begin(), objects.end(), DetectionLess());
// SANITY_CHECK(objects);
// }
static
cv
::
Rect
getFromTable
(
int
idx
)
{
static
const
cv
::
Rect
rois
[]
=
...
...
modules/gpu/src/cuda/icf-sc.cu
View file @
05cd88ae
...
...
@@ -49,7 +49,7 @@
namespace cv { namespace gpu { namespace device {
namespace icf {
// ToDo: use textures or
a
ncached load instruction.
// ToDo: use textures or
u
ncached load instruction.
__global__ void magToHist(const uchar* __restrict__ mag,
const float* __restrict__ angle, const int angPitch,
uchar* __restrict__ hog, const int hogPitch, const int fh)
...
...
modules/gpu/src/icf.hpp
View file @
05cd88ae
...
...
@@ -45,7 +45,6 @@
#define __OPENCV_ICF_HPP__
#include <opencv2/gpu/device/common.hpp>
#include <stdio.h>
#if defined __CUDACC__
# define __device __device__ __forceinline__
...
...
@@ -93,12 +92,7 @@ struct __align__(8) Node
enum
{
THRESHOLD_MASK
=
0x0FFFFFFF
};
Node
(
const
uchar4
r
,
const
uint
ch
,
const
uint
t
)
:
rect
(
r
),
threshold
(
t
+
(
ch
<<
28
))
{
// printf("%d\n", t);
// printf("[%d %d %d %d] %d, %d\n",rect.x, rect.y, rect.z, rect.w, (int)(threshold >> 28),
// (int)(0x0FFFFFFF & threshold));
}
Node
(
const
uchar4
r
,
const
uint
ch
,
const
uint
t
)
:
rect
(
r
),
threshold
(
t
+
(
ch
<<
28
))
{}
};
struct
__align__
(
16
)
Detection
...
...
modules/gpu/src/softcascade.cpp
View file @
05cd88ae
...
...
@@ -142,7 +142,7 @@ struct cv::gpu::SCascade::Fields
static
const
char
*
const
SC_F_RECT
=
"rect"
;
FileNode
fn
=
root
[
SC_OCTAVES
];
if
(
fn
.
empty
())
return
false
;
if
(
fn
.
empty
())
return
false
;
using
namespace
device
::
icf
;
...
...
modules/gpu/test/test_softcascade.cpp
View file @
05cd88ae
...
...
@@ -205,56 +205,6 @@ GPU_TEST_P(SCascadeTestRoi, detect,
}
// typedef ::testing::TestWithParam<std::tr1::tuple<cv::gpu::DeviceInfo, std::string, std::string, int> > SCascadeTestLevel;
// GPU_TEST_P(SCascadeTestLevel, detect,
// testing::Combine(
// ALL_DEVICES,
// testing::Values(std::string("cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml")),
// testing::Values(std::string("../cv/cascadeandhog/bahnhof/image_00000000_0.png")),
// testing::Range(0, 47)
// ))
// {
// cv::gpu::setDevice(GET_PARAM(0).deviceID());
// cv::gpu::SCascade cascade;
// cv::FileStorage fs(perf::TestBase::getDataPath(GET_PARAM(1)), cv::FileStorage::READ);
// ASSERT_TRUE(fs.isOpened());
// ASSERT_TRUE(cascade.load(fs.getFirstTopLevelNode()));
// cv::Mat coloredCpu = cv::imread(cvtest::TS::ptr()->get_data_path() + GET_PARAM(2));
// ASSERT_FALSE(coloredCpu.empty());
// typedef cv::gpu::SCascade::Detection Detection;
// GpuMat colored(coloredCpu), objectBoxes(1, 100 * sizeof(Detection), CV_8UC1), rois(colored.size(), CV_8UC1);
// rois.setTo(1);
// cv::gpu::GpuMat trois;
// cascade.genRoi(rois, trois);
// objectBoxes.setTo(0);
// int level = GET_PARAM(3);
// cascade.detect(colored, trois, objectBoxes, level);
// cv::Mat dt(objectBoxes);
// Detection* dts = ((Detection*)dt.data) + 1;
// int* count = dt.ptr<int>(0);
// cv::Mat result(coloredCpu);
// printTotal(std::cout, *count);
// for (int i = 0; i < *count; ++i)
// {
// Detection d = dts[i];
// print(std::cout, d);
// cv::rectangle(result, cv::Rect(d.x, d.y, d.w, d.h), cv::Scalar(255, 0, 0, 255), 1);
// }
// writeResult(result, level);
// SHOW(result);
// }
TEST
(
SCascadeTest
,
readCascade
)
{
std
::
string
xml
=
cvtest
::
TS
::
ptr
()
->
get_data_path
()
+
"../cv/cascadeandhog/icf-template.xml"
;
...
...
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