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
bedd1f76
Commit
bedd1f76
authored
Nov 18, 2016
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace a dummy pointer with the smart in ERStat
parent
f3ca1a2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
erfilter.hpp
modules/text/include/opencv2/text/erfilter.hpp
+1
-1
erfilter.cpp
modules/text/src/erfilter.cpp
+4
-10
No files found.
modules/text/include/opencv2/text/erfilter.hpp
View file @
bedd1f76
...
...
@@ -82,7 +82,7 @@ public:
Rect
rect
;
double
raw_moments
[
2
];
//!< order 1 raw moments to derive the centroid
double
central_moments
[
3
];
//!< order 2 central moments to construct the covariance matrix
std
::
deque
<
int
>
*
crossings
;
//!< horizontal crossings
Ptr
<
std
::
deque
<
int
>
>
crossings
;
//!< horizontal crossings
float
med_crossings
;
//!< median of the crossings at three different height levels
//! 2nd stage features
...
...
modules/text/src/erfilter.cpp
View file @
bedd1f76
...
...
@@ -97,7 +97,7 @@ ERStat::ERStat(int init_level, int init_pixel, int init_x, int init_y) : pixel(i
central_moments
[
0
]
=
0.0
;
central_moments
[
1
]
=
0.0
;
central_moments
[
2
]
=
0.0
;
crossings
=
new
deque
<
int
>
();
crossings
=
makePtr
<
deque
<
int
>
>
();
crossings
->
push_back
(
0
);
}
...
...
@@ -526,9 +526,7 @@ void ERFilterNM::er_tree_extract( InputArray image )
ERStat
*
stat
=
er_stack
.
at
(
r
);
if
(
stat
->
crossings
)
{
stat
->
crossings
->
clear
();
delete
(
stat
->
crossings
);
stat
->
crossings
=
NULL
;
stat
->
crossings
.
release
();
}
deleteERStatTree
(
stat
);
}
...
...
@@ -665,9 +663,7 @@ void ERFilterNM::er_merge(ERStat *parent, ERStat *child)
child
->
med_crossings
=
(
float
)
m_crossings
.
at
(
1
);
// free unnecessary mem
child
->
crossings
->
clear
();
delete
(
child
->
crossings
);
child
->
crossings
=
NULL
;
child
->
crossings
.
release
();
// recover the original grey-level
child
->
level
=
child
->
level
*
thresholdDelta
;
...
...
@@ -714,9 +710,7 @@ void ERFilterNM::er_merge(ERStat *parent, ERStat *child)
// free mem
if
(
child
->
crossings
)
{
child
->
crossings
->
clear
();
delete
(
child
->
crossings
);
child
->
crossings
=
NULL
;
child
->
crossings
.
release
();
}
delete
(
child
);
}
...
...
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