An example of a picture with white rays:

alt text

    1 answer 1

    Option number 1:

    1. convert this image to binary: 1 is white, 0 is black.
    2. find the coordinates of all zero pixels
    3. convert these coordinates from Cartesian coordinates x, y to polar PHI (angle), RHO (distance from center)
    4. set the radius of the circle (arbitrary)
    5. select pixels for which RHO = R
    6. can be converted back to Cartesian and presented in the form of a binary image - it will be a dotted circle. on it you need to count the number of dashes.
      • mark up connected components and count their number

    option number 2.

    1. find the center where these rays come from.
    2. convert image to binary: 1 - white, 0 - black.
    3. set a circle of some radius in the found center
    4. paint all the points inside the circle in white (1) - this step is needed to remove the central region where the rays are close, because because of it, the markup of the connected components may not work exactly. This ensures that the pixels of the neighboring rays are not adjacent.
    5. mark up the connected components and count their number.