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
5f9e295a
Commit
5f9e295a
authored
May 16, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test and workaround for #1942
parent
a877ecdc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
matrix.cpp
modules/core/src/matrix.cpp
+9
-1
test_mat.cpp
modules/core/test/test_mat.cpp
+12
-0
No files found.
modules/core/src/matrix.cpp
View file @
5f9e295a
...
@@ -2897,8 +2897,16 @@ cvKMeans2( const CvArr* _samples, int cluster_count, CvArr* _labels,
...
@@ -2897,8 +2897,16 @@ cvKMeans2( const CvArr* _samples, int cluster_count, CvArr* _labels,
namespace
cv
namespace
cv
{
{
Mat
Mat
::
reshape
(
int
,
int
,
const
int
*
)
const
Mat
Mat
::
reshape
(
int
_cn
,
int
_newndims
,
const
int
*
_newsz
)
const
{
{
if
(
_newndims
==
dims
)
{
if
(
_newsz
==
0
)
return
reshape
(
_cn
);
if
(
_newndims
==
2
)
return
reshape
(
_cn
,
_newsz
[
0
]);
}
CV_Error
(
CV_StsNotImplemented
,
""
);
CV_Error
(
CV_StsNotImplemented
,
""
);
// TBD
// TBD
return
Mat
();
return
Mat
();
...
...
modules/core/test/test_mat.cpp
View file @
5f9e295a
...
@@ -861,3 +861,14 @@ TEST(Core_IOArray, submat_create)
...
@@ -861,3 +861,14 @@ TEST(Core_IOArray, submat_create)
EXPECT_THROW
(
OutputArray_create1
(
A
.
row
(
0
)),
cv
::
Exception
);
EXPECT_THROW
(
OutputArray_create1
(
A
.
row
(
0
)),
cv
::
Exception
);
EXPECT_THROW
(
OutputArray_create2
(
A
.
row
(
0
)),
cv
::
Exception
);
EXPECT_THROW
(
OutputArray_create2
(
A
.
row
(
0
)),
cv
::
Exception
);
}
}
TEST
(
Core_Mat
,
reshape_1942
)
{
cv
::
Mat
A
=
(
cv
::
Mat_
<
float
>
(
2
,
3
)
<<
3.4884074
,
1.4159607
,
0.78737736
,
2.3456569
,
-
0.88010466
,
0.3009364
);
int
cn
=
0
;
ASSERT_NO_THROW
(
cv
::
Mat_
<
float
>
M
=
A
.
reshape
(
3
);
cn
=
M
.
channels
();
);
ASSERT_EQ
(
1
,
cn
);
}
\ No newline at end of file
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