1

I have images such as below (I am pasting only a sketch here) where I want to calculate the center of symmetry and the displacement between the 2 marked zones in the image(Marked in Red and blue). Could anyone suggest a simple algorithm for this? (Please note the signal is symmetric to 180-degree rotation).

The idea is to calculate the center of symmetry between the red and blue zones

iyer
  • 11
  • 3

1 Answers1

0

Here is my algorithm approach:

  1. Distinguish the red and blue pixels in the image by thresholding: Lets say set the blue pixels to wihte(255) and set the red pixels(0) and set the rest of image to the (125) in a gray channel image.
  2. Check all of the pixels horizontally in the middle row of the image.
  3. While you are checking, if you hit the red pixel, then try to search blue one. However, if you hit red pixel again, then start searching blue again.
  4. During the search after red pixel if you hit a blue pixel then you can easiy calculate the middle of it. Then re-start the process.

Here is a demonstration of search line:

enter image description here

Note: Since they are dashed lines, luckily you may pass them with gaps. To fix, this you can try couple of random different rows.

Yunus Temurlenk
  • 4,085
  • 4
  • 18
  • 39