Skip to content

Commit 87ed086

Browse files
authored
Merge pull request #70 from JuliaRobotics/fix/drawaxis
fix drawTagAxis! and swop cx,cy to close #66
2 parents 68cdf0c + 6aa0296 commit 87ed086

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/tagdraw.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function drawTagAxes!(image::AbstractArray{<:AbstractRGB,2},
102102
K::AbstractArray{<:Real,2} )
103103
#
104104
Kp = [K [0;0]; 0.0 0.0 1.0 0.0]
105-
pose = AprilTags.homography_to_pose(tag.H, K[1,1], K[2,2], K[1,3], K[2,3])
105+
pose = AprilTags.homographytopose(tag.H, Kp[1,1], Kp[2,2], Kp[1,3], Kp[2,3])
106106

107107
# calculate and project
108108
p0 = Kp*pose[:,4]

test/basictests.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ using Test
125125
#test drawing functions
126126
fx = 524.040
127127
fy = 524.040
128-
cy = 319.254
129-
cx = 251.227
128+
cx = 319.254
129+
cy = 251.227
130130
K = [fx 0 cx;
131131
0 fy cy]
132132
imCol = RGB.(image)
@@ -208,14 +208,14 @@ using Test
208208
detector.quad_decimate = 1.0 #NOTE see line 84
209209
fx = 524.040
210210
fy = 524.040
211-
cx = 251.227
212-
cy = 319.254
211+
cx = 319.254
212+
cy = 251.227
213213
taglength = 0.172
214214
(tags, poses) = detectAndPose(detector, image, fx, fy, cx, cy, taglength)
215-
# TODO test here
216-
@test all(isapprox.(poses[1], [ 0.657276 -0.43653 0.614354 -0.236778;
217-
0.180276 0.882573 0.434242 0.268374;
218-
-0.731771 -0.174663 0.65879 1.65107],
215+
# TODO test here, this is just result used as test.
216+
@test all(isapprox.(poses[1], [ 0.630532 -0.391638 0.670111 -0.461887;
217+
0.118082 0.901717 0.415889 0.494238;
218+
-0.767128 -0.183103 0.614807 1.69053],
219219
atol = 0.01))
220220
freeDetector!(detector)
221221

0 commit comments

Comments
 (0)