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
Hello,
I'm trying to do tracking with the js-aruco library using the RGB camera.
The goal is to place a simple 3D cube on a tag in the HoloJS world.
I have some problems with the registration, there is always a shift with the 3D object.
The world of the RGB camera is the same as the HolographicCamera in ThreeJS?
Someone already had this kind of problem? Or someone ever done tracking on HoloJS? 😅
Here a small example
letframe=newImage();letdetector=newAR.Detector();lettagSize=0.52;// tag size, mm in aruco, m in HoloJSletcube=newTHREE.Mesh(newTHREE.BoxBufferGeometry(tagSize,tagSize,tagSize),newTHREE.MeshNormalMaterial());frame.onload=function(){letcanvas=document.createElement('canvas');canvas.width=frame.width;canvas.height=frame.height;letctx=canvas.getContext('2d');ctx.drawImage(frame,0,0);letimageData=ctx.getImageData(0,0,frame.width,frame.height);// detect markersdetectTag(imageData);}frame.src="camera://local/default";functiondetectTag(imageData){letmarkers=detector.detect(imageData);if(markers.length>0){letposit=newPOS.Posit(modelSize,canvas.width);letcorners=markers[0].corners;// corners must be centered on canvasfor(vari=0;i<corners.length;++i){corner=corners[i];corner.x=corner.x-(imageData.width/2);corner.y=(imageData.height/2)-corner.y;}letpose=posit.pose(corners);letrotation=pose.bestRotationlettranslation=pose.bestTranslationupdateCube(rotation,translation);}}functionupdateCube(rotation,translation){cube.rotation.x=-Math.asin(-rotation[1][2]);cube.rotation.y=-Math.atan2(rotation[0][2],rotation[2][2]);cube.rotation.z=Math.atan2(rotation[1][0],rotation[1][1]);cube.position.x=translation[0];cube.position.y=translation[1];cube.position.z=-translation[2];cube.updateMatrix();cube.applyMatrix(camera.matrixWorld);cube.updateMatrix();}
The text was updated successfully, but these errors were encountered:
When extracting the 3D coordinates from a photo, where does js-aruco place the origin of the coordinate system? For HoloJS, (0,0,0) in your scene is actually 2 meters in front of you: WorldOriginRelativePosition = float3(0, 0, -2);
Try changing it to (0,0,0) to bring the scene origin roughly to the same position as the RGB camera and you might have better alignment.
Another possibility is that the 3D coordinates extracted from the photo by js-aruco do no match HoloLens's world tracking system.
When extracting the 3D coordinates from a photo, where does js-aruco place the origin of the coordinate system? For HoloJS, (0,0,0) in your scene is actually 2 meters in front of you: WorldOriginRelativePosition = float3(0, 0, -2);
Try changing it to (0,0,0) to bring the scene origin roughly to the same position as the RGB camera and you might have better alignment.
Another possibility is that the 3D coordinates extracted from the photo by js-aruco do no match HoloLens's world tracking system.
Hello,
I'm trying to do tracking with the js-aruco library using the RGB camera.
The goal is to place a simple 3D cube on a tag in the HoloJS world.
I have some problems with the registration, there is always a shift with the 3D object.
The world of the RGB camera is the same as the HolographicCamera in ThreeJS?
Someone already had this kind of problem? Or someone ever done tracking on HoloJS? 😅
Here a small example
The text was updated successfully, but these errors were encountered: