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
Hide 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 @@
//
//M*/
#include <opencv2/gpu/device/common.hpp>
#ifndef __OPENCV_ICF_HPP__
#define __OPENCV_ICF_HPP__
#if defined __CUDACC__
# define __device __device__ __forceinline__
#else
# define __device
#endif
namespace
cv
{
namespace
gpu
{
namespace
icf
{
using
cv
::
gpu
::
PtrStepSzb
;
using
cv
::
gpu
::
PtrStepSzf
;
typedef
unsigned
char
uchar
;
struct
__align__
(
16
)
Octave
{
ushort
index
;
ushort
stages
;
ushort
shrinkage
;
ushort2
size
;
float
scale
;
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
)
{}
};
struct
__align__
(
8
)
Level
//is actually 24 bytes
{
int
octave
;
// float origScale; //not actually used
float
relScale
;
float
shrScale
;
// used for marking detection
float
scaling
[
2
];
// calculated according to Dollal paper
// for 640x480 we can not get overflow
uchar2
workRect
;
uchar2
objSize
;
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
)
{
workRect
.
x
=
round
(
w
/
(
float
)
oct
.
shrinkage
);
workRect
.
y
=
round
(
h
/
(
float
)
oct
.
shrinkage
);
objSize
.
x
=
round
(
oct
.
size
.
x
*
relScale
);
objSize
.
y
=
round
(
oct
.
size
.
y
*
relScale
);
}
};
struct
Cascade
{
Cascade
()
{}
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
)
:
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
__device
detectAt
(
const
int
*
__restrict__
hogluv
,
const
int
pitch
,
PtrStepSz
<
uchar4
>&
objects
)
const
;
float
__device
rescale
(
const
icf
::
Level
&
level
,
uchar4
&
scaledRect
,
const
int
channel
,
const
float
threshold
)
const
;
PtrStepSzb
octaves
;
PtrStepSzf
stages
;
PtrStepSzb
nodes
;
PtrStepSzf
leaves
;
PtrStepSzb
features
;
PtrStepSzb
levels
;
};
struct
ChannelStorage
{
ChannelStorage
(){}
ChannelStorage
(
const
cv
::
gpu
::
PtrStepSzb
&
buff
,
const
cv
::
gpu
::
PtrStepSzb
&
shr
,
const
cv
::
gpu
::
PtrStepSzb
&
itg
,
const
int
s
)
:
dmem
(
buff
),
shrunk
(
shr
),
hogluv
(
itg
),
shrinkage
(
s
)
{}
void
frame
(
const
cv
::
gpu
::
PtrStepSz
<
uchar3
>&
rgb
,
cudaStream_t
stream
){}
PtrStepSzb
dmem
;
PtrStepSzb
shrunk
;
PtrStepSzb
hogluv
;
enum
{
FRAME_WIDTH
=
640
,
FRAME_HEIGHT
=
480
,
TOTAL_SCALES
=
55
,
CLASSIFIERS
=
5
,
ORIG_OBJECT_WIDTH
=
64
,
ORIG_OBJECT_HEIGHT
=
128
,
HOG_BINS
=
6
,
HOG_LUV_BINS
=
10
};
int
shrinkage
;
static
const
float
magnitudeScaling
=
1.
f
;
// / sqrt(2);
};
struct
__align__
(
8
)
Node
{
int
feature
;
float
threshold
;
Node
(
const
int
f
,
const
float
t
)
:
feature
(
f
),
threshold
(
t
)
{}
};
struct
__align__
(
8
)
Feature
{
int
channel
;
uchar4
rect
;
Feature
(
const
int
c
,
const
uchar4
r
)
:
channel
(
c
),
rect
(
r
)
{}
};
}}}
#endif
\ No newline at end of file
// #include <opencv2/gpu/device/common.hpp>
// #ifndef __OPENCV_ICF_HPP__
// #define __OPENCV_ICF_HPP__
// #if defined __CUDACC__
// # define __device __device__ __forceinline__
// #else
// # define __device
// #endif
// namespace cv { namespace gpu { namespace icf {
// using cv::gpu::PtrStepSzb;
// using cv::gpu::PtrStepSzf;
// typedef unsigned char uchar;
// struct __align__(16) Octave
// {
// ushort index;
// ushort stages;
// ushort shrinkage;
// ushort2 size;
// float scale;
// 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) {}
// };
// struct __align__(8) Level //is actually 24 bytes
// {
// int octave;
// // float origScale; //not actually used
// float relScale;
// float shrScale; // used for marking detection
// float scaling[2]; // calculated according to Dollal paper
// // for 640x480 we can not get overflow
// uchar2 workRect;
// uchar2 objSize;
// 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)
// {
// workRect.x = round(w / (float)oct.shrinkage);
// workRect.y = round(h / (float)oct.shrinkage);
// objSize.x = round(oct.size.x * relScale);
// objSize.y = round(oct.size.y * relScale);
// }
// };
// struct Cascade
// {
// Cascade() {}
// 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)
// : 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 __device detectAt(const int* __restrict__ hogluv, const int pitch, PtrStepSz<uchar4>& objects) const;
// float __device rescale(const icf::Level& level, uchar4& scaledRect,
// const int channel, const float threshold) const;
// PtrStepSzb octaves;
// PtrStepSzf stages;
// PtrStepSzb nodes;
// PtrStepSzf leaves;
// PtrStepSzb features;
// PtrStepSzb levels;
// };
// struct ChannelStorage
// {
// ChannelStorage(){}
// ChannelStorage(const cv::gpu::PtrStepSzb& buff, const cv::gpu::PtrStepSzb& shr,
// const cv::gpu::PtrStepSzb& itg, const int s)
// : dmem (buff), shrunk(shr), hogluv(itg), shrinkage(s) {}
// void frame(const cv::gpu::PtrStepSz<uchar3>& rgb, cudaStream_t stream){}
// PtrStepSzb dmem;
// PtrStepSzb shrunk;
// PtrStepSzb hogluv;
// enum
// {
// FRAME_WIDTH = 640,
// FRAME_HEIGHT = 480,
// TOTAL_SCALES = 55,
// CLASSIFIERS = 5,
// ORIG_OBJECT_WIDTH = 64,
// ORIG_OBJECT_HEIGHT = 128,
// HOG_BINS = 6,
// HOG_LUV_BINS = 10
// };
// int shrinkage;
// static const float magnitudeScaling = 1.f ;// / sqrt(2);
// };
// struct __align__(8) Node
// {
// int feature;
// float threshold;
// Node(const int f, const float t) : feature(f), threshold(t) {}
// };
// struct __align__(8) Feature
// {
// int channel;
// uchar4 rect;
// Feature(const int c, const uchar4 r) : channel(c), rect(r) {}
// };
// }}}
// #endif
\ 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