This document provides guidance on how to use and calibrate the AR Marker Detector, which runs in Max MSP.
- Max MSP: Ensure you have Max MSP installed on your machine.
- Dependencies: The project uses the following JavaScript libraries:
polyfill.js
cv.js
aruco.js
n4m.aruco.js
Ensure these files are available and correctly referenced in your environment.
- Camera Access: A webcam or camera device capable of streaming video at a resolution of 2048x1080 pixels.
- Detects and tracks markers using ARUCO codes.
- Provides calibration functionality for aligning marker coordinates to a physical space.
- Filters markers based on predefined IDs.
- Launch Max MSP and open the project.
- Ensure the camera is connected and functional.
- Open the HTML-based interface in a supported browser (e.g., Chrome).
- Allow camera access when prompted.
- The detector begins processing frames automatically after initialization.
- Detected markers will be displayed on the canvas along with their IDs, positions, and rotation.
- Click the "Enable Filter" button to filter markers based on predefined IDs (
qrIds
). - To disable filtering, click the "Disable Filter" button.
Calibration ensures the detected markers are correctly mapped to physical dimensions (e.g., 980mm x 505mm).
- Click the Calibrate button.
- Place all four calibration markers (IDs:
0
,40
,90
,80
) in the camera's view.
- Ensure all markers are clearly visible and not obstructed.
- The calibration markers should form a rectangle representing the physical dimensions.
- Click the Save Calibration button.
- If all four markers are not detected, an error message will appear.
- Adjust the placement of markers and try again.
- Once calibration is saved, the system adjusts all subsequent marker detections.
-
qrIds: These IDs determine which markers are detected during operation.
- To change, locate the
qrIds
array in the script:Add or remove marker IDs as needed.const qrIds = [0, 20, 30, 40, 50, 70, 80, 90];
- To change, locate the
-
qrCalibration: These IDs are used for calibration.
- To change, locate the
qrCalibration
array in the script:Update with the new marker IDs you plan to use for calibration.const qrCalibration = [0, 40, 90, 80];
- To change, locate the
- Locate the
getUserMedia
function call in the script:Update thenavigator.mediaDevices.getUserMedia({ video: { width: 2048, height: 1080 } })
width
andheight
properties to match your desired resolution.
- The script uses constants
SCALE_X
andSCALE_Y
to represent the physical dimensions in millimeters:Update these values to match the actual dimensions of your physical setup.const SCALE_X = 980; // Physical width in mm of the target area const SCALE_Y = 505; // Physical height in mm of the target area
- For example, if your setup is 1000mm x 600mm, modify as follows:
const SCALE_X = 1000; const SCALE_Y = 600;
- Ensure your calibration markers reflect the updated dimensions.
- For example, if your setup is 1000mm x 600mm, modify as follows:
- Use the Marker Creator Tool to generate ARUCO markers.
- Ensure the dictionary is set to ARUCO_MIP_36h12 for compatibility with this script.
- The application limits processing to 30 FPS to balance performance and responsiveness.
- The canvas resolution is scaled down for efficient computation.
- Markers Not Detected:
- Ensure the camera resolution is set to 2048x1080.
- Verify marker IDs match the predefined values (qrIds or
qrCalibration
).
- Calibration Issues:
- Confirm all four calibration markers are visible.
- Check that markers form a rectangular shape.
- Camera Not Accessible:
- Verify permissions for the browser to access the camera.
- Restart the browser or application if needed.
- This project can be extended to support custom marker IDs and layouts.
- Ensure the backend endpoint (
http://localhost:3000/qr
) is running to handle marker data.
For further assistance, please refer to the documentation or contact the project maintainers.