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
3481c1ca
Commit
3481c1ca
authored
Dec 06, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3488 from jeremyhu:PR-4048
parents
c5b6c045
35f96d6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
52 deletions
+46
-52
calibfilter.cpp
modules/legacy/src/calibfilter.cpp
+46
-52
No files found.
modules/legacy/src/calibfilter.cpp
View file @
3481c1ca
...
@@ -95,11 +95,8 @@ bool CvCalibFilter::SetEtalon( CvCalibEtalonType type, double* params,
...
@@ -95,11 +95,8 @@ bool CvCalibFilter::SetEtalon( CvCalibEtalonType type, double* params,
Stop
();
Stop
();
if
(
latestPoints
!=
NULL
)
for
(
i
=
0
;
i
<
MAX_CAMERAS
;
i
++
)
{
cvFree
(
latestPoints
+
i
);
for
(
i
=
0
;
i
<
MAX_CAMERAS
;
i
++
)
cvFree
(
latestPoints
+
i
);
}
if
(
type
==
CV_CALIB_ETALON_USER
||
type
!=
etalonType
)
if
(
type
==
CV_CALIB_ETALON_USER
||
type
!=
etalonType
)
{
{
...
@@ -523,64 +520,61 @@ void CvCalibFilter::DrawPoints( CvMat** dstarr )
...
@@ -523,64 +520,61 @@ void CvCalibFilter::DrawPoints( CvMat** dstarr )
return
;
return
;
}
}
if
(
latestCounts
)
for
(
i
=
0
;
i
<
cameraCount
;
i
++
)
{
{
for
(
i
=
0
;
i
<
cameraCount
;
i
++
)
if
(
dstarr
[
i
]
&&
latestCounts
[
i
]
)
{
{
if
(
dstarr
[
i
]
&&
latestCounts
[
i
]
)
CvMat
dst_stub
,
*
dst
;
{
int
count
=
0
;
CvMat
dst_stub
,
*
dst
;
bool
found
=
false
;
int
count
=
0
;
CvPoint2D32f
*
pts
=
0
;
bool
found
=
false
;
CvPoint2D32f
*
pts
=
0
;
GetLatestPoints
(
i
,
&
pts
,
&
count
,
&
found
);
GetLatestPoints
(
i
,
&
pts
,
&
count
,
&
found
);
dst
=
cvGetMat
(
dstarr
[
i
],
&
dst_stub
);
dst
=
cvGetMat
(
dstarr
[
i
],
&
dst_stub
);
static
const
CvScalar
line_colors
[]
=
static
const
CvScalar
line_colors
[]
=
{
{
{{
0
,
0
,
255
}},
{{
0
,
0
,
255
}},
{{
0
,
128
,
255
}},
{{
0
,
128
,
255
}},
{{
0
,
200
,
200
}},
{{
0
,
200
,
200
}},
{{
0
,
255
,
0
}},
{{
0
,
255
,
0
}},
{{
200
,
200
,
0
}},
{{
200
,
200
,
0
}},
{{
255
,
0
,
0
}},
{{
255
,
0
,
0
}},
{{
255
,
0
,
255
}}
{{
255
,
0
,
255
}}
};
};
const
int
colorCount
=
sizeof
(
line_colors
)
/
sizeof
(
line_colors
[
0
]);
const
int
colorCount
=
sizeof
(
line_colors
)
/
sizeof
(
line_colors
[
0
]);
const
int
r
=
4
;
const
int
r
=
4
;
CvScalar
color
=
line_colors
[
0
];
CvScalar
color
=
line_colors
[
0
];
CvPoint
prev_pt
=
{
0
,
0
};
CvPoint
prev_pt
=
{
0
,
0
};
for
(
j
=
0
;
j
<
count
;
j
++
)
for
(
j
=
0
;
j
<
count
;
j
++
)
{
{
CvPoint
pt
;
CvPoint
pt
;
pt
.
x
=
cvRound
(
pts
[
j
].
x
);
pt
.
x
=
cvRound
(
pts
[
j
].
x
);
pt
.
y
=
cvRound
(
pts
[
j
].
y
);
pt
.
y
=
cvRound
(
pts
[
j
].
y
);
if
(
found
)
if
(
found
)
{
{
if
(
etalonType
==
CV_CALIB_ETALON_CHESSBOARD
)
if
(
etalonType
==
CV_CALIB_ETALON_CHESSBOARD
)
color
=
line_colors
[(
j
/
cvRound
(
etalonParams
[
0
]))
%
colorCount
];
color
=
line_colors
[(
j
/
cvRound
(
etalonParams
[
0
]))
%
colorCount
];
else
else
color
=
CV_RGB
(
0
,
255
,
0
);
color
=
CV_RGB
(
0
,
255
,
0
);
if
(
j
!=
0
)
if
(
j
!=
0
)
cvLine
(
dst
,
prev_pt
,
pt
,
color
,
1
,
CV_AA
);
cvLine
(
dst
,
prev_pt
,
pt
,
color
,
1
,
CV_AA
);
}
}
cvLine
(
dst
,
cvPoint
(
pt
.
x
-
r
,
pt
.
y
-
r
),
cvLine
(
dst
,
cvPoint
(
pt
.
x
-
r
,
pt
.
y
-
r
),
cvPoint
(
pt
.
x
+
r
,
pt
.
y
+
r
),
color
,
1
,
CV_AA
);
cvPoint
(
pt
.
x
+
r
,
pt
.
y
+
r
),
color
,
1
,
CV_AA
);
cvLine
(
dst
,
cvPoint
(
pt
.
x
-
r
,
pt
.
y
+
r
),
cvLine
(
dst
,
cvPoint
(
pt
.
x
-
r
,
pt
.
y
+
r
),
cvPoint
(
pt
.
x
+
r
,
pt
.
y
-
r
),
color
,
1
,
CV_AA
);
cvPoint
(
pt
.
x
+
r
,
pt
.
y
-
r
),
color
,
1
,
CV_AA
);
cvCircle
(
dst
,
pt
,
r
+
1
,
color
,
1
,
CV_AA
);
cvCircle
(
dst
,
pt
,
r
+
1
,
color
,
1
,
CV_AA
);
prev_pt
=
pt
;
prev_pt
=
pt
;
}
}
}
}
}
}
}
...
...
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