banner



How To Make A Template Size Invariant Matlab

I'thousand looking for a method for calibration and rotation invariant Template matching. I already tried some, but they didn't work so good for my examples or took for ever to execute . SIFT and SURF Feature detection failed totally. I also tried to implement a Log-Polar Template Matching role, but I never finished (didn't know exactly how to).

In these Manufactures (the get-go is in german)

http://cvpr.uni-muenster.de/educational activity/ss08/seminarSS08/downloads/Wentker-Vortrag.pdf

http://world wide web.jprr.org/index.php/jprr/commodity/viewFile/355/148

I read about that method. Mapping the polar coordinates worked, but I don't know if it'due south right. The Images look like this.

source_log_polar.png http://www.shareimages.com/images/pics/0/0/three/62394-pZSfl5WenZysnpyVnKg-source_log_polar.png

template_log_polar.png

And later on matching these two images with OpenCV'southward Template Matching office i got that event

match_log_polar.png

Now I don't how to proceed.

My templates are ever simple symbols in building blueprints and the blueprints itself. The symbols can differ in size and orientation.

For example my simple blueprint:

enter image description here

And my template

enter image description here

In this example there is simply i template, merely in the blueprints it should find all occurrences, even the ones with sizes and/or orientations.

Does anyone have an approach how I could solve this?

Edit:

An addition to Andrey's approach. The distance capturing algorithm for a radial profile. (Using EmguCV)

          private float[] getRadialProfile( Image<Gray, byte> epitome, Point centre, int resolution )  {   var roi = image.ROI;   if ( !roi.Contains( center ) )   {    return zip;   }   var steps = resolution;  var degreeSteps = 360 / (double)resolution;  var data = image.Data;  var peak = 0.0f;  var bottom = double.MaxValue;  var bottomIndex = 0;  var width = roi.Width;  var elevation = roi.Acme;  var minX = roi.X;  var minY = roi.Y;   float[] distances = new float[resolution];  for ( var i = 0; i < steps; i++ )   {    var caste = i * degreeSteps;    var radial = degree * Math.PI / 180.0;    var dy = Math.Sin( radial );    var dx = Math.Cos( radial );     var x = (double)center.X;    var y = (double)center.Y;     while ( truthful )     {     ten += dx;     y += dy;     if ( ten >= minX + width || y >= minY + height || x <= minX || y <= minY )      {       x = -1;       y = -ane;       break;      }     var pixel = data[(int)y, (int)x, 0];     if ( pixel == 0 )      {       break;      }     }      float distance = 0.0f;     if ( x != -1 && y != -ane )     {       distance = (bladder)Math.Sqrt( Math.Pow( (center.X - x), two ) + Math.Pow( (center.Y - y), two ) );     }      distances[i] = distance;     if ( altitude > superlative )     {       peak = distance;     }     if ( altitude < bottom )     {       lesser = distance;       bottomIndex = i;     }    }      // Scale invariance. Split past elevation    for ( var i = 0; i < distances.Length; i++ )    {      distances[i] /= peak;    }      // rotation invariance, shift to lowest value    for ( var i = 0; i < bottomIndex; i++ )    {      distances.ShiftLeft(); // Just rotates the array nothing special    }     render distances; }                  

How To Make A Template Size Invariant Matlab,

Source: https://dsp.stackexchange.com/questions/6194/scale-and-rotation-invariant-template-matching

Posted by: covarrubiaswheyed.blogspot.com

0 Response to "How To Make A Template Size Invariant Matlab"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel