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
777eaa73
Commit
777eaa73
authored
Nov 07, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13057 from sturkmen72:Mat_to_IOArray
parents
bb61a254
182f43b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
18 deletions
+17
-18
imgproc.hpp
modules/imgproc/include/opencv2/imgproc.hpp
+3
-3
drawing.cpp
modules/imgproc/src/drawing.cpp
+14
-15
No files found.
modules/imgproc/include/opencv2/imgproc.hpp
View file @
777eaa73
...
@@ -4378,7 +4378,7 @@ CV_EXPORTS_W void drawMarker(InputOutputArray img, Point position, const Scalar&
...
@@ -4378,7 +4378,7 @@ CV_EXPORTS_W void drawMarker(InputOutputArray img, Point position, const Scalar&
/* ----------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------- */
/** @overload */
/** @overload */
CV_EXPORTS
void
fillConvexPoly
(
Mat
&
img
,
const
Point
*
pts
,
int
npts
,
CV_EXPORTS
void
fillConvexPoly
(
InputOutputArray
img
,
const
Point
*
pts
,
int
npts
,
const
Scalar
&
color
,
int
lineType
=
LINE_8
,
const
Scalar
&
color
,
int
lineType
=
LINE_8
,
int
shift
=
0
);
int
shift
=
0
);
...
@@ -4400,7 +4400,7 @@ CV_EXPORTS_W void fillConvexPoly(InputOutputArray img, InputArray points,
...
@@ -4400,7 +4400,7 @@ CV_EXPORTS_W void fillConvexPoly(InputOutputArray img, InputArray points,
int
shift
=
0
);
int
shift
=
0
);
/** @overload */
/** @overload */
CV_EXPORTS
void
fillPoly
(
Mat
&
img
,
const
Point
**
pts
,
CV_EXPORTS
void
fillPoly
(
InputOutputArray
img
,
const
Point
**
pts
,
const
int
*
npts
,
int
ncontours
,
const
int
*
npts
,
int
ncontours
,
const
Scalar
&
color
,
int
lineType
=
LINE_8
,
int
shift
=
0
,
const
Scalar
&
color
,
int
lineType
=
LINE_8
,
int
shift
=
0
,
Point
offset
=
Point
()
);
Point
offset
=
Point
()
);
...
@@ -4428,7 +4428,7 @@ CV_EXPORTS_W void fillPoly(InputOutputArray img, InputArrayOfArrays pts,
...
@@ -4428,7 +4428,7 @@ CV_EXPORTS_W void fillPoly(InputOutputArray img, InputArrayOfArrays pts,
Point
offset
=
Point
()
);
Point
offset
=
Point
()
);
/** @overload */
/** @overload */
CV_EXPORTS
void
polylines
(
Mat
&
img
,
const
Point
*
const
*
pts
,
const
int
*
npts
,
CV_EXPORTS
void
polylines
(
InputOutputArray
img
,
const
Point
*
const
*
pts
,
const
int
*
npts
,
int
ncontours
,
bool
isClosed
,
const
Scalar
&
color
,
int
ncontours
,
bool
isClosed
,
const
Scalar
&
color
,
int
thickness
=
1
,
int
lineType
=
LINE_8
,
int
shift
=
0
);
int
thickness
=
1
,
int
lineType
=
LINE_8
,
int
shift
=
0
);
...
...
modules/imgproc/src/drawing.cpp
View file @
777eaa73
...
@@ -1971,11 +1971,13 @@ void ellipse(InputOutputArray _img, const RotatedRect& box, const Scalar& color,
...
@@ -1971,11 +1971,13 @@ void ellipse(InputOutputArray _img, const RotatedRect& box, const Scalar& color,
EllipseEx
(
img
,
center
,
axes
,
_angle
,
0
,
360
,
buf
,
thickness
,
lineType
);
EllipseEx
(
img
,
center
,
axes
,
_angle
,
0
,
360
,
buf
,
thickness
,
lineType
);
}
}
void
fillConvexPoly
(
Mat
&
img
,
const
Point
*
pts
,
int
npts
,
void
fillConvexPoly
(
InputOutputArray
_
img
,
const
Point
*
pts
,
int
npts
,
const
Scalar
&
color
,
int
line_type
,
int
shift
)
const
Scalar
&
color
,
int
line_type
,
int
shift
)
{
{
CV_INSTRUMENT_REGION
();
CV_INSTRUMENT_REGION
();
Mat
img
=
_img
.
getMat
();
if
(
!
pts
||
npts
<=
0
)
if
(
!
pts
||
npts
<=
0
)
return
;
return
;
...
@@ -1989,13 +1991,14 @@ void fillConvexPoly( Mat& img, const Point* pts, int npts,
...
@@ -1989,13 +1991,14 @@ void fillConvexPoly( Mat& img, const Point* pts, int npts,
FillConvexPoly
(
img
,
_pts
.
data
(),
npts
,
buf
,
line_type
,
shift
);
FillConvexPoly
(
img
,
_pts
.
data
(),
npts
,
buf
,
line_type
,
shift
);
}
}
void
fillPoly
(
InputOutputArray
_img
,
const
Point
**
pts
,
const
int
*
npts
,
int
ncontours
,
void
fillPoly
(
Mat
&
img
,
const
Point
**
pts
,
const
int
*
npts
,
int
ncontours
,
const
Scalar
&
color
,
int
line_type
,
const
Scalar
&
color
,
int
line_type
,
int
shift
,
Point
offset
)
int
shift
,
Point
offset
)
{
{
CV_INSTRUMENT_REGION
();
CV_INSTRUMENT_REGION
();
Mat
img
=
_img
.
getMat
();
if
(
line_type
==
CV_AA
&&
img
.
depth
()
!=
CV_8U
)
if
(
line_type
==
CV_AA
&&
img
.
depth
()
!=
CV_8U
)
line_type
=
8
;
line_type
=
8
;
...
@@ -2020,12 +2023,13 @@ void fillPoly( Mat& img, const Point** pts, const int* npts, int ncontours,
...
@@ -2020,12 +2023,13 @@ void fillPoly( Mat& img, const Point** pts, const int* npts, int ncontours,
FillEdgeCollection
(
img
,
edges
,
buf
);
FillEdgeCollection
(
img
,
edges
,
buf
);
}
}
void
polylines
(
InputOutputArray
_img
,
const
Point
*
const
*
pts
,
const
int
*
npts
,
int
ncontours
,
bool
isClosed
,
void
polylines
(
Mat
&
img
,
const
Point
*
const
*
pts
,
const
int
*
npts
,
int
ncontours
,
bool
isClosed
,
const
Scalar
&
color
,
int
thickness
,
int
line_type
,
int
shift
)
const
Scalar
&
color
,
int
thickness
,
int
line_type
,
int
shift
)
{
{
CV_INSTRUMENT_REGION
();
CV_INSTRUMENT_REGION
();
Mat
img
=
_img
.
getMat
();
if
(
line_type
==
CV_AA
&&
img
.
depth
()
!=
CV_8U
)
if
(
line_type
==
CV_AA
&&
img
.
depth
()
!=
CV_8U
)
line_type
=
8
;
line_type
=
8
;
...
@@ -2370,24 +2374,21 @@ double getFontScaleFromHeight(const int fontFace, const int pixelHeight, const i
...
@@ -2370,24 +2374,21 @@ double getFontScaleFromHeight(const int fontFace, const int pixelHeight, const i
}
}
void
cv
::
fillConvexPoly
(
InputOutputArray
img
,
InputArray
_points
,
void
cv
::
fillConvexPoly
(
InputOutputArray
_img
,
InputArray
_points
,
const
Scalar
&
color
,
int
lineType
,
int
shift
)
const
Scalar
&
color
,
int
lineType
,
int
shift
)
{
{
CV_INSTRUMENT_REGION
();
CV_INSTRUMENT_REGION
();
Mat
img
=
_img
.
getMat
(),
points
=
_points
.
getMat
();
Mat
points
=
_points
.
getMat
();
CV_Assert
(
points
.
checkVector
(
2
,
CV_32S
)
>=
0
);
CV_Assert
(
points
.
checkVector
(
2
,
CV_32S
)
>=
0
);
fillConvexPoly
(
img
,
points
.
ptr
<
Point
>
(),
points
.
rows
*
points
.
cols
*
points
.
channels
()
/
2
,
color
,
lineType
,
shift
);
fillConvexPoly
(
img
,
points
.
ptr
<
Point
>
(),
points
.
rows
*
points
.
cols
*
points
.
channels
()
/
2
,
color
,
lineType
,
shift
);
}
}
void
cv
::
fillPoly
(
InputOutputArray
img
,
InputArrayOfArrays
pts
,
void
cv
::
fillPoly
(
InputOutputArray
_img
,
InputArrayOfArrays
pts
,
const
Scalar
&
color
,
int
lineType
,
int
shift
,
Point
offset
)
const
Scalar
&
color
,
int
lineType
,
int
shift
,
Point
offset
)
{
{
CV_INSTRUMENT_REGION
();
CV_INSTRUMENT_REGION
();
Mat
img
=
_img
.
getMat
();
int
i
,
ncontours
=
(
int
)
pts
.
total
();
int
i
,
ncontours
=
(
int
)
pts
.
total
();
if
(
ncontours
==
0
)
if
(
ncontours
==
0
)
return
;
return
;
...
@@ -2406,14 +2407,12 @@ void cv::fillPoly(InputOutputArray _img, InputArrayOfArrays pts,
...
@@ -2406,14 +2407,12 @@ void cv::fillPoly(InputOutputArray _img, InputArrayOfArrays pts,
fillPoly
(
img
,
(
const
Point
**
)
ptsptr
,
npts
,
(
int
)
ncontours
,
color
,
lineType
,
shift
,
offset
);
fillPoly
(
img
,
(
const
Point
**
)
ptsptr
,
npts
,
(
int
)
ncontours
,
color
,
lineType
,
shift
,
offset
);
}
}
void
cv
::
polylines
(
InputOutputArray
img
,
InputArrayOfArrays
pts
,
void
cv
::
polylines
(
InputOutputArray
_img
,
InputArrayOfArrays
pts
,
bool
isClosed
,
const
Scalar
&
color
,
bool
isClosed
,
const
Scalar
&
color
,
int
thickness
,
int
lineType
,
int
shift
)
int
thickness
,
int
lineType
,
int
shift
)
{
{
CV_INSTRUMENT_REGION
();
CV_INSTRUMENT_REGION
();
Mat
img
=
_img
.
getMat
();
bool
manyContours
=
pts
.
kind
()
==
_InputArray
::
STD_VECTOR_VECTOR
||
bool
manyContours
=
pts
.
kind
()
==
_InputArray
::
STD_VECTOR_VECTOR
||
pts
.
kind
()
==
_InputArray
::
STD_VECTOR_MAT
;
pts
.
kind
()
==
_InputArray
::
STD_VECTOR_MAT
;
int
i
,
ncontours
=
manyContours
?
(
int
)
pts
.
total
()
:
1
;
int
i
,
ncontours
=
manyContours
?
(
int
)
pts
.
total
()
:
1
;
...
...
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