Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
71e18ff0
Commit
71e18ff0
authored
Aug 20, 2014
by
jaco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pull Request mandatory changes finished
parent
e670bd57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
saliencySpecializedClasses.hpp
...y/include/opencv2/saliency/saliencySpecializedClasses.hpp
+4
-4
computeSaliency.cpp
modules/saliency/samples/computeSaliency.cpp
+10
-1
motionSaliencyBinWangApr2014.cpp
modules/saliency/src/motionSaliencyBinWangApr2014.cpp
+4
-4
No files found.
modules/saliency/include/opencv2/saliency/saliencySpecializedClasses.hpp
View file @
71e18ff0
...
@@ -64,7 +64,7 @@ public:
...
@@ -64,7 +64,7 @@ public:
//StaticSaliencySpectralResidual( const StaticSaliencySpectralResidual::Params ¶meters = StaticSaliencySpectralResidual::Params() );
//StaticSaliencySpectralResidual( const StaticSaliencySpectralResidual::Params ¶meters = StaticSaliencySpectralResidual::Params() );
StaticSaliencySpectralResidual
();
StaticSaliencySpectralResidual
();
~
StaticSaliencySpectralResidual
();
virtual
~
StaticSaliencySpectralResidual
();
void
read
(
const
FileNode
&
fn
);
void
read
(
const
FileNode
&
fn
);
void
write
(
FileStorage
&
fs
)
const
;
void
write
(
FileStorage
&
fs
)
const
;
...
@@ -92,7 +92,7 @@ class CV_EXPORTS MotionSaliencyBinWangApr2014 : public MotionSaliency
...
@@ -92,7 +92,7 @@ class CV_EXPORTS MotionSaliencyBinWangApr2014 : public MotionSaliency
{
{
public
:
public
:
MotionSaliencyBinWangApr2014
();
MotionSaliencyBinWangApr2014
();
~
MotionSaliencyBinWangApr2014
();
virtual
~
MotionSaliencyBinWangApr2014
();
void
setImagesize
(
int
W
,
int
H
);
void
setImagesize
(
int
W
,
int
H
);
bool
init
();
bool
init
();
...
@@ -122,7 +122,7 @@ private:
...
@@ -122,7 +122,7 @@ private:
// for each pixel. In the second layer, there are the C (efficacy) value for each pixel
// for each pixel. In the second layer, there are the C (efficacy) value for each pixel
Mat
potentialBackground
;
// Two channel Matrix. For each pixel, in the first level there are the Ba value (potential background value)
Mat
potentialBackground
;
// Two channel Matrix. For each pixel, in the first level there are the Ba value (potential background value)
// and in the secon level there are the Ca value, the counter for each potential value.
// and in the secon level there are the Ca value, the counter for each potential value.
Mat
epslonPixelsValue
;
// epslon threshold
Mat
epslonPixelsValue
;
// epslon threshold
//Mat activityPixelsValue; // Activity level of each pixel
//Mat activityPixelsValue; // Activity level of each pixel
//vector<Mat> noisePixelMask; // We define a ‘noise-pixel’ as a pixel that has been classified as a foreground pixel during the full resolution
//vector<Mat> noisePixelMask; // We define a ‘noise-pixel’ as a pixel that has been classified as a foreground pixel during the full resolution
// detection process,however, after the low resolution detection, it has become a
// detection process,however, after the low resolution detection, it has become a
...
@@ -163,7 +163,7 @@ class CV_EXPORTS ObjectnessBING : public Objectness
...
@@ -163,7 +163,7 @@ class CV_EXPORTS ObjectnessBING : public Objectness
public
:
public
:
ObjectnessBING
();
ObjectnessBING
();
~
ObjectnessBING
();
virtual
~
ObjectnessBING
();
void
read
();
void
read
();
void
write
()
const
;
void
write
()
const
;
...
...
modules/saliency/samples/computeSaliency.cpp
View file @
71e18ff0
...
@@ -62,6 +62,16 @@ static void help()
...
@@ -62,6 +62,16 @@ static void help()
<<
endl
;
<<
endl
;
}
}
inline
float
calcOverlap
(
Rect
a
,
Rect
b
)
{
Rect
rectIntersection
=
a
&
b
;
Rect
rectUnion
=
a
|
b
;
float
iArea
=
rectIntersection
.
width
*
rectIntersection
.
height
;
float
uArea
=
rectUnion
.
width
*
rectUnion
.
height
;
float
overlap
=
iArea
/
uArea
;
return
overlap
;
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
CommandLineParser
parser
(
argc
,
argv
,
keys
);
CommandLineParser
parser
(
argc
,
argv
,
keys
);
...
@@ -139,7 +149,6 @@ int main( int argc, char** argv )
...
@@ -139,7 +149,6 @@ int main( int argc, char** argv )
else
else
{
{
vector
<
Vec4i
>
saliencyMap
;
vector
<
Vec4i
>
saliencyMap
;
saliencyAlgorithm
.
dynamicCast
<
ObjectnessBING
>
()
->
setTrainingPath
(
training_path
);
saliencyAlgorithm
.
dynamicCast
<
ObjectnessBING
>
()
->
setTrainingPath
(
training_path
);
saliencyAlgorithm
.
dynamicCast
<
ObjectnessBING
>
()
->
setBBResDir
(
training_path
+
"/Results"
);
saliencyAlgorithm
.
dynamicCast
<
ObjectnessBING
>
()
->
setBBResDir
(
training_path
+
"/Results"
);
...
...
modules/saliency/src/motionSaliencyBinWangApr2014.cpp
View file @
71e18ff0
...
@@ -72,8 +72,8 @@ MotionSaliencyBinWangApr2014::MotionSaliencyBinWangApr2014()
...
@@ -72,8 +72,8 @@ MotionSaliencyBinWangApr2014::MotionSaliencyBinWangApr2014()
K
=
3
;
// Number of background model template
K
=
3
;
// Number of background model template
N
=
4
;
// NxN is the size of the block for downsampling in the lowlowResolutionDetection
N
=
4
;
// NxN is the size of the block for downsampling in the lowlowResolutionDetection
alpha
=
(
float
)
0.01
;
// Learning rate
alpha
=
(
float
)
0.01
;
// Learning rate
L0
=
3
00
;
// Upper-bound values for C0 (efficacy of the first template (matrices) of backgroundModel
L0
=
10
00
;
// Upper-bound values for C0 (efficacy of the first template (matrices) of backgroundModel
L1
=
2
00
;
// Upper-bound values for C1 (efficacy of the second template (matrices) of backgroundModel
L1
=
8
00
;
// Upper-bound values for C1 (efficacy of the second template (matrices) of backgroundModel
thetaL
=
thetaL_VAL
;
// T0, T1 swap threshold
thetaL
=
thetaL_VAL
;
// T0, T1 swap threshold
thetaA
=
thetaA_VAL
;
thetaA
=
thetaA_VAL
;
gamma
=
3
;
gamma
=
3
;
...
@@ -384,8 +384,8 @@ bool MotionSaliencyBinWangApr2014::templateReplacement( const Mat& finalBFMask,
...
@@ -384,8 +384,8 @@ bool MotionSaliencyBinWangApr2014::templateReplacement( const Mat& finalBFMask,
//if at least the first template is activated / initialized for all pixels
//if at least the first template is activated / initialized for all pixels
if
(
countNonZero
(
temp
[
1
]
)
<=
(
temp
[
1
].
cols
*
temp
[
1
].
rows
)
/
2
)
if
(
countNonZero
(
temp
[
1
]
)
<=
(
temp
[
1
].
cols
*
temp
[
1
].
rows
)
/
2
)
{
{
thetaA
=
15
;
thetaA
=
50
;
thetaL
=
4
0
;
thetaL
=
15
0
;
neighborhoodCheck
=
false
;
neighborhoodCheck
=
false
;
}
}
...
...
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