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
19173665
Commit
19173665
authored
Sep 26, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
empty cascade
parent
4881205b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
125 additions
and
125 deletions
+125
-125
isf-sc.cu
modules/gpu/src/cuda/isf-sc.cu
+0
-0
icf.hpp
modules/gpu/src/icf.hpp
+125
-125
softcascade.cpp
modules/gpu/src/softcascade.cpp
+0
-0
No files found.
modules/gpu/src/cuda/isf-sc.cu
View file @
19173665
This diff is collapsed.
Click to expand it.
modules/gpu/src/icf.hpp
View file @
19173665
...
@@ -40,127 +40,127 @@
...
@@ -40,127 +40,127 @@
//
//
//M*/
//M*/
#include <opencv2/gpu/device/common.hpp>
// #include <opencv2/gpu/device/common.hpp>
#ifndef __OPENCV_ICF_HPP__
// #ifndef __OPENCV_ICF_HPP__
#define __OPENCV_ICF_HPP__
// #define __OPENCV_ICF_HPP__
#if defined __CUDACC__
// #if defined __CUDACC__
# define __device __device__ __forceinline__
// # define __device __device__ __forceinline__
#else
// #else
# define __device
// # define __device
#endif
// #endif
namespace
cv
{
namespace
gpu
{
namespace
icf
{
// namespace cv { namespace gpu { namespace icf {
using
cv
::
gpu
::
PtrStepSzb
;
// using cv::gpu::PtrStepSzb;
using
cv
::
gpu
::
PtrStepSzf
;
// using cv::gpu::PtrStepSzf;
typedef
unsigned
char
uchar
;
// typedef unsigned char uchar;
struct
__align__
(
16
)
Octave
// struct __align__(16) Octave
{
// {
ushort
index
;
// ushort index;
ushort
stages
;
// ushort stages;
ushort
shrinkage
;
// ushort shrinkage;
ushort2
size
;
// ushort2 size;
float
scale
;
// float scale;
Octave
(
const
ushort
i
,
const
ushort
s
,
const
ushort
sh
,
const
ushort2
sz
,
const
float
sc
)
// Octave(const ushort i, const ushort s, const ushort sh, const ushort2 sz, const float sc)
:
index
(
i
),
stages
(
s
),
shrinkage
(
sh
),
size
(
sz
),
scale
(
sc
)
{}
// : index(i), stages(s), shrinkage(sh), size(sz), scale(sc) {}
};
// };
struct
__align__
(
8
)
Level
//is actually 24 bytes
// struct __align__(8) Level //is actually 24 bytes
{
// {
int
octave
;
// int octave;
// float origScale; //not actually used
// // float origScale; //not actually used
float
relScale
;
// float relScale;
float
shrScale
;
// used for marking detection
// float shrScale; // used for marking detection
float
scaling
[
2
];
// calculated according to Dollal paper
// float scaling[2]; // calculated according to Dollal paper
// for 640x480 we can not get overflow
// // for 640x480 we can not get overflow
uchar2
workRect
;
// uchar2 workRect;
uchar2
objSize
;
// uchar2 objSize;
Level
(
int
idx
,
const
Octave
&
oct
,
const
float
scale
,
const
int
w
,
const
int
h
)
// Level(int idx, const Octave& oct, const float scale, const int w, const int h)
:
octave
(
idx
),
relScale
(
scale
/
oct
.
scale
),
shrScale
(
relScale
/
(
float
)
oct
.
shrinkage
)
// : octave(idx), relScale(scale / oct.scale), shrScale (relScale / (float)oct.shrinkage)
{
// {
workRect
.
x
=
round
(
w
/
(
float
)
oct
.
shrinkage
);
// workRect.x = round(w / (float)oct.shrinkage);
workRect
.
y
=
round
(
h
/
(
float
)
oct
.
shrinkage
);
// workRect.y = round(h / (float)oct.shrinkage);
objSize
.
x
=
round
(
oct
.
size
.
x
*
relScale
);
// objSize.x = round(oct.size.x * relScale);
objSize
.
y
=
round
(
oct
.
size
.
y
*
relScale
);
// objSize.y = round(oct.size.y * relScale);
}
// }
};
// };
struct
Cascade
// struct Cascade
{
// {
Cascade
()
{}
// Cascade() {}
Cascade
(
const
cv
::
gpu
::
PtrStepSzb
&
octs
,
const
cv
::
gpu
::
PtrStepSzf
&
sts
,
const
cv
::
gpu
::
PtrStepSzb
&
nds
,
// Cascade(const cv::gpu::PtrStepSzb& octs, const cv::gpu::PtrStepSzf& sts, const cv::gpu::PtrStepSzb& nds,
const
cv
::
gpu
::
PtrStepSzf
&
lvs
,
const
cv
::
gpu
::
PtrStepSzb
&
fts
,
const
cv
::
gpu
::
PtrStepSzb
&
lls
)
// const cv::gpu::PtrStepSzf& lvs, const cv::gpu::PtrStepSzb& fts, const cv::gpu::PtrStepSzb& lls)
:
octaves
(
octs
),
stages
(
sts
),
nodes
(
nds
),
leaves
(
lvs
),
features
(
fts
),
levels
(
lls
)
{}
// : octaves(octs), stages(sts), nodes(nds), leaves(lvs), features(fts), levels(lls) {}
void
detect
(
const
cv
::
gpu
::
PtrStepSzi
&
hogluv
,
cv
::
gpu
::
PtrStepSz
<
uchar4
>
objects
,
cudaStream_t
stream
)
const
;
// void detect(const cv::gpu::PtrStepSzi& hogluv, cv::gpu::PtrStepSz<uchar4> objects, cudaStream_t stream) const;
void
__device
detectAt
(
const
int
*
__restrict__
hogluv
,
const
int
pitch
,
PtrStepSz
<
uchar4
>&
objects
)
const
;
// void __device detectAt(const int* __restrict__ hogluv, const int pitch, PtrStepSz<uchar4>& objects) const;
float
__device
rescale
(
const
icf
::
Level
&
level
,
uchar4
&
scaledRect
,
// float __device rescale(const icf::Level& level, uchar4& scaledRect,
const
int
channel
,
const
float
threshold
)
const
;
// const int channel, const float threshold) const;
PtrStepSzb
octaves
;
// PtrStepSzb octaves;
PtrStepSzf
stages
;
// PtrStepSzf stages;
PtrStepSzb
nodes
;
// PtrStepSzb nodes;
PtrStepSzf
leaves
;
// PtrStepSzf leaves;
PtrStepSzb
features
;
// PtrStepSzb features;
PtrStepSzb
levels
;
// PtrStepSzb levels;
};
// };
struct
ChannelStorage
// struct ChannelStorage
{
// {
ChannelStorage
(){}
// ChannelStorage(){}
ChannelStorage
(
const
cv
::
gpu
::
PtrStepSzb
&
buff
,
const
cv
::
gpu
::
PtrStepSzb
&
shr
,
// ChannelStorage(const cv::gpu::PtrStepSzb& buff, const cv::gpu::PtrStepSzb& shr,
const
cv
::
gpu
::
PtrStepSzb
&
itg
,
const
int
s
)
// const cv::gpu::PtrStepSzb& itg, const int s)
:
dmem
(
buff
),
shrunk
(
shr
),
hogluv
(
itg
),
shrinkage
(
s
)
{}
// : dmem (buff), shrunk(shr), hogluv(itg), shrinkage(s) {}
void
frame
(
const
cv
::
gpu
::
PtrStepSz
<
uchar3
>&
rgb
,
cudaStream_t
stream
){}
// void frame(const cv::gpu::PtrStepSz<uchar3>& rgb, cudaStream_t stream){}
PtrStepSzb
dmem
;
// PtrStepSzb dmem;
PtrStepSzb
shrunk
;
// PtrStepSzb shrunk;
PtrStepSzb
hogluv
;
// PtrStepSzb hogluv;
enum
// enum
{
// {
FRAME_WIDTH
=
640
,
// FRAME_WIDTH = 640,
FRAME_HEIGHT
=
480
,
// FRAME_HEIGHT = 480,
TOTAL_SCALES
=
55
,
// TOTAL_SCALES = 55,
CLASSIFIERS
=
5
,
// CLASSIFIERS = 5,
ORIG_OBJECT_WIDTH
=
64
,
// ORIG_OBJECT_WIDTH = 64,
ORIG_OBJECT_HEIGHT
=
128
,
// ORIG_OBJECT_HEIGHT = 128,
HOG_BINS
=
6
,
// HOG_BINS = 6,
HOG_LUV_BINS
=
10
// HOG_LUV_BINS = 10
};
// };
int
shrinkage
;
// int shrinkage;
static
const
float
magnitudeScaling
=
1.
f
;
// / sqrt(2);
// static const float magnitudeScaling = 1.f ;// / sqrt(2);
};
// };
struct
__align__
(
8
)
Node
// struct __align__(8) Node
{
// {
int
feature
;
// int feature;
float
threshold
;
// float threshold;
Node
(
const
int
f
,
const
float
t
)
:
feature
(
f
),
threshold
(
t
)
{}
// Node(const int f, const float t) : feature(f), threshold(t) {}
};
// };
struct
__align__
(
8
)
Feature
// struct __align__(8) Feature
{
// {
int
channel
;
// int channel;
uchar4
rect
;
// uchar4 rect;
Feature
(
const
int
c
,
const
uchar4
r
)
:
channel
(
c
),
rect
(
r
)
{}
// Feature(const int c, const uchar4 r) : channel(c), rect(r) {}
};
// };
}}}
// }}}
#endif
// #endif
\ No newline at end of file
\ No newline at end of file
modules/gpu/src/softcascade.cpp
View file @
19173665
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