title: Comparing textures with OpenCV and Gabor Filters
body: <p>As part of a project, I'm trying to measure how similar are 2 textures sampled from an image. (I take 2 squared samples of about 40 x 40 px).</p>
  
  <p>After I take the samples, I pass them to a bank of Gabor filters (with 2 filter sizes and 6 orientations) so now I have 12 filter outputs for each sample. </p>
  
  <p>The objective is to compute a <strong>metric</strong> that tells us <strong>how similar 2 textures are</strong>, in such a way that if the 2 samples are wood or brick, the metric score is low (the difference is small) but if 1 sample is rock and other is fabric then the metric should be high (the textures are very different).</p>
  
  <p>The question is: <strong>How could I measure the texture difference using this outputs?</strong>
  I was suggested to create a distribution of the outputs for each sample and then measure the distance between the 2 distributions, but I just have no idea of how to do that.</p>
  
  <p>The filters look something like (tough not exactly): </p>
  
  <p><img src="https://www.robots.ox.ac.uk/~vgg/research/texclass/figs/with/mr8filters.jpg" alt="Filter bank"></p>
  
  <p>The output looks something like this (I borrowed this image just as an example)</p>
  
  <p><img src="https://i.stack.imgur.com/9xPrQ.jpg" alt="enter image description here"></p>