Geometrical features analysis by image processing

Jump to navigation Jump to search

A geometrical features analysis of FSSW by image processing has been conducted by Dr. Raheem Al-Sabur et al of the University of Basrah, who published a paper on [ “Machine learning algorithms for prediction of penetration depth and geometrical analysis of weld in friction stir spot welding process,”] which can be roungly summarised as follows:[1]

They conducted a geometrical features analysis by loading the given set of images onto the Google Collaboratory platform, to extract the statistical features by Python programming:

1. They converted the given RGB images of weld shapes to grayscale images.

2. They defined a particular scale, to track the size of a pixel while working on the weld image.

3. They conducted a denoising process, to obtain the threshold image to separate the boundaries of the weld from its surroundings.

4. They cleaned-up the image and created a mask is created for visualizing the zones covered by welding shapes.

5. They labelled the regions obtained from the masked image.

6. Finally they measured the geometrical features of the weld and imported available data in the format of an Excel spreadsheet.

7.The Python libraries for loading the images to the color library were imported for subjecting the images of the welding samples to the image processing algorithm, were as follows:

  • NumPy
  • cv2
  • pyplot from matplotlib
  • io
  • color

8. They labelled the image by assigning different color patches to each particular region

9. They defined a standard scale, where 1 pixel was equal to 1 micrometer.

10. To initiate the thresholding, they observed the histograms of the weld.

11. They flattened the image by converting the two-dimensional array of the picture into the one-dimensional array of the histogramm. The thresholding operation can be done by one of two types:

  • Manual thresholding
  • Auto thresholding

12. They masked the image, to convert the thresholded image to a binary image.

13. They eroded the thresholded image by reducing one pixel.

14. They dilated the thresholded image by adding one pixel.

15. They defined the nature of pixel connection, i.e., whether the pixels were connected or disconnected, they implemented the structure factor of [[1,1,1], [1,1,1], [1,1,1]].

16. They extracted the property from each weld shape region to obtain the geometrical features of the weld and listed the geometrical features for each region in a table with the following columns:

  • Sample Region
  • Area
  • Equivalent Diameter
  • Orientation
  • Major Axis Length
  • Minor Axis Length
  • Perimeter

The results showed that the used algorithms can be considered to calculate the area, major/minor axis lengths, and the perimeter of the FSSW samples.


  1. Abdulbaseer S. Bahedh, Akshansh Mishra, Raheem Al-Sabur and Ahmad K. Jassim: Machine learning algorithms for prediction of penetration depth and geometrical analysis of weld in friction stir spot welding process. Metall. Res. Technol. 119, 305 (8 June 2022).