JuliaRobotics / AprilTags.jl
Showing 4 of 90 files from the diff.
Other files ignored by Codecov
docs/src/index.md has changed.
.gitignore has changed.
.codecov.yml was deleted.
.travis.yml has changed.
deps/build.jl was deleted.
test/runtests.jl has changed.
Project.toml has changed.
appveyor.yml was deleted.

@@ -102,7 +102,7 @@
Loading
102 102
                      K::AbstractArray{<:Real,2} )
103 103
    #
104 104
    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])
106 106
107 107
    # calculate and project
108 108
    p0 = Kp*pose[:,4]

@@ -1,16 +1,7 @@
Loading
1 -
__precompile__()
2 1
module AprilTags
3 2
3 +
using AprilTags_jll
4 4
using Requires
5 -
6 -
function __init__()
7 -
    depfile = joinpath(dirname(@__FILE__),"../deps/loadpath.jl")
8 -
    isfile(depfile) ? include(depfile) : error("AprilTags.jl not properly installed. Please run: Pkg.build(\"AprilTags\")")
9 -
10 -
    # conditional requirement
11 -
    @require FreeTypeAbstraction="663a7486-cb36-511b-a19d-713bb74d65c9" include("tagtext.jl")
12 -
end
13 -
14 5
using DocStringExtensions
15 6
using LinearAlgebra, Statistics
16 7
using Colors, ImageDraw, FixedPointNumbers
@@ -49,4 +40,9 @@
Loading
49 40
include("additionalutils.jl")
50 41
include("calibrationutils.jl")
51 42
43 +
function __init__()
44 +
    # conditional requirement
45 +
    @require FreeTypeAbstraction="663a7486-cb36-511b-a19d-713bb74d65c9" include("tagtext.jl")
46 +
end
47 +
52 48
end # module

@@ -102,7 +102,7 @@
Loading
102 102
    apriltag_detector_add_family(td, tf)
103 103
104 104
    #Register finalizer and return detector
105 -
    return finalizer(freeDetector!, AprilTagDetector(td,tf))
105 +
    return finalizer(d->freeDetector!(d, false), AprilTagDetector(td,tf))
106 106
end
107 107
108 108
const U8Types = Union{UInt8, N0f8, Gray{N0f8}}

@@ -314,7 +314,7 @@
Loading
314 314
Create a AprilTag family object for tag36h11 with all fields set to default value.
315 315
"""
316 316
function tag36h11_create()
317 -
    ccall((:tag36h11_create, :libapriltag), Ptr{apriltag_family_t}, ())
317 +
    ccall((:tag36h11_create, libapriltag), Ptr{apriltag_family_t}, ())
318 318
end
319 319
320 320
"""
@@ -322,41 +322,41 @@
Loading
322 322
Destroy the AprilTag family object.
323 323
"""
324 324
function tag36h11_destroy(tf)
325 -
    ccall((:tag36h11_destroy, :libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
325 +
    ccall((:tag36h11_destroy, libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
326 326
end
327 327
328 328
#NOTE Not in apriltag 3
329 329
# function tag36h10_create()
330 -
#     ccall((:tag36h10_create, :libapriltag), Ptr{apriltag_family_t}, ())
330 +
#     ccall((:tag36h10_create, libapriltag), Ptr{apriltag_family_t}, ())
331 331
# end
332 332
#
333 333
# function tag36h10_destroy(tf)
334 -
#     ccall((:tag36h10_destroy, :libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
334 +
#     ccall((:tag36h10_destroy, libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
335 335
# end
336 336
337 337
function tag25h9_create()
338 -
    ccall((:tag25h9_create, :libapriltag), Ptr{apriltag_family_t}, ())
338 +
    ccall((:tag25h9_create, libapriltag), Ptr{apriltag_family_t}, ())
339 339
end
340 340
341 341
function tag25h9_destroy(tf)
342 -
    ccall((:tag25h9_destroy, :libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
342 +
    ccall((:tag25h9_destroy, libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
343 343
end
344 344
345 345
#NOTE Not in apriltag 3
346 346
# function tag25h7_create()
347 -
#     ccall((:tag25h7_create, :libapriltag), Ptr{apriltag_family_t}, ())
347 +
#     ccall((:tag25h7_create, libapriltag), Ptr{apriltag_family_t}, ())
348 348
# end
349 349
350 350
# function tag25h7_destroy(tf)
351 -
#     ccall((:tag25h7_destroy, :libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
351 +
#     ccall((:tag25h7_destroy, libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
352 352
# end
353 353
354 354
function tag16h5_create()
355 -
    ccall((:tag16h5_create, :libapriltag), Ptr{apriltag_family_t}, ())
355 +
    ccall((:tag16h5_create, libapriltag), Ptr{apriltag_family_t}, ())
356 356
end
357 357
358 358
function tag16h5_destroy(tf)
359 -
    ccall((:tag16h5_destroy, :libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
359 +
    ccall((:tag16h5_destroy, libapriltag), Nothing, (Ptr{apriltag_family_t},), tf)
360 360
end
361 361
362 362
"""
@@ -364,12 +364,12 @@
Loading
364 364
Create a AprilTag Detector object with all fields set to default value.
365 365
"""
366 366
function apriltag_detector_create()
367 -
    ccall((:apriltag_detector_create, :libapriltag), Ptr{apriltag_detector_t}, ())
367 +
    ccall((:apriltag_detector_create, libapriltag), Ptr{apriltag_detector_t}, ())
368 368
end
369 369
370 370
371 371
function apriltag_detector_add_family_bits(td, fam, bits_corrected::Cint)
372 -
    ccall((:apriltag_detector_add_family_bits, :libapriltag), Nothing, (Ptr{apriltag_detector_t}, Ptr{apriltag_family_t}, Cint), td, fam, bits_corrected)
372 +
    ccall((:apriltag_detector_add_family_bits, libapriltag), Nothing, (Ptr{apriltag_detector_t}, Ptr{apriltag_family_t}, Cint), td, fam, bits_corrected)
373 373
end
374 374
375 375
"""
@@ -378,20 +378,20 @@
Loading
378 378
The caller still "owns" the family and a single instance should only be provided to one apriltag detector instance.
379 379
"""
380 380
function apriltag_detector_add_family(td, fam)
381 -
    # ccall((:apriltag_detector_add_family, :libapriltag), Nothing, (Ptr{apriltag_detector_t}, Ptr{apriltag_family_t}), td, fam)
381 +
    # ccall((:apriltag_detector_add_family, libapriltag), Nothing, (Ptr{apriltag_detector_t}, Ptr{apriltag_family_t}), td, fam)
382 382
    apriltag_detector_add_family_bits(td, fam, Int32(2))
383 383
end
384 384
385 385
function apriltag_detector_remove_family(td, fam)
386 -
    ccall((:apriltag_detector_remove_family, :libapriltag), Nothing, (Ptr{apriltag_detector_t}, Ptr{apriltag_family_t}), td, fam)
386 +
    ccall((:apriltag_detector_remove_family, libapriltag), Nothing, (Ptr{apriltag_detector_t}, Ptr{apriltag_family_t}), td, fam)
387 387
end
388 388
389 389
function apriltag_detector_clear_families(td)
390 -
    ccall((:apriltag_detector_clear_families, :libapriltag), Nothing, (Ptr{apriltag_detector_t},), td)
390 +
    ccall((:apriltag_detector_clear_families, libapriltag), Nothing, (Ptr{apriltag_detector_t},), td)
391 391
end
392 392
393 393
function apriltag_detector_destroy(td)
394 -
    ccall((:apriltag_detector_destroy, :libapriltag), Nothing, (Ptr{apriltag_detector_t},), td)
394 +
    ccall((:apriltag_detector_destroy, libapriltag), Nothing, (Ptr{apriltag_detector_t},), td)
395 395
end
396 396
397 397
"""
@@ -401,7 +401,7 @@
Loading
401 401
detection_destroy and zarray_destroy yourself.
402 402
"""
403 403
function apriltag_detector_detect(td, im_orig)
404 -
    ccall((:apriltag_detector_detect, :libapriltag), Ptr{zarray_t}, (Ptr{apriltag_detector_t}, Ptr{image_u8_t}), td, Ref(im_orig))
404 +
    ccall((:apriltag_detector_detect, libapriltag), Ptr{zarray_t}, (Ptr{apriltag_detector_t}, Ptr{image_u8_t}), td, Ref(im_orig))
405 405
end
406 406
407 407
"""
@@ -412,20 +412,20 @@
Loading
412 412
detection_destroy and zarray_destroy yourself.
413 413
"""
414 414
function threadcall_apriltag_detector_detect(td, im_orig)
415 -
    @threadcall((:apriltag_detector_detect, :libapriltag), Ptr{zarray_t}, (Ptr{apriltag_detector_t}, Ptr{image_u8_t}), td, Ref(im_orig))
415 +
    @threadcall((:apriltag_detector_detect, libapriltag), Ptr{zarray_t}, (Ptr{apriltag_detector_t}, Ptr{image_u8_t}), td, Ref(im_orig))
416 416
end
417 417
418 418
419 419
function apriltag_detection_destroy(det)
420 -
    ccall((:apriltag_detection_destroy, :libapriltag), Nothing, (Ptr{apriltag_detection_t},), det)
420 +
    ccall((:apriltag_detection_destroy, libapriltag), Nothing, (Ptr{apriltag_detection_t},), det)
421 421
end
422 422
423 423
function apriltag_detections_destroy(detections)
424 -
    ccall((:apriltag_detections_destroy, :libapriltag), Nothing, (Ptr{zarray_t},), detections)
424 +
    ccall((:apriltag_detections_destroy, libapriltag), Nothing, (Ptr{zarray_t},), detections)
425 425
end
426 426
427 427
function apriltag_to_image(fam, idx::Cint)
428 -
    ccall((:apriltag_to_image, :libapriltag), Ptr{image_u8_t}, (Ptr{apriltag_family_t}, Cint), fam, idx)
428 +
    ccall((:apriltag_to_image, libapriltag), Ptr{image_u8_t}, (Ptr{apriltag_family_t}, Cint), fam, idx)
429 429
end
430 430
431 431
@@ -433,7 +433,7 @@
Loading
433 433
434 434
# matd_t *homography_to_pose(const matd_t *H, double fx, double fy, double cx, double cy)
435 435
function homography_to_pose(H, fx, fy, cx, cy)
436 -
    ccall((:homography_to_pose, :libapriltag), Ptr{matd_t}, (Ptr{matd_t}, Cdouble, Cdouble, Cdouble, Cdouble), H, fx, fy, cx, cy)
436 +
    ccall((:homography_to_pose, libapriltag), Ptr{matd_t}, (Ptr{matd_t}, Cdouble, Cdouble, Cdouble, Cdouble), H, fx, fy, cx, cy)
437 437
end
438 438
439 439
@@ -495,7 +495,7 @@
Loading
495 495
496 496
# void estimate_pose_for_tag_homography(apriltag_detection_info_t* info, apriltag_pose_t* pose);
497 497
function estimate_pose_for_tag_homography(info, pose)
498 -
    ccall((:estimate_pose_for_tag_homography, :libapriltag), Nothing, (Ptr{apriltag_detection_info_t}, Ptr{apriltag_pose_t}), Ref(info), Ref(pose))
498 +
    ccall((:estimate_pose_for_tag_homography, libapriltag), Nothing, (Ptr{apriltag_detection_info_t}, Ptr{apriltag_pose_t}), Ref(info), Ref(pose))
499 499
end
500 500
501 501
# double orthogonal_iteration(matd_t** v, matd_t** p, matd_t** t, matd_t** R, int n_points, int n_steps)
@@ -507,7 +507,7 @@
Loading
507 507
    tp = Base.unsafe_convert(Ptr{Nothing}, Ref(t))
508 508
    Rp = Base.unsafe_convert(Ptr{Nothing}, Ref(R))
509 509
510 -
    ccall((:orthogonal_iteration, :libapriltag), Cdouble,
510 +
    ccall((:orthogonal_iteration, libapriltag), Cdouble,
511 511
            (Ptr{Ptr{matd_t}}, Ptr{Ptr{matd_t}}, Ptr{Ptr{matd_t}}, Ptr{Ptr{matd_t}}, Cint, Cint),
512 512
            vp, pp, tp, Rp, n_points, n_steps)
513 513
end
@@ -520,7 +520,7 @@
Loading
520 520
    tp = Base.unsafe_convert(Ptr{Nothing}, Ref(t))
521 521
    Rp = Base.unsafe_convert(Ptr{Nothing}, Ref(R))
522 522
523 -
    ccall((:fix_pose_ambiguities, :libapriltag), Ptr{Matd3x3},
523 +
    ccall((:fix_pose_ambiguities, libapriltag), Ptr{Matd3x3},
524 524
            (Ptr{Ptr{matd_t}}, Ptr{Ptr{matd_t}}, Ptr{matd_t}, Ptr{matd_t}, Cint),
525 525
            vp, pp, tp, Rp, n_points)
526 526
end
Files Coverage
src 83.88%
Project Totals (7 files) 83.88%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading