Access to history functions

Sep 28, 2010 at 5:16 PM
Edited Sep 28, 2010 at 5:16 PM

Hello,

 

is it possible, or will it be possible in a future version, to access history functions of ARToolkit ?

http://www.hitl.washington.edu/artoolkit/documentation/tutorialhistory.htm

to stop jittering effect.

 

Coordinator
Sep 28, 2010 at 7:20 PM

We actually use the history function already. There might be some tweaks necessary, but SLARToolkit is one of my multiple side projects and I don't have much time at the moment and won't have anytime soon to work on it. But I'm always open for contributions.

- Rene Schulte

Sep 30, 2010 at 8:19 AM
Edited Sep 30, 2010 at 8:20 AM

Thank you for the response.

Im' looking for a way to decrease the jittering effect ( very present on low quality web cams, or when marker is printed on glazed paper ).

I'm exploring two ways :

- keep an history of the lasts detections and eliminate noise

- supress the reflectsby applying filters (http://wpffx.codeplex.com/ ?) before marker detection

 

I'll feedback eventualy advances in my researches.

 

 

P.S. Scuse me for my poor english.

 

Coordinator
Sep 30, 2010 at 9:33 AM

I just remembered that there's already a feature request. http://slartoolkit.codeplex.com/workitem/6368 

Oct 7, 2010 at 9:53 AM
Edited Oct 7, 2010 at 10:05 AM

I decreased reflects by applying PixelShaders Effects on the captured image before Marker Detection

If someone is interested, it's very simple :

Use a BitmapMarkerDetector like explained here ( http://slartoolkit.codeplex.com/wikipage?title=Marker%20Detectors&referringTitle=Documentation )

 

    private void AttachEvent()
    {

      CompositionTarget.Rendering += (s, ea) =>
      {
        if (AR.Started)
          AR.CaptureSource.CaptureImageAsync();
      };

      AR.CaptureSource.CaptureImageCompleted += (s, e) =>
      {
        
        // Captured Image is stored in 2 different bitmaps
WriteableBitmap capturedBitmap = e.Result;
WriteableBitmap correctedBitmap = new WriteableBitmap(capturedBitmap);
        // Second bitmap is "Corrected" 
        BitmapCorrection(correctedBitmap);
       // and used for marker detection
ProcessMarkersDetection(correctedBitmap, capturedBitmap);
       // Original bitmap is Displayed
ViewportOverlay.Source = capturedBitmap;
      };
    }

 

Bitmap Correction

Create your own effect with this excellent tutorial :
http://blogs.msdn.com/b/coding4fun/archive/2010/05/25/10014965.aspx

http://timheuer.com/blog/archive/2009/09/02/silverlight-pixel-shader-compile-options.aspx

    private void BitmapCorrection(WriteableBitmap bitmap)
    {
      Image tempImg = new Image();
      // use your own PixelShader effect created 
 		
      tempImg.Effect = new AnyPixelShaderEffect();
      // Add effect settings (my effect modify contrast and saturation to decrease reflects due to glazed paper) 	
      tempImg.Effect.ContrastLevel = AnyValue;...
tempImg.Effect.SaturationLevel = AnyValue;...
tempImg.Source = bitmap; bitmap.Render(tempImg, null); bitmap.Invalidate(); tempImg.Source = null; tempImg.Effect = null; }

Marker Detection :
    private void ProcessMarkersDetection(WriteableBitmap correctedBitmap, WriteableBitmap displayBitmap)
    {
      // Markers detection is done on "corrected Bitmap"
      var detectedResults = AR.BitmapDetector.DetectAllMarkers(correctedBitmap);
      foreach (var r in detectedResults)
      {
        // Square are drawn on "display bitmap" ("corrected" and "display" bitmaps must be the same size )
        displayBitmap.DrawQuad((int)r.Square.P1.X, (int)r.Square.P1.Y,
               (int)r.Square.P2.X, (int)r.Square.P2.Y,
               (int)r.Square.P3.X, (int)r.Square.P3.Y,
               (int)r.Square.P4.X, (int)r.Square.P4.Y, Colors.Red);
      }
    }

Hope it'll help
   

 

Coordinator
Oct 7, 2010 at 10:31 AM

Thanks for this input. It is a good idea for some special cases.

Ans thanks for the compliment about the excellent article. :)

- Rene Schulte