Answers.Body: <blockquote>
    <p>Do not understand how genetic algorithms are used in stereo matching.</p>
  </blockquote>
  
  <p>The first paper referenced in the question is <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.473.6886&amp;rep=rep1&amp;type=pdf" rel="nofollow noreferrer"><em>Stereo matching using genetic algorithm with adaptive chromosomes</em></a>, Kyu-Phil Han, Kun-Woen Song, Eui-Yoon Chung, Seok-Je Cho, Yeong-HoHac, 2000. It summarizes an approach this way. </p>
  
  <ol>
  <li><p>An individual is a disparity set,</p></li>
  <li><p>A chromosome has a 2D structure for handling image signals efficiently, and</p></li>
  <li><p>A fitness function is composed of certain constraints which are commonly used in stereo matching.</p></li>
  </ol>
  
  <p>The paper also states, "Genetic algorithms are efficient search methods based on principles of population genetics, i.e. mating, chromosome crossover, gene mutation, and natural selection." The extension to genetic algorithm purity is contained in this statement in the paper.</p>
  
  <blockquote>
    <p>To improve the convergence, an informed generation, that a higher selected possibility is assigned to the chromosome including a smaller intensity difference, is adopted. The informed generation uses several random generations plus a selection. In a random generation, only a value is randomly generated. Yet, the informed generation of the proposed algorithm selects the gene which has the minimum intensity difference among the randomly generated genes.</p>
  </blockquote>
  
  <p>The question inquires along a few lines.</p>
  
  <blockquote>
    <p>Does it mean that an individual is a disparity map with random numbers?</p>
  </blockquote>
  
  <p>The goal is to produce order from chaos through successive mutations, combinations, and tests, arriving at genetic code that represents distances of objects that correspond to a left region of pixels and a right region of pixels. Those two regions are identified through alignment of brightness categories, with some permissible sprinkling of outliers.</p>
  
  <p>An individual in this context is a simulation of a sample from a population with a particular aggregation of genetic codes. The codes indicate disparity between matching image features in the left and right images, measured in horizontal pixels.</p>
  
  <blockquote>
    <p>[Don't] understand how this works and even WHY you should use genetic algorithm on an algorithm that at its simplest form uses 5 for loops.</p>
  </blockquote>
  
  <p>The five loops referenced in the question, <a href="https://github.com/davechristian/Simple-SSD-Stereo" rel="nofollow noreferrer"><em>in the source at github.com/davechristian/Simple-SSD-Stereo</em></a>, are as follows.</p>
  
  <pre><code>for y in range(kernel_half, h - kernel_half):
      for x in range(kernel_half, w - kernel_half):
          for offset in range(max_offset):
              for v in range(-kernel_half, kernel_half):
                  for u in range(-kernel_half, kernel_half):
  </code></pre>
  
  <p>This exhaustive search has gross shortcomings in relation to the genetic algorithm with informed generation.</p>
  
  <ul>
  <li><p>The simulation of meiosis in genetic algorithms is essentially a search for hybrids where the best genetic sequences of two parents are preserved in the offspring.</p></li>
  <li><p>Genetic algorithms are easy to scale across computer clusters without developing specialized hardware acceleration.</p></li>
  <li><p>Components of failed compositions are not eliminated in an exhaustive search, so there is considerable redundancy in trials.</p></li>
  </ul>
  
  <p>The second paper referenced in the question is <a href="https://arxiv.org/pdf/1410.2474.pdf" rel="nofollow noreferrer"><em>Genetic Stereo Matching Algorithm with Fuzzy Fitness</em></a>, Haythem Ghazouani, 2014. It proposes, "To get around [convergence speed] limitations, we propose a new encoding for individuals, more compact than binary encoding and requiring much less space. This approach and the use of three lightness classes is shared with the methodology of the first paper.</p>
  
  <p>This second paper introduces fuzzy matching and the use of the Sobel gradient norms to penalize (dismiss) pixels which project onto uniform regions, [and are therefore] less significant pixels. This paper also provides some comparison results with Han's, Dong's, and Nguyen's algorithms as define in the second paper's bibliography.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-22T03:59:50.173Z
Answers.LastActivityDate: 2019-01-22T03:59:50.173Z
Answers.UserDisplayName: Douglas Daseeco
Answers.Body: <p>This is what  I understood so far from the paper in <a href="https://arxiv.org/abs/1410.2474" rel="nofollow noreferrer">arxiv</a> named "Genetic Stereo Matching Algorithm with Fuzzy Fitness":</p>
  
  <p>Let's say we have 2 images (left and right taken by a stereo camera) of size 28x28. 
  The images are in grey scale. </p>
  
  <p>The individual becomes a disparity map. Let's say, we look at the pixel at row 2, column 3 and it has a number 5. That means that the pixel at (2,3) on the left image (<em>reference image</em>) corresponds to the pixel at (2, 8) on the right image (<em>target image</em>). </p>
  
  <p>The author of the paper created three classes black, average, and white pixels classes where they take the 0, 127.5, and 255 values respectively in the grey image scale. </p>
  
  <p>Then the author calculates the likelikehood of each pixel on both left and right images belonging to the same class by calculating the mean and standard deviation of the class in consideration. </p>
  
  <p>The matching possibility metric is calculated by choosing the max likelikehood of both images belonging to the same class. </p>
  
  <p>Author also added Sobel gradient normalization to the fitness value. </p>
  
  <p>Genetic operators seem to work in an easy way where you just swap some parts of the individual (disparity map) with another disparity map to create new individuals and the mutation is just randomly changing the number in the disparity map. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-21T10:25:21.803Z
Answers.LastActivityDate: 2019-01-21T10:25:21.803Z
Answers.UserDisplayName: Gabriele
Body: <p>I have been reading a few papers (<a href="https://www.sciencedirect.com/science/article/abs/pii/S003132030000114X" rel="nofollow noreferrer">paper1</a>, <a href="https://arxiv.org/abs/1410.2474" rel="nofollow noreferrer">paper2</a>) on stereo matching using genetic algorithms. I understand how genetic algorithms work in general and how stereo matching works, but I do not understand how genetic algorithms are used in stereo matching. </p>
  
  <p>The first paper by Han et al says that "1) individual is a disparity set, 2) a chromosome has a 2D structure for handling image signals efficiently, and 3) a fitness function is composed of certain constraints which are commonly used in stereo matching".</p>
  
  <p>Does it mean that an individual is a disparity map with random numbers?
  Then a chromosome is a block within the individual's disparity map. 
  The constraint used for fitness function could be the famous epipolar line. </p>
  
  <p>I dont seem to understand how this works and even <em>WHY</em> you should use genetic algorithm on an algorithm that at its simplest form uses 5 for loops, for example, like in <a href="https://github.com/davechristian/Simple-SSD-Stereo/blob/master/stereomatch_SSD.py" rel="nofollow noreferrer">here</a>.</p>
  
Tags: <genetic-algorithms>
Title: Stereo matching using genetic algorithm
UserDisplayName: Gabriele
ThreadText: # Stereo matching using genetic algorithm
  
  (Asked by: username_0 on 2018-12-29)
  
  I have been reading a few papers ([paper1](https://www.sciencedirect.com/science/article/abs/pii/S003132030000114X), [paper2](https://arxiv.org/abs/1410.2474)) on stereo matching using genetic algorithms. I understand how genetic algorithms work in general and how stereo matching works, but I do not understand how genetic algorithms are used in stereo matching.
  
  The first paper by Han et al says that "1) individual is a disparity set, 2) a chromosome has a 2D structure for handling image signals efficiently, and 3) a fitness function is composed of certain constraints which are commonly used in stereo matching".
  
  Does it mean that an individual is a disparity map with random numbers?
  Then a chromosome is a block within the individual's disparity map.
  The constraint used for fitness function could be the famous epipolar line.
  
  I dont seem to understand how this works and even *WHY* you should use genetic algorithm on an algorithm that at its simplest form uses 5 for loops, for example, like in [here](https://github.com/davechristian/Simple-SSD-Stereo/blob/master/stereomatch_SSD.py).
  
  **Tags:** genetic-algorithms
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-01-22. Score: 2
  
  Do not understand how genetic algorithms are used in stereo matching.
  
  The first paper referenced in the question is Stereo matching using genetic algorithm with adaptive chromosomes, Kyu-Phil Han, Kun-Woen Song, Eui-Yoon Chung, Seok-Je Cho, Yeong-HoHac, 2000. It summarizes an approach this way. 
  
  An individual is a disparity set,
  A chromosome has a 2D structure for handling image signals efficiently, and
  A fitness function is composed of certain constraints which are commonly used in stereo matching.
  
  The paper also states, "Genetic algorithms are efficient search methods based on principles of population genetics, i.e. mating, chromosome crossover, gene mutation, and natural selection." The extension to genetic algorithm purity is contained in this statement in the paper.
  
  To improve the convergence, an informed generation, that a higher selected possibility is assigned to the chromosome including a smaller intensity difference, is adopted. The informed generation uses several random generations plus a selection. In a random generation, only a value is randomly generated. Yet, the informed generation of the proposed algorithm selects the gene which has the minimum intensity difference among the randomly generated genes.
  
  The question inquires along a few lines.
  
  Does it mean that an individual is a disparity map with random numbers?
  
  The goal is to produce order from chaos through successive mutations, combinations, and tests, arriving at genetic code that represents distances of objects that correspond to a left region of pixels and a right region of pixels. Those two regions are identified through alignment of brightness categories, with some permissible sprinkling of outliers.
  An individual in this context is a simulation of a sample from a population with a particular aggregation of genetic codes. The codes indicate disparity between matching image features in the left and right images, measured in horizontal pixels.
  
  [Don't] understand how this works and even WHY you should use genetic algorithm on an algorithm that at its simplest form uses 5 for loops.
  
  The five loops referenced in the question, in the source at github.com/davechristian/Simple-SSD-Stereo, are as follows.
  for y in range(kernel_half, h - kernel_half):
      for x in range(kernel_half, w - kernel_half):
          for offset in range(max_offset):
              for v in range(-kernel_half, kernel_half):
                  for u in range(-kernel_half, kernel_half):
  
  This exhaustive search has gross shortcomings in relation to the genetic algorithm with informed generation.
  
  The simulation of meiosis in genetic algorithms is essentially a search for hybrids where the best genetic sequences of two parents are preserved in the offspring.
  Genetic algorithms are easy to scale across computer clusters without developing specialized hardware acceleration.
  Components of failed compositions are not eliminated in an exhaustive search, so there is considerable redundancy in trials.
  
  The second paper referenced in the question is Genetic Stereo Matching Algorithm with Fuzzy Fitness, Haythem Ghazouani, 2014. It proposes, "To get around [convergence speed] limitations, we propose a new encoding for individuals, more compact than binary encoding and requiring much less space. This approach and the use of three lightness classes is shared with the methodology of the first paper.
  This second paper introduces fuzzy matching and the use of the Sobel gradient norms to penalize (dismiss) pixels which project onto uniform regions, [and are therefore] less significant pixels. This paper also provides some comparison results with Han's, Dong's, and Nguyen's algorithms as define in the second paper's bibliography.
  
  
  ---
  
  ### Answer by username_0 on 2019-01-21. Score: 1
  
  This is what I understood so far from the paper in [arxiv](https://arxiv.org/abs/1410.2474) named "Genetic Stereo Matching Algorithm with Fuzzy Fitness":
  
  Let's say we have 2 images (left and right taken by a stereo camera) of size 28x28.
  The images are in grey scale.
  
  The individual becomes a disparity map. Let's say, we look at the pixel at row 2, column 3 and it has a number 5. That means that the pixel at (2,3) on the left image (*reference image*) corresponds to the pixel at (2, 8) on the right image (*target image*).
  
  The author of the paper created three classes black, average, and white pixels classes where they take the 0, 127.5, and 255 values respectively in the grey image scale.
  
  Then the author calculates the likelikehood of each pixel on both left and right images belonging to the same class by calculating the mean and standard deviation of the class in consideration.
  
  The matching possibility metric is calculated by choosing the max likelikehood of both images belonging to the same class.
  
  Author also added Sobel gradient normalization to the fitness value.
  
  Genetic operators seem to work in an easy way where you just swap some parts of the individual (disparity map) with another disparity map to create new individuals and the mutation is just randomly changing the number in the disparity map.
  
  
  ---
  
  