Comments (5)
This check was added in #317 to avoid indexing with a negative index. I hope that the proposed fix in #213, which was ported into #317 via 359a984, fixes the issue, but apparently, it does not.
Do you have a reproducible script and data for this?
from apriltag.
this is my code:
#include "apriltag.h"
#include "tagStandard41h12.h"
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
int main() {
std::string img_path = "path_to_img";
cv::Mat img = cv::imread(img_path, CV_8UC1);
apriltag_family_t *tf;
apriltag_detector_t *td;
tf = tagStandard41h12_create();
td = apriltag_detector_create();
apriltag_detector_add_family(td, tf);
image_u8_t im = {img.cols, img.rows, img.cols, img.data};
zarray_t *detections = apriltag_detector_detect(td, &im);
apriltag_detector_destroy(td);
tagStandard41h12_destroy(tf);
return 0;
}
this is the picture:
and the commit is e6cd3c7
from apriltag.
Thanks. I can reproduce this with the apriltag_demo
:
apriltag_demo -f tagStandard41h12 319063435-0f7a44f8-58e7-452c-99bc-142160e24a93.jpg
from apriltag.
With the debug information
I can see that there are two odd perfect axis-aligned rectangular quads and with the debugger I can see that those coordinates are horizontally and vertically aligned (identical x and y coordinates).
While it is very unlikely that we will get detections that are perfectly axis-aligned like this on a sub-pixel level, I don't see why homography_compute2
should be able to compute a homography from this.
from apriltag.
At e6cd3c7 I am able to repro with:
rm -r build
cmake -B build
cmake --build build
uild/apriltag_demo -f tagStandard41h12 ~/Downloads/319063435-0f7a44f8-58e7-452c-99bc-142160e24a93.jpg
(I wasn't able to repro with -DCMAKE_BUILD_TYPE=Release since it removes asserts)
Printing out the correspondences matrix that is input to homography_compute2 in this case gives:
-1.0000 -1.0000 191.9706 454.0736
1.0000 -1.0000 191.9706 454.0736
1.0000 1.0000 191.9706 472.9767
-1.0000 1.0000 191.9706 472.9767
Which is a degenerate case for which a valid homography does not exist. We should return null rather than asserting from homography_compute2.
But how did we end up with a degenerate case not getting filtered out earlier? This is the quad in question:
The reason is that we only end up with a degenerate quad after the refine_edges step and there are not checks on the result of the refine edges step that the quad is valid. This is fine IMO since the fastest way to know if a quad is valid at this point is just to do the decode step, which is what happens next
from apriltag.
Related Issues (20)
- Help with thresholding parameters HOT 1
- How to run pose estimation in python ? HOT 3
- compatibility with WIN32_LEAN_AND_MEAN HOT 8
- Anyone implmented c# wrapper for this? HOT 1
- error when i run make in ubuntu 22.04 HOT 1
- Has anyone confirmed that this library can work on ESP32S3? HOT 3
- How to use intrinsics in Scaramuzza format to estimate the apriltag pose? HOT 3
- Suggestions on improving detections in low light conditions HOT 4
- Python bindings for apriltag_detect throws error when no detection is found HOT 5
- Planned Python Package Index (PyPI) package? HOT 4
- Build fail on Ubuntu Noble in g2d.c: `last_quadrant` is used unitialized; treat-all-warnings-as-errors HOT 4
- How to detect AprilGrid? HOT 5
- (Python) 'Nthreads' is an invalid keyword argument for this function HOT 1
- Question: Use more than 4 points for pose computation HOT 3
- corner location has always 0.125 pixel error
- ReadMe File Error HOT 2
- Question: How to process moving frames? HOT 5
- from apriltag import apriltag no module HOT 2
- quick_decode struct allocates 6Gb memory for standard52h13 family HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apriltag.