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
b59df667
Commit
b59df667
authored
May 23, 2017
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8698 from cdcseacave:fix_Mat_release
parents
c3762fb2
2c2b1405
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
5 deletions
+23
-5
mat.hpp
modules/core/include/opencv2/core/mat.hpp
+5
-3
mat.inl.hpp
modules/core/include/opencv2/core/mat.inl.hpp
+9
-0
test_mat.cpp
modules/core/test/test_mat.cpp
+9
-2
No files found.
modules/core/include/opencv2/core/mat.hpp
View file @
b59df667
...
...
@@ -2185,6 +2185,8 @@ public:
void
create
(
Size
_size
);
//! equivalent to Mat::create(_ndims, _sizes, DatType<_Tp>::type)
void
create
(
int
_ndims
,
const
int
*
_sizes
);
//! equivalent to Mat::release()
void
release
();
//! cross-product
Mat_
cross
(
const
Mat_
&
m
)
const
;
//! data type conversion
...
...
@@ -2676,11 +2678,11 @@ public:
/*!
@param [out] m - output matrix; if it does not have a proper size or type before the operation,
it is reallocated
@param [in] rtype
–
desired output matrix type or, rather, the depth since the number of channels
@param [in] rtype
-
desired output matrix type or, rather, the depth since the number of channels
are the same as the input has; if rtype is negative, the output matrix will have the
same type as the input.
@param [in] alpha
–
optional scale factor
@param [in] beta
–
optional delta added to the scaled values
@param [in] alpha
-
optional scale factor
@param [in] beta
-
optional delta added to the scaled values
*/
void
convertTo
(
Mat
&
m
,
int
rtype
,
double
alpha
=
1
,
double
beta
=
0
)
const
;
...
...
modules/core/include/opencv2/core/mat.inl.hpp
View file @
b59df667
...
...
@@ -1625,6 +1625,15 @@ void Mat_<_Tp>::create(int _dims, const int* _sz)
Mat
::
create
(
_dims
,
_sz
,
DataType
<
_Tp
>::
type
);
}
template
<
typename
_Tp
>
inline
void
Mat_
<
_Tp
>::
release
()
{
Mat
::
release
();
#ifdef _DEBUG
flags
=
(
flags
&
~
CV_MAT_TYPE_MASK
)
|
DataType
<
_Tp
>::
type
;
#endif
}
template
<
typename
_Tp
>
inline
Mat_
<
_Tp
>
Mat_
<
_Tp
>::
cross
(
const
Mat_
&
m
)
const
{
...
...
modules/core/test/test_mat.cpp
View file @
b59df667
...
...
@@ -1725,4 +1725,12 @@ TEST(Core_Mat_array, SplitMerge)
EXPECT_EQ
(
0
,
countNonZero
(
diff
));
}
}
#endif
\ No newline at end of file
#endif
TEST
(
Mat
,
regression_8680
)
{
Mat_
<
Point2i
>
mat
(
3
,
1
);
ASSERT_EQ
(
mat
.
channels
(),
2
);
mat
.
release
();
ASSERT_EQ
(
mat
.
channels
(),
2
);
}
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