Comments (1)
It won't build on Windows, not directly at least. I got it to build with gcc using MSYS2 but I had to make a few changes because the code appears to rely on a non-standard version of stdlib.h as well as signed time types not available on Windows/MSYS2.
From an MSYS2 terminal in the build directory:
cmake .. .. -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles"
mingw32-make
For this to work you must have installed make as follows:
pacman -S mingw64/mingw-w64-x86_64-make
You will now encounter a number of errors. Basically, you'll have to open up the problematic files and fix them. For errors about random() and srandom() not being found, simply redefine them to use rand() and srand(), which use an inferior RNG but whatever:
#define random rand
#define srandom srand
If you get an error about suseconds_t not existing:
typedef long long suseconds_t;
Lastly, in core/contrib/box.c:
- Comment out the reference to alloca.h
- Make sure _linux is defined before the ifdef.
- Replace my_memalign with these two functions:
void *aligned_alloc(size_t align, size_t size)
{
/* align must be a power of 2 */
/* size must be a multiple of align */
if ((align & (align - 1)) || (size & (align - 1)))
{
errno = EINVAL;
return NULL;
}
#ifdef HAVE_POSIX_MEMALIGN
if (align < sizeof (void *)) /* POSIX does not allow small alignment */
align = sizeof (void *);
void *ptr;
int err = posix_memalign(&ptr, align, size);
if (err)
{
errno = err;
ptr = NULL;
}
return ptr;
#elif defined(HAVE_MEMALIGN)
return memalign(align, size);
#elif defined (_WIN32) && defined(__MINGW32__)
return __mingw_aligned_malloc(size, align);
#elif defined (_WIN32) && defined(_MSC_VER)
return _aligned_malloc(size, align);
#else
/* align must be valid/supported */
assert(align <= alignof (max_align_t));
return malloc(((void) align, size));
#endif
}
int my_memalign(void** pptr, size_t alignment, size_t size) {
*pptr = aligned_alloc(alignment, size);
//*pptr = memalign(alignment, size);
int fail = (!*pptr);
return fail;
}
It should compile now. If you then have trouble running the Python apriltags.py demo, make sure it is trying to open the correct libapriltag.dll file. If it complains about missing dependencies there, edit your CMakeLists.txt and add -static like so:
set(EXTRA_FLAGS "-static -Wall -g -march=native ${CMAKE_THREAD_LIBS_INIT}")
This should build a DLL that includes its dependencies statically.
I'm thinking of cleaning this all up and making a PR myself...
from apriltag.
Related Issues (20)
- problem while using python script HOT 1
- Cannot install apriltag-python HOT 1
- I got a Error in python3.5 HOT 3
- how to find pose data from 3x3 homography matrix ? HOT 11
- Is there any plant to upgrade to latest apriltag3?
- What is the unit of tag size? HOT 2
- Fatal Error opencv2/core/core.hpp: No such file or directory
- Error while running make
- Unable to detect tag with border=2 HOT 4
- Too many borders. Core dumped HOT 3
- Silence please! HOT 1
- Distance HOT 1
- Extracting pose data to other python scripts HOT 1
- Ok, I found a few more leaks and fixed them in commit 15db309 – I also discovered the https://pypi.org/project/memory_profiler/ module along with its tool mprof which helped. Please let me know if you still see increasing memory usage over time.
- Can't build on M1 Mac HOT 2
- support tagStandard41h12
- detect_pose Units
- pip install error HOT 2
- Wildcard Option for IMAGE
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.