ArucoUnity | Bring augmented reality to Unity by tracking Aruco markers in real time | Augmented Reality library
kandi X-RAY | ArucoUnity Summary
kandi X-RAY | ArucoUnity Summary
Bring augmented reality to Unity by tracking ArUco markers in real time. Standard mono cameras, such as webcams, but also stereo cameras and fisheye lenses are supported.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ArucoUnity
ArucoUnity Key Features
ArucoUnity Examples and Code Snippets
Community Discussions
Trending Discussions on ArucoUnity
QUESTION
mat.hpp (part of)
...ANSWER
Answered 2020-Dec-10 at 13:55I found the cause of the crash which was later on when I wanted to get the values which I casted as the wrong type of values (Vecd instead of the correct Vec3b). Additionally, I was also not using "new cv::Mat()" when testing and that cause the Mat to be discarded by the C++ (and the C# pointing to random stuff).
For anyone that would like to do something similare here is my code (even if it' is heavily inspired by ArucoUnity/ArucoUnityPlugin by NormandErwan).
C++ With the following somewhere (for me it was in PatternRecognition.hpp)QUESTION
I want to recognize ArUco Marker in Unity3D and attach a GameObject to their position. I know there are packages in the Asset Store, but as other people got it working I was looking for an free existing solution or try it by myself.
ArucoUnity The detection worked like a charm, but Unity crashes when accessing the data of the rvecs
, tvecs
. The error somewhere occur in the Get(int i)
in the Vec3d
class, when the c++ method au_cv_Vec3d_get(CppPtr, i, CppPtr);
is called
OpenCv plus Unity This implementation seems not to be complete as there exist no function to EstimatePoseSingleMarker
or similar to get the rvecs
and tvecs
. Also the last updated was Jan 2019.
As Unity (C#) provides the possibility to access unmanaged code, I followed this great tutorial and for the begging I was able to forward the cv::VideoCaputre
stream to Unity. The only problem that occured was a FPS drop to around 35-40 whereas normally I get around 90-100.
The C# code:
...ANSWER
Answered 2019-Nov-19 at 07:43If I recall correctly, the C++ call to get an image (_capture >> _currentFrame;
) is blocking/synchronous, meaning your code won't continue until it actually retrieves the image. You probably want to run your MatToTexture2D
code asynchronously.
※This will mean that your frame rate will be higher than your image retrieval rate.
Have your MatToTexture2D
function run continuously as needed, updating tex
. Then just continue to set your texture to the latest tex
, which may be the same value 2-3 frames in a row.
Edit: @derHugo's answer is much more solid for the programming side, so I'll hide that part. The basic issue is explained above, and derHugo's work-around is much better than my pseudo-code :)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ArucoUnity
Download the latest build release. Or see the Build From Sources documentation page.
Import ArucoUnity.package in your Unity project.
Download the latest build release corresponding to your platform. Windows and Linux x64 only are supported (see issue #6).
Copy the Assets/ folder to your Unity project.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page