Augmented Reality using FLARToolkit – restrict unnecessary model jumping
I have used FLARToolkit for many Augmented Reality projects.
At one point I felt that while holding the marker in a particular position, makes the 3D model appear and moves continuously even though the marker is still. After much debugging, I found out that this was happening due to light-shade change. To eliminate this sensitive issue in tracking lighting environment, I tried to restrict the renderViewport based on web-camera’s activity level. A level of 16 worked ideal for me. Check it out here:
//function called on enter frame
function renderViewport(event:Event):void
{
updateCaptureBitmap();// draws the web-camera image constantly
try{
//checks for marker existence using ARDetector
if (arDetector.detectMarker()) {
//restricts model form movement due to light change
if(arCamera.activityLevel > 16){
this.arDetector.calculateTransformMatrix(resultMatrix);
baseNode.setTransformMatrix(resultMatrix);
}
}else{
//do nothing
}
}catch(error:Error) {
trace(error);
}
renderer.renderScene(scene, camera, viewport); // renders model
}




это, сука, гениально
makc
September 23, 2010 at 9:46 PM
[...] learning today about a very clever trick by Deepanjan Das, I decided to implement it in [...]
FLARManager: control jitter with activityThreshold | transmote speaks...
September 24, 2010 at 8:07 AM
this is great, thanks for posting!
it’s now included in FLARManager as activityThreshold:
http://words.transmote.com/wp/20100923/flarmanager-activitythreshold/
ericsoco
September 24, 2010 at 8:07 AM
Thanks Guys
deepanjandas
September 24, 2010 at 8:22 AM
Thanks for this.
WARlock
September 26, 2010 at 4:17 AM
[...] (Sakri), Otsu thresholding (Andrew), automatic thresholding (some unknown guy), brilliant camera activity trick (Deepanjan). Even my complex numbers experiment found its way into this – I used it for pose [...]
Meet qtrack « ¿noʎ ǝɹɐ ʍoɥ 'ʎǝɥ
December 30, 2010 at 12:43 AM
or use this condition instead :
ar_bmp.bitmapData.draw(video);
if (detector.detectMarkerLite(raster, 80) && detector.getConfidence() > 0.5)
{
detector.getTransformMatrix(resultMat);
baseNode.setTransformMatrix(resultMat);
baseNode.visible = true;
} else {
baseNode.visible = false;
}
renderer.render();
Jackal
June 21, 2011 at 5:16 AM
Hello Jackal,
You are absolutely right. What I tried to fix is: if you keep your camera on set your marker at a fixed place under the same lighting condition, you will often see the model in AR (if its an animated one on loading) will be starting again and again, though the marker is fixed.
That is due to the camera accepting some normal movements in air I guess.
To eliminate that I tracked the camera activityLevel as well.
Best
DD
Deepanjan Das
June 21, 2011 at 7:41 AM