You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sweep the WebARKit-specific C++ code for duplicated, orphan, or unused code, and clean it up. Several recent fixes (#43, #44, #46) surfaced vestigial paths (e.g. the disabled pyrDown block, the no-op _featureDetectScaleFactor rescale) that had been carrying dead weight for a long time. Likely there is more.
lib/SRC/AR/**, lib/SRC/ARUtil/**, include/AR/** (vendored old ARToolKit5 sources/headers — untouched).
OpenCV and submodules under opencv/, opencv_contrib/.
Note: ArtoolkitX remains the design reference for the OCVT planar tracker under WebARKit/WebARKitTrackers/WebARKitOpticalTracking/ (cross-checked against artoolkitx/artoolkitx); that is separate from the vendored ARToolKit5 utility code.
Companion scope — also audit webarkit/webarkit-testing
_trackVizActive / TrackerVisualization — referenced throughout but no public toggle / not consumed by any example. Confirm dead-or-load-bearing.
getPoseMatrix vs getPoseMatrix2 — both are bound to JS but only getPoseMatrix2() is read in process_raw(). Is the other unused?
computePose in WebARKitPattern.cpp — declared but not called from anywhere in the live path.
getTransformationMatrix vs getGLViewMatrix vs matrixGL_RH — three GL-ish matrices flowing through the manager + bindings; some may be unused by every consumer.
points2d / points3d on _pattern — populated in initTracker but check for use.
Duplicated helpers (e.g. convert2Grayscale, GrayScale JS class, and convertJSArrayToNumberVector paths).
process_raw vs processFrame — both shapes exist; one wraps the other; check if both are still consumed.
Header-only declarations whose .cpp definitions are gone, and vice-versa.
Acceptance
Per-file inventory of dead / duplicated / orphan code, with proposed removal.
Each removal verified to leave behavior unchanged (recompile + the static-image and webcam examples track).
If any "dead-looking" symbol turns out to be load-bearing (used by another consumer / tooling), document why and leave it.
Repeat the inventory + cleanup pass on the in-scope parts of webarkit-testing.
Goal
Sweep the WebARKit-specific C++ code for duplicated, orphan, or unused code, and clean it up. Several recent fixes (#43, #44, #46) surfaced vestigial paths (e.g. the disabled
pyrDownblock, the no-op_featureDetectScaleFactorrescale) that had been carrying dead weight for a long time. Likely there is more.Scope
In scope —
WebARKit/only:WebARKit/WebARKitTrackers/WebARKitOpticalTracking/WebARKitTracker.cpp+ headersWebARKit/WebARKitTrackers/WebARKitOpticalTracking/TrackingPointSelector.{h,cpp}WebARKit/WebARKitTrackers/WebARKitOpticalTracking/HomographyInfo.{h,cpp}WebARKit/WebARKitTrackers/WebARKitOpticalTracking/WebARKitConfig.{h,cpp}WebARKit/WebARKitManager.{h,cpp},WebARKit/WebARKitCamera.{h,cpp},WebARKit/WebARKitGL.{h,cpp},WebARKit/WebARKitPattern.{h,cpp},WebARKit/WebARKitLog.{h,cpp}Out of scope — vendored code:
lib/SRC/AR/**,lib/SRC/ARUtil/**,include/AR/**(vendored old ARToolKit5 sources/headers — untouched).opencv/,opencv_contrib/.Companion scope — also audit
webarkit/webarkit-testingsrc/(JS controller + utils)emscripten/glue (WebARKitJS.{h,cpp},bindings.cpp)examples/(post-Fix CV->GL pose conversion in updateTrackable() #36 cleanup) — small surface; spot-check for orphanstools/makem.js(any orphan source entries)package.jsonscripts /webpack.config.jstargets (already trimmedSpeedyVisionSinkImageDatain webarkit-testing#41).What to look for
WebARKitTrackerImpland friends that are written but never read (or never written).pyrDown/detection-guard blocks were finally removed in Feature keypoints double-scaled for frames larger than featureImageMinSize (marker mis-localized at ~2x position) #43/Restore downsampled feature detection + single-marker detection guard for performance (reconcile with ArtoolkitX OCVT) #44 prep; check for others)._trackVizActive/TrackerVisualization— referenced throughout but no public toggle / not consumed by any example. Confirm dead-or-load-bearing.getPoseMatrixvsgetPoseMatrix2— both are bound to JS but onlygetPoseMatrix2()is read inprocess_raw(). Is the other unused?computePoseinWebARKitPattern.cpp— declared but not called from anywhere in the live path.getTransformationMatrixvsgetGLViewMatrixvsmatrixGL_RH— three GL-ish matrices flowing through the manager + bindings; some may be unused by every consumer.points2d/points3don_pattern— populated ininitTrackerbut check for use.convert2Grayscale,GrayScaleJS class, andconvertJSArrayToNumberVectorpaths).process_rawvsprocessFrame— both shapes exist; one wraps the other; check if both are still consumed..cppdefinitions are gone, and vice-versa.Acceptance
Tooling
clang-tidy(misc-unused-using-decls,bugprone-*,readability-*)-Wunused-*+-Wmissing-declarationscppcheckfor dead-code detectionNotes
This is a quality / debt issue, not a bug — defer behind active bug work (#44 perf, #48 markerless).