Skip to content
This repository has been archived by the owner on Mar 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from duckietown/RPi_homography_fix_attempt
Browse files Browse the repository at this point in the history
Everything related to detection goodness removed
  • Loading branch information
AleksandarPetrov authored Apr 8, 2019
2 parents d43723b + e784d77 commit 9abbd50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If you also want to extract the tag pose, `estimate_tag_pose` should be set to `
| tag_id | The decoded ID of the tag. |
| hamming | How many error bits were corrected? Note: accepting large numbers of corrected errors leads to greatly increased false positive rates. NOTE: As of this implementation, the detector cannot detect tags with a Hamming distance greater than 2. |
| decision_margin | A measure of the quality of the binary decoding process: the average difference between the intensity of a data bit versus the decision threshold. Higher numbers roughly indicate better decodes. This is a reasonable measure of detection accuracy only for very small tags-- not effective for larger tags (where we could have sampled anywhere within a bit cell and still gotten a good detection.) |
| homography | The 3x3 homography matrix describing the projection from an "ideal" tag (with corners at (-1,1), (1,1), (1,-1), and (-1, -1)) to pixels in the image. CURRENTLY NOT IMPLEMENTED DUE TO A NULL POINTER ERROR ON RPI |
| homography | The 3x3 homography matrix describing the projection from an "ideal" tag (with corners at (-1,1), (1,1), (1,-1), and (-1, -1)) to pixels in the image. |
| center | The center of the detection in image pixel coordinates. |
| corners | The corners of the tag in image pixel coordinates. These always wrap counter-clock wise around the tag. |
| pose_R* | Rotation matrix of the pose estimate. |
Expand Down
2 changes: 1 addition & 1 deletion apriltags
6 changes: 1 addition & 5 deletions apriltags3.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class _ApriltagDetection(ctypes.Structure):
('family', ctypes.POINTER(_ApriltagFamily)),
('id', ctypes.c_int),
('hamming', ctypes.c_int),
('goodness', ctypes.c_float),
('decision_margin', ctypes.c_float),
('H', ctypes.POINTER(_Matd)),
('c', ctypes.c_double*2),
Expand Down Expand Up @@ -146,7 +145,6 @@ def __init__(self):
self.tag_family = None
self.tag_id = None
self.hamming = None
self.goodness = None
self.decision_margin = None
self.homography = None
self.center = None
Expand All @@ -160,7 +158,6 @@ def __str__(self):
'\ntag_family = ' + str(self.tag_family)+
'\ntag_id = ' + str(self.tag_id)+
'\nhamming = ' + str(self.hamming)+
'\ngoodness = ' + str(self.goodness)+
'\ndecision_margin = ' + str(self.decision_margin)+
'\nhomography = ' + str(self.homography)+
'\ncenter = ' + str(self.center)+
Expand Down Expand Up @@ -355,15 +352,14 @@ def detect(self, img, estimate_tag_pose=False, camera_params=None, tag_size=None

tag = apriltag.contents

homography = numpy.zeros((3,3)) #_matd_get_array(tag.H).copy() # Don't ask questions, move on with your life
homography = _matd_get_array(tag.H).copy() # numpy.zeros((3,3)) # Don't ask questions, move on with your life
center = numpy.ctypeslib.as_array(tag.c, shape=(2,)).copy()
corners = numpy.ctypeslib.as_array(tag.p, shape=(4, 2)).copy()

detection = Detection()
detection.tag_family = ctypes.string_at(tag.family.contents.name)
detection.tag_id = tag.id
detection.hamming = tag.hamming
detection.goodness = tag.goodness
detection.decision_margin = tag.decision_margin
detection.homography = homography
detection.center = center
Expand Down

0 comments on commit 9abbd50

Please sign in to comment.