-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roi for tags #7645
base: main
Are you sure you want to change the base?
Roi for tags #7645
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -379,7 +379,10 @@ apriltag_detector_t *apriltag_detector_create(void) | |
|
||
// NB: defer initialization of td->wp so that the user can | ||
// override td->nthreads. | ||
|
||
td->roiX = 0; | ||
td->roiY = 0; | ||
td->roiWidth = 16; | ||
td->roiHeight = 16; | ||
return td; | ||
} | ||
|
||
|
@@ -1053,9 +1056,10 @@ zarray_t *apriltag_detector_detect(apriltag_detector_t *td, image_u8_t *im_orig) | |
// SHARPEN the image by subtracting the low frequency components. | ||
image_u8_t *orig = image_u8_copy(quad_im); | ||
image_u8_gaussian_blur(quad_im, sigma, ksz); | ||
|
||
for (int y = 0; y < orig->height; y++) { | ||
for (int x = 0; x < orig->width; x++) { | ||
|
||
//TO-DO add check of roiX and roiY | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these going to be done in this PR? If so, this PR should be marked as a draft. Also, IDEs typically highlight A space should be included between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excuse me I didn't quite understand what you want with this one, I just marked it for me to remember, I can delete it if that's a problem but I intent on making it part of the PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since you still have more to add, I'll convert this PR to a draft. |
||
for (int y = td->roiY; y < td->roiHeight; y++) { | ||
for (int x = td->roiX; x < td->roiWidth; x++) { | ||
int vorig = orig->buf[y*orig->stride + x]; | ||
int vblur = quad_im->buf[y*quad_im->stride + x]; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Peter Johnson <[email protected]> | ||
Date: Sun, 4 Dec 2022 11:01:56 -0800 | ||
Subject: [PATCH 1/8] apriltag_pose.c: Set NULL when second solution could not | ||
be determined | ||
Subject: [PATCH 01/12] apriltag_pose.c: Set NULL when second solution could | ||
not be determined | ||
|
||
--- | ||
apriltag_pose.c | 1 + | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Peter Johnson <[email protected]> | ||
Date: Sun, 4 Dec 2022 11:42:13 -0800 | ||
Subject: [PATCH 2/8] Avoid unused variable warnings in release builds | ||
Subject: [PATCH 02/12] Avoid unused variable warnings in release builds | ||
|
||
--- | ||
common/matd.c | 4 +++- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Tyler Veness <[email protected]> | ||
Date: Tue, 10 Jan 2023 18:36:36 -0800 | ||
Subject: [PATCH 3/8] Make orthogonal_iteration() exit early upon convergence | ||
Subject: [PATCH 03/12] Make orthogonal_iteration() exit early upon convergence | ||
|
||
The current approach wastes iterations doing no work. Exiting early can | ||
give lower latencies and higher FPS. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Peter Johnson <[email protected]> | ||
Date: Wed, 19 Jul 2023 20:48:21 -0700 | ||
Subject: [PATCH 4/8] Fix signed left shift warning | ||
Subject: [PATCH 04/12] Fix signed left shift warning | ||
|
||
--- | ||
common/pjpeg.c | 4 ++-- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Peter Johnson <[email protected]> | ||
Date: Wed, 19 Jul 2023 21:28:43 -0700 | ||
Subject: [PATCH 5/8] Avoid incompatible pointer warning | ||
Subject: [PATCH 05/12] Avoid incompatible pointer warning | ||
|
||
--- | ||
common/getopt.c | 3 ++- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Tyler Veness <[email protected]> | ||
Date: Fri, 19 Jul 2024 21:45:29 -0700 | ||
Subject: [PATCH 6/8] Remove calls to postscript_image() | ||
Subject: [PATCH 06/12] Remove calls to postscript_image() | ||
|
||
--- | ||
apriltag.c | 5 ----- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Peter Johnson <[email protected]> | ||
Date: Thu, 29 Jun 2023 22:14:05 -0700 | ||
Subject: [PATCH 7/8] Fix clang 16 warnings | ||
Subject: [PATCH 07/12] Fix clang 16 warnings | ||
|
||
--- | ||
apriltag.c | 2 +- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Ryan Blue <[email protected]> | ||
Date: Fri, 23 Aug 2024 02:50:24 -0400 | ||
Subject: [PATCH 8/8] Remove GCC diagnostic pragmas on windows | ||
Subject: [PATCH 08/12] Remove GCC diagnostic pragmas on windows | ||
|
||
--- | ||
common/pthreads_cross.c | 3 --- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: GGreenix <[email protected]> | ||
Date: Tue, 31 Dec 2024 20:05:39 +0200 | ||
Subject: [PATCH 09/12] ROI for detection | ||
|
||
--- | ||
apriltag.c | 4 ++-- | ||
apriltag.h | 3 +++ | ||
2 files changed, 5 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/apriltag.c b/apriltag.c | ||
index b7e24c4bc279643f478d810d494345216be991f1..3654ab376a62bf744d99bd89d45f97620a258495 100644 | ||
--- a/apriltag.c | ||
+++ b/apriltag.c | ||
@@ -1054,8 +1054,8 @@ zarray_t *apriltag_detector_detect(apriltag_detector_t *td, image_u8_t *im_orig) | ||
image_u8_t *orig = image_u8_copy(quad_im); | ||
image_u8_gaussian_blur(quad_im, sigma, ksz); | ||
|
||
- for (int y = 0; y < orig->height; y++) { | ||
- for (int x = 0; x < orig->width; x++) { | ||
+ for (int y = td->roi_y_coor; y < td->roi_height; y++) { | ||
+ for (int x = td->roi_x_coor; x < td->roi_width; x++) { | ||
int vorig = orig->buf[y*orig->stride + x]; | ||
int vblur = quad_im->buf[y*quad_im->stride + x]; | ||
|
||
diff --git a/apriltag.h b/apriltag.h | ||
index 895b3459b8a84064989378fe533fd676964a1687..6ac15fae3c4700e25aa7a5f34831079e66abde5c 100644 | ||
--- a/apriltag.h | ||
+++ b/apriltag.h | ||
@@ -188,6 +188,9 @@ struct apriltag_detector | ||
|
||
// Used for thread safety. | ||
pthread_mutex_t mutex; | ||
+ | ||
+ //ROI used for saving proccesing time | ||
+ double roi_x_coor, roi_y_coor, roi_width, roi_height; | ||
}; | ||
|
||
// Represents the detection of a tag. These are returned to the user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the spurious newlines added in this PR.