Thursday, June 30, 2022

Case study: The target




In this case study, we want to count the number of points obtained in this shooting session.



Here is our test image (Fig.1) but if you want to work on a real image, go to your favorite search engine... Of course, you need to enhance your image (Brightness/Contrast, Noise removal, and Subtract Background) before applying a segmentation to get something similar to Fig. 1.
Fig.1: The target and the shots.
Note: In this project, we need the X,Y coordinates of the objects centroids. Thus, go to Analyze > Set Measurements and check the Centroid parameter.

1. Extract the shots


The first step is to get the center of your target because, usually, the target isn't well centered in the picture. From Fig.1, run a Analyze > Analyze Particles... and check the Include Holes.


Second, we focus on the shots. Remove the circles of the target. For that, an opening (Process > Binary > Open...) is perfect for that...(Fig.2).

Fig.2: Shots after Opening (Mathematical Morphology operation).


Then, you open the dialog window Analyze > Set Measurements... and select Centroid and re-run a Analyze > Analyze Particles...

Fig.3: Results of Analyze > Analyze Particles...

 2. Extract the concentric rings

Now, to extract the rings, a skeletonize is the perfect operation Process > Binary > Skeletonize  for that followed by a Analyze Particles.. to get the center and diameter of each circle.

Fig.4: After skeletonization, the rings of the target are extracted and the shots have disappeared.

To get the measurements of the rings, go to Analyze > Set Measurements... and select Centroid for the XY-coordinates of the center and Feret to get the diameter, then re-run Analyze Particles... (Fig. 5). 

Fig.5: XY-coordinates (columns X and Y)  and diameters (column Feret) of the corresponding rings.


In conclusion, we have a rather simple way to separate the shots from the circles mainly with mathematical morphology operations.

If you want to continue the exploration of this image, you can count the number of points in this target by writing a simple JS script. This will be discussed in a next post.

3. Calculating the scores

The purpose of this small exercise is to count the final score of the target of Fig. 1 according to the rings scores of Fig. 6.

Fig. 6: Scores used for the calculation of the total/

 

Note: When the shot is overlapping two rings, only the ring covered by the most important area of the shot is taken into account.


 Thank you for reading.

4. Other crazybiocomputing posts

Further readings are available in ...
  • Analysis Series  [Link]
  • Image Processing TOC [Link]

No comments:

Post a Comment