AlvaAR icon indicating copy to clipboard operation
AlvaAR copied to clipboard

Image (marker) tracking?

Open skeegan opened this issue 1 year ago • 4 comments

Hello,

Could AlvaAR be used (or adapted to be used) for recognition and tracking of images (i.e. image markers)?

skeegan avatar Oct 28 '23 10:10 skeegan

Hi mate, can't answer your question but jsartoolkit or mindar are two libs for image tracking on the web.

ThorstenBux avatar Oct 28 '23 19:10 ThorstenBux

thanks @ThorstenBux

They're interesting libraries. Do you know of any others that can enable 3D object tracking in Javascript?

skeegan avatar Oct 29 '23 12:10 skeegan

Hi @skeegan,

While AlvaAR includes all the essential subroutines for NFT image tracking as part of its SLAM algorithm, they are primarily designed for SLAM within the library and are not specifically optimized for NFT image tracking. To achieve your goal, you can follow these rough steps:

  1. Feature Detection/Extraction: Use Harris corners to identify and extract unique feature points from a reference image.
  2. Feature Descriptors: Apply ORB descriptors to describe these unique features.
  3. Process Camera Frames: Repeat steps 1 and 2 for each camera frame to detect features and match them with the target image features.
  4. Select Good Matches: Use k-NN (k-nearest neighbors) to filter and keep only the good matches.
  5. Pose and Orientation: Find homography using RANSAC, calculate the corners, and use solvePnP with these corners to obtain rotation and translation vectors.
  6. Camera Projection Matrix: Create and send this matrix to your 3D environment (Three.js, Babylon, AFrame, etc.).
  7. Render and Update: Overlay and dynamically update digital content in your application based on the camera projection matrix.
  8. Continuous Tracking and Updates: Continuously track the target image and update the overlay as needed.

If you check out the library's code, you'll find that all these subroutines are present, though with a focus on SLAM rather than NFT image tracking.

I'm considering adding this feature in the future. In the meantime, you might find these additional resources, complementing what ThorstenBux suggested, helpful: OpenCv, AR.js, martins-js, Object tracking using Homography in OpenCV

alanross avatar Nov 16 '23 03:11 alanross

Many thanks @alanross . Your response was very thorough and helpful

skeegan avatar Feb 08 '24 14:02 skeegan