Segmentation of railway transport images using fuzzy logic

  • 1 Physical, Technical and Computer Sciences Institute – Yuriy Fedkovych Chernivtsi National University, Chernivtsi, Ukraine
  • 2 Department "Wagon Engineering and Product Quality" – Ukrainian State University of Railway Transport, Kharkov, Ukraine


A prototype of a system for segmenting images of trains and wagons has been developed. Video cameras and specialized websites are used as the source of the original images. Median filtering of images and increase of their local contrast is carried out. The contours of the objects were calculated using the Sobel and Canny methods. Image segmentation is performed by the method of contour lines. As a result of the processing on the images of trains and wagons, meaningful areas (segments) were identified, for example, windows, headlights, etc. Detection of content areas of the object is performed using fuzzy membership functions. The hardware and software implementation of the computer system is made in Python using scipy and scikit-fuzzy libraries, the Google Colab cloud platform and Raspberry Pi 3B+ microcomputer.



  1. Roads Service. URL:
  2. Ukrzaliznytsia. URL: photogallery/gallery-265193/.
  3. Russ J.C. The Image Processing. Handbook. Abingdon-on- Thames, Taylor & Francis Group, 2011, 885 p.
  4. Image Segmentation. URL:
  5. The Unified Modeling Language. URL:
  6. Balovsyak S.V., Kravchenko H.O., Derevyanchuk O.V., Kroitor O.P., Tomash V.V. Computer system for increasing the local contrast of railway transport images. – Proc. SPIE, Fifteenth International Conference on Correlation Optics, V. 12126, 2021, P. 121261E1-7.
  7. Hooda D., Raich V. Fuzzy Logic Models and Fuzzy Control. An Introduction. Alpha Science International Ltd., Oxford, U.K., 2017. 408 p.
  8. Raspberry Pi Compute Module 3+. URL:
  9. Google Colab. URL:
  10. Thonny. Python IDE. URL:

Article full text

Download PDF