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
74c398e6
Commit
74c398e6
authored
Mar 02, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored gpu::solvePnpRansac a bit
parent
60e33921
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
calib3d.cpp
modules/gpu/src/calib3d.cpp
+6
-5
No files found.
modules/gpu/src/calib3d.cpp
View file @
74c398e6
...
...
@@ -276,23 +276,24 @@ void cv::gpu::solvePnpRansac(const Mat& object, const Mat& image, const Mat& cam
int
num_inliers
=
static_cast
<
int
>
(
best_score
);
// Extract the best hypothesis data
Mat
rot_mat
=
rot_matrices
.
colRange
(
best_idx
.
x
*
9
,
(
best_idx
.
x
+
1
)
*
9
).
reshape
(
0
,
3
);
Rodrigues
(
rot_mat
,
rvec
);
rvec
=
rvec
.
reshape
(
0
,
1
);
tvec
=
transl_vectors
.
colRange
(
best_idx
.
x
*
3
,
(
best_idx
.
x
+
1
)
*
3
).
clone
();
tvec
=
tvec
.
reshape
(
0
,
1
);
// Build vector of inlier indices
if
(
params
.
inliers
!=
NULL
)
{
params
.
inliers
->
resize
(
num_inliers
);
params
.
inliers
->
clear
();
params
.
inliers
->
reserve
(
num_inliers
);
Point3f
p
;
Point3f
p_transf
;
Point3f
p
,
p_transf
;
Point2f
p_proj
;
const
float
*
rot
=
rot_mat
.
ptr
<
float
>
();
const
float
*
transl
=
tvec
.
ptr
<
float
>
();
int
inlier_id
=
0
;
for
(
int
i
=
0
;
i
<
num_points
;
++
i
)
{
...
...
@@ -305,7 +306,7 @@ void cv::gpu::solvePnpRansac(const Mat& object, const Mat& image, const Mat& cam
p_proj
.
x
=
p_transf
.
x
/
p_transf
.
z
;
p_proj
.
y
=
p_transf
.
y
/
p_transf
.
z
;
if
(
norm
(
p_proj
-
image_normalized
.
at
<
Point2f
>
(
0
,
i
))
<
params
.
max_dist
)
(
*
params
.
inliers
)[
inlier_id
++
]
=
i
;
params
.
inliers
->
push_back
(
i
)
;
}
}
}
...
...
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