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
b2f4affb
Commit
b2f4affb
authored
Aug 04, 2014
by
jaco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
templateReplacement function completed
parent
9a196a9c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
saliencySpecializedClasses.hpp
...y/include/opencv2/saliency/saliencySpecializedClasses.hpp
+1
-1
computeSaliency.cpp
modules/saliency/samples/computeSaliency.cpp
+21
-17
motionSaliencyBinWangApr2014.cpp
modules/saliency/src/motionSaliencyBinWangApr2014.cpp
+0
-0
No files found.
modules/saliency/include/opencv2/saliency/saliencySpecializedClasses.hpp
View file @
b2f4affb
...
...
@@ -120,7 +120,7 @@ class CV_EXPORTS_W MotionSaliencyBinWangApr2014 : public MotionSaliency
// Background model maintenance functions
bool
templateOrdering
();
bool
templateReplacement
(
Mat
finalBFMask
,
Mat
image
);
bool
templateReplacement
(
const
Mat
&
finalBFMask
,
const
Mat
&
image
);
// Decision threshold adaptation and Activity control function
//bool activityControl(vector<Mat> noisePixelMask);
...
...
modules/saliency/samples/computeSaliency.cpp
View file @
b2f4affb
...
...
@@ -156,29 +156,33 @@ int main( int argc, char** argv )
}
else
if
(
saliency_algorithm
.
find
(
"BinWangApr2014"
)
==
0
)
{
Ptr
<
Size
>
size
=
Ptr
<
Size
>
(
new
Size
(
32
,
32
)
)
;
saliencyAlgorithm
.
dynamicCast
<
MotionSaliencyBinWangApr2014
>
()
->
setWsize
(
size
);
// TODO INSERT CAPTURE CICLE FOR MOTION
//int testSize = 34;
//Ptr<Size> size = Ptr<Size>( new Size( testSize, testSize ) );
Ptr
<
Size
>
size
=
Ptr
<
Size
>
(
new
Size
(
image
.
cols
,
image
.
rows
)
);
saliencyAlgorithm
.
dynamicCast
<
MotionSaliencyBinWangApr2014
>
()
->
setWsize
(
size
);
saliencyAlgorithm
.
dynamicCast
<
MotionSaliencyBinWangApr2014
>
()
->
init
();
// Create an fake image test
Mat
test
(
32
,
32
,
CV_8U
);
RNG
rand
;
for
(
int
i
=
0
;
i
<
test
.
rows
;
i
++
)
for
(
int
j
=
0
;
j
<
test
.
cols
;
j
++
)
{
if
(
i
<
12
&&
i
>=
6
&&
j
<
12
&&
j
>=
6
)
test
.
at
<
uchar
>
(
i
,
j
)
=
255
;
else
test
.
at
<
uchar
>
(
i
,
j
)
=
rand
.
uniform
(
40
,
60
);
}
/* // Create an fake image test
Mat test( testSize, testSize, CV_8U );
RNG rand;
for ( int i = 0; i < test.rows; i++ )
{
for ( int j = 0; j < test.cols; j++ )
{
if( i < 6 && i >= 0 && j < 34 && j >= 28 )
test.at<uchar>( i, j ) = 255;
else
test.at<uchar>( i, j ) = rand.uniform( 40, 60 );
}
} */
//imshow("Test", test);
//waitKey(0);
Mat
saliencyMap
;
if
(
saliencyAlgorithm
->
computeSaliency
(
test
,
saliencyMap
)
)
if
(
saliencyAlgorithm
->
computeSaliency
(
image
/*test*/
,
saliencyMap
)
)
{
std
::
cout
<<
"motion saliency done"
<<
std
::
endl
;
std
::
cout
<<
"motion saliency done"
<<
std
::
endl
;
}
}
...
...
modules/saliency/src/motionSaliencyBinWangApr2014.cpp
View file @
b2f4affb
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