OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Is there a better and more efficient way to identify clusters from an image?

  • Thread starter Thread starter yahya ashraf
  • Start date Start date
Y

yahya ashraf

Guest
So I have a video of moving bacterias which I have converted to images. Now I have to find the clusters of bacterias in each image. We define two neighboring bacteria as members of the same cluster if their centers of mass are separated by less than a distance R and if their motion directions differ by less than an angle alpha. A dynamic cluster is defined to include all bacteria that are connected to at least one other bacterium that satisfies the local distance and motion direction criteria.

This is a sample image:

enter image description here

I first stored the coordinates of the COM and angle of each contour in a dictionary. I identify the first contour and make it a standard. Then I check for another contour which is closest to the first contour and its angle differs by the least value. If this is within the given criteria then they both are in group 1. Then the second contour becomes the new standard and this process is repeated till there are no other contours which satisfy the criteria. All of these contours are then said to belong in group 1. This process is again repeated to form other groups. But my question is, is there easier way to do this? My method takes a lot of time and is not accurate. Is there a better algorithm or function to do the same?
<p>So I have a video of moving bacterias which I have converted to images. Now I have to find the clusters of bacterias in each image. We define two neighboring bacteria as members of the
same cluster if their centers of mass are separated by less than a distance R and if their motion directions differ by less than an angle alpha. A dynamic cluster is defined to include all bacteria that are connected to at least one other bacterium that satisfies the local distance and motion direction criteria.</p>
<p>This is a sample image:</p>
<p><a href="https://i.sstatic.net/6H35XwXB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6H35XwXB.png" alt="enter image description here" /></a></p>
<p>I first stored the coordinates of the COM and angle of each contour in a dictionary. I identify the first contour and make it a standard. Then I check for another contour which is closest to the first contour and its angle differs by the least value. If this is within the given criteria then they both are in group 1. Then the second contour becomes the new standard and this process is repeated till there are no other contours which satisfy the criteria. All of these contours are then said to belong in group 1. This process is again repeated to form other groups. But my question is, is there easier way to do this? My method takes a lot of time and is not accurate. Is there a better algorithm or function to do the same?</p>
 

Latest posts

Top