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
c2241dcc
Commit
c2241dcc
authored
Jan 20, 2013
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converted fitline to C++, fixed Mat::checkVector().
parent
c197a46e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
24 deletions
+2
-24
matrix.cpp
modules/core/src/matrix.cpp
+1
-1
contours.cpp
modules/imgproc/src/contours.cpp
+0
-22
convhull.cpp
modules/imgproc/src/convhull.cpp
+1
-1
linefit.cpp
modules/imgproc/src/linefit.cpp
+0
-0
No files found.
modules/core/src/matrix.cpp
View file @
c2241dcc
...
...
@@ -841,7 +841,7 @@ int Mat::checkVector(int _elemChannels, int _depth, bool _requireContinuous) con
{
return
(
depth
()
==
_depth
||
_depth
<=
0
)
&&
(
isContinuous
()
||
!
_requireContinuous
)
&&
((
dims
==
2
&&
(((
rows
==
1
||
cols
==
1
)
&&
channels
()
==
_elemChannels
)
||
(
cols
==
_elemChannels
)))
||
((
dims
==
2
&&
(((
rows
==
1
||
cols
==
1
)
&&
channels
()
==
_elemChannels
)
||
(
cols
==
_elemChannels
&&
channels
()
==
1
)))
||
(
dims
==
3
&&
channels
()
==
1
&&
size
.
p
[
2
]
==
_elemChannels
&&
(
size
.
p
[
0
]
==
1
||
size
.
p
[
1
]
==
1
)
&&
(
isContinuous
()
||
step
.
p
[
1
]
==
step
.
p
[
2
]
*
size
.
p
[
2
])))
?
(
int
)(
total
()
*
channels
()
/
_elemChannels
)
:
-
1
;
...
...
modules/imgproc/src/contours.cpp
View file @
c2241dcc
...
...
@@ -1824,28 +1824,6 @@ cv::RotatedRect cv::fitEllipse( InputArray _points )
}
void
cv
::
fitLine
(
InputArray
_points
,
OutputArray
_line
,
int
distType
,
double
param
,
double
reps
,
double
aeps
)
{
Mat
points
=
_points
.
getMat
();
bool
is3d
=
points
.
checkVector
(
3
)
>=
0
;
bool
is2d
=
points
.
checkVector
(
2
)
>=
0
;
CV_Assert
(
(
is2d
||
is3d
)
&&
(
points
.
depth
()
==
CV_32F
||
points
.
depth
()
==
CV_32S
)
);
CvMat
_cpoints
=
points
.
reshape
(
2
+
(
int
)
is3d
);
float
line
[
6
];
cvFitLine
(
&
_cpoints
,
distType
,
param
,
reps
,
aeps
,
&
line
[
0
]);
int
out_size
=
(
is2d
)
?
(
(
is3d
)
?
(
points
.
channels
()
*
points
.
rows
*
2
)
:
4
)
:
6
;
_line
.
create
(
out_size
,
1
,
CV_32F
,
-
1
,
true
);
Mat
l
=
_line
.
getMat
();
CV_Assert
(
l
.
isContinuous
()
);
memcpy
(
l
.
data
,
line
,
out_size
*
sizeof
(
line
[
0
])
);
}
double
cv
::
pointPolygonTest
(
InputArray
_contour
,
Point2f
pt
,
bool
measureDist
)
{
...
...
modules/imgproc/src/convhull.cpp
View file @
c2241dcc
...
...
@@ -584,7 +584,7 @@ void convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool ret
void
convexityDefects
(
InputArray
_points
,
InputArray
_hull
,
OutputArray
_defects
)
{
Mat
points
=
_points
.
getMat
();
int
i
,
j
=
0
,
index
,
npoints
=
points
.
checkVector
(
2
,
CV_32S
);
int
i
,
j
=
0
,
npoints
=
points
.
checkVector
(
2
,
CV_32S
);
CV_Assert
(
npoints
>=
0
);
if
(
npoints
<=
3
)
...
...
modules/imgproc/src/linefit.cpp
View file @
c2241dcc
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