ARToolKitNFTCore: calling setupAR2() again leaves markers undetected and leaks the AR2 handle
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start in ARToolKitNFTCore.cpp at setupAR2(), where the old ar2Handle is overwritten without being freed, and in addNFTMarkers(), which re-applies refDataSetAll. Read ARToolKitNFTCore.h for the documented limitations. Done means a second setupAR2() frees the old handle without leaking, and maintainers have chosen between re-arming detection inside setupAR2() and a separate rearmDetection(). The issue also asks for a re-initialisation scenario in tools/compare-builds.js, which needs maintainer input first.
Written by the indexing model from the issue text.
Description
Summary
Follow-up to the ARToolKitNFTCore extraction (webarkit/jsartoolkitNFT#683; the core lands in WebARKitLib with the feat/nft-core PR). Two limitations of re-calling setupAR2(), both kept from the original bindings so the refactor stays behaviour-identical, now documented in ARToolKitNFTCore.h:
- No detection until the next
addNFTMarkers().setupAR2()recreates the KPM handle (and drops the detector), so the KPM matcher no longer holds the markers already loaded: they are tracked if already locked, but never re-detected. CallingaddNFTMarkers({})re-arms detection (it re-applies the accumulated reference data set), but it returns{}, the same value as a failure. - AR2 handle leak. A second
setupAR2()without asetCamera()in between overwritesar2Handlewithout deleting it (ARToolKitNFTCore.cpp,setupAR2); with the threaded AR2 variant the old handle's worker threads leak too. The original bindings did the same.
Proposal
- In
setupAR2(), delete an existing AR2 handle before creating the new one (a no-op on the normal flow, wheresetCamera()already freed it). - After recreating the KPM handle, re-apply the accumulated reference data set (
refDataSetAll) and recreate the detector, so loaded markers stay detectable; or add an explicitrearmDetection()with a distinct return value.
Both change observable behaviour of the jsartoolkitNFT bindings on a re-initialisation path, so they belong in a release note, and the jsartoolkitNFT comparison tool (tools/compare-builds.js) should be extended with a re-initialisation scenario first.
- Dominant language
- C++
- Stars
- 21
- Forks
- 8
- Avg merge
- 7h 30m
- Merged PRs (30d)
- 25
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from webarkit/WebARKitLib
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
webarkit/WebARKitLib#101 ·
Maintainers usually reply within 1 day
-
Sync workflow: handle a conflicting sync branch with no open PR, and PRs the workflow did not openOpenCI enhancement
Difficulty 3/5 Half a day Newbie friendliness 45/100
webarkit/WebARKitLib#92 ·
Maintainers usually reply within 1 day
-
Optical tracker: frames without a marker run detection twice since the #53 full-resolution retryOpenC/C++ code enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
webarkit/WebARKitLib#91 ·
Maintainers usually reply within 1 day
-
Real-world pose scale from a physical marker width at init (ArtoolkitX-style), not the _pattern.size/2 pixel centre offsetMay be free again @kalwalt claimed this 106 days ago, and no pull request is open. Openenhancement question
webarkit/WebARKitLib#62 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
webarkit/WebARKitLib#48 ·
Maintainers usually reply within 1 day
All issues in webarkit/WebARKitLib
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
(S1 - Need confirmation)
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
CleverRaven/Cataclysm-DDA#89182 ·
Maintainers usually reply within 1 day
-
ai_p2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ClickHouse/ClickHouse#126833 ·
Maintainers usually reply within 1 day
-
clang:static analyzer
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
llvm/llvm-project#233598 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100