Image alignment & finding symmetry with DFO

This week we are continuing working with SDS and DFO, but we are shifting our focus on a new set of problems.


An interesting topic we discussed in the lecture was how SDS could be used for image alignment.


Say we have two images as our search space and we want our SDS system to find a specific section of our image, we then want to align it section with the other image.


One way we can do this is to take our selected part of our search space and split this selected section up into multiple segments. Each segments will then work as our micro features, just like we did for our locations within our hills from last week's post.


One way of simplifying it would be to use each pixel within our selected section as our micro features, but we can also grab a larger area and take the average of all the pixel values within that area.


By using this technique we can find the pixel values and we can align the images based on the matched pixel values.


We also discussed another topic for SDS and DFO to solve, this topic became the problem to solve in this week's lab. Our assigned problem was to find symmetry in an image using either SDS or DFO.


There are many ways to solve this problem and there is also many ways of approaching it.
What type of symmetry are we trying to find? Are we looking for horizontal, vertical or diagonal symmetry?


Let’s go through how we could approach vertical symmetry.


The first step of the algorithm is to select a random y position within our 2D search space where 0,0 is in the middle of the image.
From this position we check for another random position in our x-axis which is our delta x.
Because we are looking for symmetry, we also need to look for the same random x value but in the opposite direction.


Let’s say our y position randomly lands is 50. From this point we check our x position which randomly lands on 25. This means that we also need check our delta x at - 25.


By grabbing the pixel values from position (25, 50) and position (-25, 50) we can calculate these pixel values and If the pixel values are the same we can make a hypothesis about if we have found symmetry. The image below illustrated how one agent for example could check for symmetry.



Because we are using DFO, we have multiple agents and all these calculation will happen for every single agent. Even though we find symmetry we will still have agents that randomly will check the search space for a more optimal solution. For this example our population of flies will be clustering in the center of the image.





Comments

Popular posts from this blog

Physical Computing, Final Project

Dispersive Flies Optimisation ( DFO )

No Free Lunch Theorem