[go: up one dir, main page]

Next Article in Journal
IMPACT: A Dataset for Integrated Measurement of Performance and Contextual Task-Related Effects
Previous Article in Journal
Assessment of Tomato Quality through Near-Infrared Spectroscopy—Advantages, Limitations, and Integration with Multivariate Analysis Techniques
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Performance Evaluation of Recursive Mean Filter Using Scilab, MATLAB, and MPI (Message Passing Interface) †

by
Hristina Andreeva
and
Atanaska Bosakova-Ardenska
*
Department Computer Systems and Technologies, University of Food Technologies, 4002 Plovdiv, Bulgaria
*
Author to whom correspondence should be addressed.
Presented at the International Conference on Electronics, Engineering Physics and Earth Science (EEPES’24), Kavala, Greece, 19–21 June 2024.
Eng. Proc. 2024, 70(1), 33; https://doi.org/10.3390/engproc2024070033
Published: 8 August 2024

Abstract

:
As a popular linear filter, the mean filter is widely used in different applications as a basic tool for image enhancement. Its main purpose is to reduce the noise in an image and thus to prepare the picture for other image-processing operations depending on the current task. In the last decade, the amount of data, particularly images, that has to be processed in a variety of applications has increased significantly, and thus the usage of effective and fast filtering algorithms has become crucial. The aim of the present research is to identify what type of software (MATLAB, Scilab, or MPI-based) is preferred for reducing the filtering time and consequently save energy. Thus, the aim of the present research corresponds to actual trends in information processing and corresponds to green computing concepts. A set of experimental images divided into two groups—one for small images and a second one for big images—is used for performance evaluation of the recursive mean filter. This type of linear filter was chosen due to its very good denoising characteristics. The filter is implemented in MATLAB and Scilab environments using their specific commands and it is also implemented using the C language with the MPI library to provide the opportunity for parallel execution. Two mobile computer systems are used for experimental performance evaluation and the results indicate that the slowest filtering execution is registered when Scilab is used and the fastest execution is achieved when MPI is used with the C implementation. Depending on the amount and size of the images that have to be filtered, this study formulates advice for achieving effective performance throughout the whole process of working with images.

1. Introduction

Image filtering is a process of transformation that can be performed in the frequency or spatial domains in order to prepare input images for the next processing steps, allowing their quality to be enhanced in the first level of processing, which is known as primary image processing [1]. The main purpose of filtering is noise reduction, which is crucial for the next processing steps, especially when a variety of factors related to registering and transmitting systems can influence the image’s quality. Depending on the building techniques employed, hardware or software implementations of different types of filters can be designed. Hardware filtering implementations are preferred for real-time applications due to their effectiveness regarding time consumption [2,3]. On the other hand, software implementations of filtering operations provide a lot of opportunities for the design of specific filters and for easily combining them and other algorithms in the field of digital image processing [4]. In recent years, based on the fast evolution of computational technologies, a lot of software tools have been developed for easily designing and implementing fast and user-oriented image-processing applications, such as libraries for image processing that can be included in complex software environments, libraries for parallel processing that can accelerate image processing, etc. Another branch in computer programming that is related to open-source initiatives also involves growing opportunities for the design of tailor-made image-processing applications based on open-source software, such as ImageJ [5], Scilab [6], and others. Thus, a lot of image-processing algorithms are designed and implemented in ImageJ or Scilab environments to support a variety of scientific and industrial applications in diverse human activities, such as microbiology [7], metallurgy [8], the production of food granules [9], agriculture [10], the healthcare industry [11], and many others.
The aim of the current research is to evaluate the performance of the recursive mean filter when implemented in Scilab, in MATLAB, and in C with the MPI (Message Passing Interface) library. This filter is not implemented as a part of the standard libraries in Scilab and MATLAB software and the C language, and thus the abilities of discussed software in relation to the design, implementation, and effective performance of user-defined functionalities will be compared and assessed.

2. Materials and Methods

In order to present reproducible results regarding the evaluation of the time performance of the recursive mean filter implemented using Scilab and MATLAB software as well as in a parallel implementation with C and MPI, we must describe all used materials and methods. Thus, the next three subsections describe the recursive mean filter, its three implementations using the discussed software and tools, the sets of images that are used for experimental performance evaluation, the studied computer systems (as hardware and software settings), and the functions that are used for time measurement.

2.1. Recursive Mean Filter

In the spatial domain, linear filtering is related to the direct manipulation of every image pixel (by default, without those pixels that are located in the picture’s borders), and this manipulation could be described as a convolution between an input image and the filter’s function.
g(x,y) = T[f(x,y)].
This process is defined by Equation (1), where g(x,y) is the filtered image, f(x,y) is the input (original) image, and T is an operator over neighborhood pixels of the current pixel.
The mean filter is often implemented using a square matrix (known as a mask, kernel, or window) that has an odd size, meaning that the currently processed pixel falls under the central element of the mask and the new value of this pixel is calculated as the average of all pixels falling under the mask. When pixels that are used for new value calculation are those that have already been updated by the mask movement (beginning from the left upper corner of the image), then the filtering process is known as recursive filtering [1]. This approach supposes the usage of parts of the image that have already been processed (i.e., whose noise is reduced) when calculating the new values for currently processed pixels, and its effectiveness in comparison with other known denoising algorithms has been proven by Erkan et al. using PSNR (Peak Signal-to-Noise Ratio) and SSIM (Structural Similarity) metrics [12]. The advantages of the RMF (recursive mean filter) are also exploited when developing locally adaptive filters for 3D image processing [13]. Over the years, a variety of techniques have been applied to accelerate the RMF’s time performance, such as its implementation based on DSP (Digital Signal Processing) architectures [14], the usage of GPU (Graphics Processing Unit) architectures [15], reducing the time complexity using an edge-aware approach [16], the usage of hybrid MPP (Massively Parallel Processors) architecture [17], etc.

2.2. Implementations of the RMF

2.2.1. RMF’s Implementation in Scilab

Scilab is an open-source, cross-platform computational environment software that is the free version of copyrighted software such as MATLAB. For image processing, it is necessary to install an additional toolbox containing built-in functions. Scilab was written in C/C++, Java, and Fortran and it works under GNU/Linux, Windows, and Mac OS X operating systems. After the program code is written, it is stored in a file with the extension .sce [18]. The discussion in this paper is based on the Scilab release 6.1.1 for 64-bit systems.
Figure 1 shows the code used for the Scilab implementation of the RMF program. After reading the directory where the images are located, a tlist of type “dir” with the field’s name, date, and bytes was created. The syntax construction “s = I1.name(cc)” was used to retrieve the full path and the names of the files, where cc is the sequence number of the image in the folder. Then, the size of the mask was set (mSize), and the width and height of the image—mOffset (mSize/2) and mSquare (mSize*mSize) values needed for the applied processing—were calculated and stored in variables. To calculate the new values of each pixel, variables of type uint(32) were used to store the sum of the R, G, and B components. It is necessary to use this data type because these sum values are large and the standard 8-bit format does not have a sufficient capacity for such large numbers. After calculating the value of each pixel and obtaining the filtered image, it was saved to a new file in a pre-defined directory. The image-filtering time was also measured and saved in a log file.

2.2.2. RMF’s Implementation in MATLAB

MATLAB is a software that has many built-in tools for problem-solving and developing graphical illustrations, and some toolboxes can be added to augment these functions (for example, image processing and computer vision). The simplest method of MATLAB usage is interactive. It is also possible to write scripts and programs using MATLAB, which are groups of commands that are executed sequentially. After the program code is written, it is stored in a file with the extension .m [19]. The discussion in this paper is based on the free 30-day-trial version of the MATLABR2024a release for 64-bit systems.
Figure 2 shows the code used for the implementation of the RMF program in MATLAB. The syntax of commands and functions in MATLAB is almost identical to that in Scilab. There are some minor differences in the data type of variables. After reading the directory where the images are located, a variable of type “struct” was created. This data type is a structure array that groups related data using data containers called fields with names and values. To read the image, it is necessary to extract the filename from the structure using the construction “pr = I1(cc,1)”, and then concatenate the path and name into a single string using the syntax construction “s = strcat(str,pr.name)”. The size of the mask was set and the width, height, mSize, mOffset, and mSquare values needed for the applied processing were calculated and stored in variables. To calculate the new values of each pixel, variables of type double(32) were used to store the sum of the R, G, and B components. This double type was used because when summing and dividing the values of the pixels falling under the mask, only the whole part of the obtained result is taken. If the uint(32) type is used, as it is in the Scilab code, the program automatically rounds the obtained results and erroneous results are obtained. After calculating the value of each pixel and obtaining the filtered image, it was saved to a new file in a pre-defined directory. The image-filtering time was also measured and saved in a log file.

2.2.3. RMF’s Implementation with C and MPI

For the purpose of the current study, we used an implementation of the parallel RMF based on the algorithm “Conveyer processing” [17], which is described in an AMPA (Agenda Model for Parallel Algorithms [20]) in Figure 3. The discussed parallel algorithm was implemented in C using MPI, which is a library established in professional practice for communication among parallel processes [21]. The version of MPI used in the research is Microsoft MPI v10.0. Distribution of the data (input image) among the parallel processes is carried out by columns which allow the step-by-step starting of each parallel process after the previous parallel process has filtered its part of the current row. This concept means that the process Pi+1 will start its work immediately after the process Pi has sent updated values of the border pixels that are necessary for process Pi+1. In other words, process P1 will start its work after the process P0 has filtered (N/P−k/2 ) pixels located on the first row, where N is the number of columns of the image, P is the number of parallel processes, and k is the mask size; process P2 will start its work after the process P1 has filtered (N/P−k/2) pixels located on the first row; etc. This model of work-starting is similar to the work of an instruction conveyer in the central processor, which is the reason that this parallel algorithm is named “Conveyer processing”.
Once the main process (“Master” in Figure 3) distributes parts of the image among the slave processes, every parallel process (including the Master process) executes the function “filterMean(WINBMPPIXEL* data, u_int32_t height, u_int32_t width, u_int16_t mSize, u_int16_t prID, u_int16_t prCnt)”, which implements row-by-row communication to transfer the updated pixel values that are necessary for calculations [17]. Therefore, when the mask size increases, the amount of exchanging new pixel values also increases, which will influence the time performance.

2.3. Experimental Settings

Two sets of images were chosen for experimental time performance evaluation of the discussed three implementations of the RMF. The first set, named “Small images”, contains five color images in BMP (Bitmap) format that have sizes ranging from 364 × 239 pixels to 400 × 600 pixels. The second set, named “Big images”, contains five color images in BMP format that have sizes ranging from 3641 × 2393 pixels to 4000 × 6000 pixels. Detailed information about these two sets is presented in Table 1. The BMP format for experimental images was chosen due to its popularity in a wide range of scientific and practical applications, which is based on its ability to store original color information without any changes (i.e., this format is data-lossless) [22].
Two mobile computer systems (laptops) with multi-core architectures were used for the performance evaluation of the described three implementations of the RMF. Their parameters are presented in Table 2.
In the present research, we measured four parts of the programs’ overall execution (see Table 3).
In MATLAB and Scilab, time measurement was performed identically. We set the point at which the time measurement started using the tic() function, and the measurement was ended by assigning the function toc() to a variable. The measured time in seconds was stored in this variable. One variable was created containing the time to read the image, a second variable was created to measure the filtering time (t1), and a third variable stored the time for writing the filtered image in a file. To determine the time t2, the three measured times were added together. The measured times were logged into a text file.
To measure values for t1 and t2 for the RMF implemented in C within MPI, two variables were used in the source code of the parallel application. The measured times were logged into a text file. The t3 and total values were registered using the system function “time()” into the code of the script files (Windows batch files) and their values were also logged into a text file. Two batch files were developed—one for processing all images into a specified folder and a second that processed only one file (image). The script for the batch processing of the entire directory had three parameters—the name of the directory (its location), the number of parallel processes, and the mask size. For parallel algorithms, the most commonly used metric for performance evaluation is the speed-up factor [23], and this was used in the present research. It is a ratio of the time taken for serial processing versus the time taken for parallel processing.

3. Results and Discussion

To test the performance of the RMF implemented in three different environments, the two computer systems and two sets of images described above were used. Different values for the mask size and number of parallel processes were used to examine the algorithm implemented with C in MPI. Measurements were made with mask sizes of 3 × 3, 5 × 5, and 7 × 7, the number of parallel processes used was 1, 2, 4, and 8, and the results are averaged values of 10 measurements for each combination of input parameters. For each combination of input parameters and implementations of the RMF in Scilab and MATLAB, 10-time measurements were made and the obtained results were averaged.
The obtained values for the time t1 for the implementations of the RMF in Scilab, MATLAB, and with C in MPI (one process) using the set “Small images” are presented graphically below (Figure 4). Two scales are used because the times obtained for Scilab are much larger than the others. The results obtained for the implementation of the RMF in Scilab use the second (right) scale and they are plotted with a dashed line. The x-axis shows the sizes of the images in kb.
The obtained values for the time t2 for the RMF implementations in Scilab, MATLAB, and with C in MPI (one process) using the set “Small images” are presented graphically below (Figure 5). The results obtained for the implementation of the RMF in Scilab use the second (right) scale and they are plotted with a dashed line.
It is observed that the time for filtering (t1) and the time for processing one image (t2—including input image reading, filtering, and storing the output image) are smaller when PC1 is used in comparison with the values measured on PC2. These results could be attributed to the higher clock frequency of the PC1 processor in comparison with the clock frequency of the PC2 processor. Another observation is related to the performance of the RMF in the Scilab environment and its performance in the MATLAB environment, where the time for execution in Scilab exceeds this time in MATLAB by about two times. These results could be explained by the presence of a JIT (just-in-time) compiler in MATLAB which accelerates the overall execution of user-defined calculations [24]. As a common observation, increasing the size of the processed image leads to an increase in time for filtering in all RMF implementations, which corresponds to an increased computational complexity due to the relation between the number of pixels and the number of calculation operations that are necessary for image filtering. When the mask size increases, the time for processing increases too because the number of summing-up operations that have to be performed for calculating the new values of every pixel also increases (if the mask size is 3 then the number of necessary summing-up operations is 8; if the mask size is 5 then the number of necessary summing-up operations is 24; if the mask size is 7 then the number of necessary summing-up operations is 48; etc.). It can be noticed that the differences in the measured values for t1 and t2 when the “Small images” dataset is processed are small, because when the image is small, its opening and storing (after filtering) require small processing time.
The obtained values for the time t1 for Implementation of the RMF in MATLAB and with C in MPI (one process) when using the set “Big images” are presented graphically below (Figure 6). Due to the very large time values obtained when testing the RMF’s implementation in Scilab, no tests were conducted with the “Big images” set in Scilab.
The obtained values for the time t2 for the implementations of the RMF in MATLAB and with C in MPI (one process) when using the set “Big images” are presented graphically below (Figure 7). It is observed that when the image size and mask size increase, the measured times for filtering and for image processing (including input image reading, filtering, and storing the output image) also increase. The overall performance of PC1 regarding the RMF’s execution using MATLAB and with C in the MPI implementation is better than PC2’s performance due to its better parameters.
Table 4 presents the average time for filtering (t1) and the average time for image processing (t2) for all images that are part of the “Big images” set for the RMF’s implementations in MATLAB and using C in the MPI library. It is observed that the measured values for t1 and t2 on PC1 are about 2.28 times faster and about 2.32 times faster, respectively, in comparison with the measured values on PC2 when the RMF is implemented in MATLAB with a mask size of 3 × 3. This acceleration decreases to 1.68 and 1.7, respectively, when the mask size of 5 × 5 is used, and decreases to 1.61 and 1.62, respectively, when the mask size of 7 × 7 is used. Regarding the performance of the RMF when implemented with C in MPI (execution of one process), it can be noticed that PC1 again exceeds PC2, and the registered acceleration for t1 and t2, respectively, is about 2.02 and 2.71 for the 3 × 3 mask size, 1.79 and 2.48 for the 5 × 5 mask size, and 1.67 and 2.23 for the 7 × 7 mask size when PC1 is used. It is obvious that the performance of the RMF implemented with C in MPI is faster than the performance of the RMF in MATLAB (Table 4)—the time for filtering (t1) using the mask size of 3 × 3 in the C-with-MPI implementation of the RMF is 10.65 times smaller than the time for filtering in the MATLAB implementation when PC1 is used, and 12.05 times smaller than the time for filtering in the MATLAB implementation when PC2 is used. This big difference could be explained by differences in the mechanism of execution for both RMF implementations—the RMF implemented with C and MPI is compiled into executable code, whereas the RMF implemented in MATLAB is executed through interpretation. Regarding the time for image processing (t2), it can be noticed that the measured time using the 3 × 3 mask size in the C-with-MPI RMF implementation is 2.51 times smaller than the measured time in the MATLAB RMF implementation when PC1 is used and 2.13 times smaller than the measured time in the MATLAB RMF implementation when PC2 is used. These smaller differences for t2 in comparison with t1 regarding performance on PC1 in comparison with performance on PC2 could be explained by the presence of I/O operations as a part of the t2 measurement.
The calculated values for the speed-up factor of all measured times for the implementation of the RMF with C in MPI using the “Small images” set are presented graphically in Figure 8. It is observed that the calculated values for the speed-up factor are not very high because there are no big differences between the time taken for processing and the time taken for the communication that is necessary for every parallel process to perform its work, which could be explained by the small size of the processed images.
The calculated values for the speed-up factor of all measured times for the implementation of the RMF with C in MPI when using the set “Big images” are presented graphically in Figure 9. It can be noticed that the speed-up factor is the biggest when images of the “Big images” dataset are processed for both computer systems used in these experiments. Another observation is related to values of the speed-up factor for the t1, t2, t3, and total time measurements, which indicate that the biggest values are calculated for t1, whereas the values for the other three measurements are similar to each other and completely different to those for t1 (they are about three times smaller). This great difference could be explained by the presence of I/O operations as a part of the t2, t3, and total measurements, and by the inclusion of the time taken for maintenance of the parallel processes.
Table 5 presents the obtained total times for a selected folder for each combination of implementation of the RMF and mask size on both computers using the set “Small images”. For experiments on PC1, it is observed that the best time performance for the mask size of 7 × 7 is measured for the execution of the RMF implemented with C in MPI using two parallel processes, and the worst time performance is measured for the execution of the RMF implemented in Scilab, with the worst time performance being about 2154.19 times slower than the best time performance. The results for PC2 are worse in comparison with those for PC1 due to the reasons that were discussed earlier. Regarding the mask size, it can be noticed that when the mask size increases, the time for image processing increases too for all implementations of the RMF and for both computer systems.
Table 6 presents the obtained total times for a selected folder and for each combination of implementation of the RMF and mask size on both computers using the set “Big images”. For experiments on PC1, it is observed that the best time performance for the mask size of 3 × 3 is measured for the execution of the RMF implemented with C in MPI using eight parallel processes, and the worst time performance is measured for the execution of the RMF implemented in MATLAB, with the worst time performance being about 2.68 times slower than the best time performance. Again, the results for PC2 are worse in comparison with these for PC1, which is expected. It is obvious that usage of eight parallel processes is effective only if big images are processed due to the use of the recursive type of image processing. Regarding the mask size, it can be noticed that when the mask size increases then the time for processing increases too for all implementations of the RMF and for both computer systems, which is a trend similar to that observed when the set “Small images” is processed.

4. Conclusions

Three implementations of the RMF based on different software products are examined in this study. As a convolutional operation, filtering in a spatial domain involves the performance of many arithmetic operations to calculate new values for all pixels in a processed image. This is the main reason for the choice that one of the discussed RMF implementations is capable of parallel image processing. The other two RMF implementations discussed here were based on specialized software products for scientific and engineering applications (Scilab and MATLAB), because the importance of science and engineering technology currently necessitates continuous research in order to improve its capabilities. Using two mobile computer systems with multi-core architecture, a series of experimental performance evaluation analyses were made for all discussed RMF implementations, based on two datasets of images that were grouped according to their sizes. As we expected, the best time performance was registered for the RMF implemented in C within MPI. The worst time performance was observed for the RMF’s implementation in Scilab, and the main reason for this result is the mechanism used for executing user-defined programs in Scilab (wherein the execution process is based on interpretation). Regarding the influence of mask size on the time for execution, it could be noticed that when the size of the mask increased, the time for filtering increased too, and the results indicate that this increase was bigger when the RMF was implemented in MATLAB in comparison with the other two presented RMF implementations. The experimental results that are related to the parallel execution of the RMF indicate a slight increase in the speed-up factor observed with increasing mask sizes for both sets of images. For the set “Small images”, the highest value of the calculated speed-up factor was obtained with four processes, and for the set “Big images”, this value was obtained with eight processes.
Regarding our experimental results, it can be concluded that user-defined image-processing operations for high-resolution images are not appropriate for real-time applications based on Scilab or MATLAB due to the high time costs of their performance. Thus, image-processing operations implemented in C should be preferred when fast execution is needed and the MPI library should be used for achieving the best performance results, allowing the energy consumption to be reduced also.
Our future work will continue with an exploration into the opportunities for incorporating a fast user-defined filter for image processing implemented in C using MPI in the Scilab, and MATLAB environments.

Author Contributions

Conceptualization, methodology, software, validation, formal analysis, investigation, resources, A.B.-A. and H.A.; data curation, A.B.-A.; writing—original draft preparation, H.A. and A.B.-A.; writing—review and editing, A.B.-A.; visualization, H.A. and A.B.-A.; supervision, A.B.-A.; project administration, A.B.-A.; funding acquisition, A.B.-A. All authors have read and agreed to the published version of the manuscript.

Funding

The APC was funded by University of Food Technologies (Science Fund).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Any data not contained within this article can be provided by the authors on request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Gonzalez, R.C.; Woods, R.E. Digital Image Processing, 4th ed.; Pearson Education: New York, NY, USA, 2018. [Google Scholar]
  2. Huang, I.; Chang, C.; Lin, M.; Chen, H.; Kuang, S. Hardware Implementation of an Efficient Guided Image Filter for Underwater Image Restoration. Int. J. Signal Process. Syst. 2017, 5, 94–99. [Google Scholar] [CrossRef]
  3. Draz, H.H.; Elashker, N.E.; Mahmoud, M.M.A. Optimized Algorithms and Hardware Implementation of Median Filter for Image Processing. Circuits Syst. Signal Process. 2023, 42, 5545–5558. [Google Scholar] [CrossRef]
  4. Coady, J.; O’Riordan, A.; Dooly, G.; Newe, T.; Toal, D. An Overview of Popular Digital Image Processing Filtering Operations. In Proceedings of the 2019 13th International Conference on Sensing Technology (ICST), Sydney, NSW, Australia, 2–4 December 2019; pp. 1–5. [Google Scholar] [CrossRef]
  5. Schneider, C.A.; Rasband, W.S.; Eliceiri, K.W. NIH Image to ImageJ: 25 years of image analysis. Nat. Methods 2012, 9, 671–675. [Google Scholar] [CrossRef] [PubMed]
  6. Fabbri, R.; Bruno, O.M.; Costa, L.D. Scilab and SIP for Image Processing. arXiv 2012, arXiv:1203.4009. [Google Scholar]
  7. Danev, A.M.; Gabrova, R.N.; Yaneva-Marinova, T.; Angelov, A.I. Application possibilities of open-source software for microbiological analyses. Bulg. Chem. Commun. 2018, 50, 239–245. [Google Scholar]
  8. Agra, A.A.; Nicolodi, A.; Flores, B.D.; Flores, I.V.; da Silva, G.L.; Vilela, A.C.; Osório, E. Automated procedure for coke microstructural characterization in imagej software aiming industrial application. Fuel 2021, 304, 121374. [Google Scholar] [CrossRef]
  9. Boruczkowski, T.; Boruczkowska, H.; Drożdż, W.; Miszczak, M.; Leszczyński, W. Use of ImageJ Software for Assessment of Mechanical Damage to Starch Granules. Processes 2022, 10, 630. [Google Scholar] [CrossRef]
  10. Dewi, T.; Rusdianasari, R.; Kusumanto, R.D.; Siproni., S. Image Processing Application on Automatic Fruit Detection for Agriculture Industry. In Proceedings of the 5th FIRST T1 T2 2021 International Conference (FIRST-T1-T2 2021), Palembang, Indonesia, 20–21 October 2021. [Google Scholar] [CrossRef]
  11. Sharma, G. A Study of Open Source Toolkits of Image Processing for Healthcare Industry. Glob. J. Res. Eng. 2017, 17, 27–33. [Google Scholar]
  12. Erkan, U.; Engınoğlu, S.; Thanh, D.N.H. A Recursive Mean Filter for Image Denoising. In Proceedings of the 2019 International Artificial Intelligence and Data Processing Symposium (IDAP), Malatya, Turkey, 21–22 September 2019; pp. 1–5. [Google Scholar] [CrossRef]
  13. Kountchev, R.; Mironov, R.; Kountcheva, R. Analysis of the Recursive Locally-Adaptive Filtration of 3D Tensor Images. Symmetry 2023, 15, 1493. [Google Scholar] [CrossRef]
  14. Robelly, J.; Cichon, G.; Seidel, H.; Fettweis, G. Implementation of recursive digital filters into vector SIMD DSP architectures. In Proceedings of the 2004 IEEE International Conference on Acoustics, Speech, and Signal Processing, Montreal, QC, Canada, 17–24 May 2004; p. V-165. [Google Scholar] [CrossRef]
  15. Chaurasia, G.; Ragan-Kelley, J.; Paris, S.; Drettakis, G.; Durand, F. Compiling high performance recursive filters. In Proceedings of the 7th Conference on High-Performance Graphics (HPG ‘15) 2015, Los Angeles, CA, USA, 7–9 August 2015; Association for Computing Machinery: New York, NY, USA, 2015; pp. 85–94. [Google Scholar] [CrossRef]
  16. Chi, Y.; Chan, S.H. Fast and Robust Recursive Filter for Image Denoising. In Proceedings of the IEEE International Conference on Acoustics. Speech and Signal Processing (ICASSP), Calgary, AB, Canada, 15–20 April 2018; pp. 1708–1712. [Google Scholar] [CrossRef]
  17. Bosakova-Ardenska, A.; Petrov, S.; Vasilev, N. Implementation of parallel algorithm “conveyer processing” for images processing by filter ‘mean’. In Proceedings of the 2007 International Conference on Computer Systems and Technologies (CompSysTech ‘07), Rousse, Bulgaria, 14–15 June 2007; pp. 1–6. [Google Scholar] [CrossRef]
  18. Heriansyah, R.; Utomo, W.M. Performance Evaluation of Digital Image Processing by Using Scilab. JUITA J. Inform. 2021, 9, 239–247. [Google Scholar] [CrossRef]
  19. Attaway, D.C. MATLAB: A Practical Introduction to Programming and Problem Solving; Butterworth-Heinemann: Oxford, UK, 2013. [Google Scholar]
  20. Bosakova-Ardenska, A. One approach for parallel algorithms representation. Balk. J. Electr. Comput. Eng. 2017, 5, 30–33. [Google Scholar] [CrossRef]
  21. Atanassov, E.; Gurov, T.; Karaivanova, A.; Ivanovska, S.; Durchova, M.; Dimitrov, D. On the parallelization approaches for Intel MIC architecture. AIP Conf. Proc. 2016, 1773, 070001. [Google Scholar] [CrossRef]
  22. Tan, L. Image file formats. Biomed. Imaging Interv. J. 2006, 2, e6. [Google Scholar] [CrossRef]
  23. Ene, D.; Anireh, V.I. Performance Evaluation of Parallel Algorithms. SSRG Int. J. Comput. Sci. Eng. 2022, 9, 10–14. [Google Scholar] [CrossRef]
  24. Baudin, R. Run Time Comparison of MATLAB. Scilab and GNU Octave on Various Benchmark Programs. 2016. Available online: http://roland65.free.fr/benchmarks/benchmarks-0.2.pdf (accessed on 22 May 2024).
Figure 1. Code implementing the RMF in Scilab.
Figure 1. Code implementing the RMF in Scilab.
Engproc 70 00033 g001
Figure 2. Code implementing the RMF in MATLAB.
Figure 2. Code implementing the RMF in MATLAB.
Engproc 70 00033 g002
Figure 3. “Conveyer processing” parallel algorithm.
Figure 3. “Conveyer processing” parallel algorithm.
Engproc 70 00033 g003
Figure 4. Time t1 for the set “Small images” with (a) a mask size of 3; (b) a mask size of 5; (c) a mask size of 7.
Figure 4. Time t1 for the set “Small images” with (a) a mask size of 3; (b) a mask size of 5; (c) a mask size of 7.
Engproc 70 00033 g004
Figure 5. Time t2 for the set “Small images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Figure 5. Time t2 for the set “Small images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Engproc 70 00033 g005
Figure 6. Time t1 for the set “Big images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Figure 6. Time t1 for the set “Big images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Engproc 70 00033 g006
Figure 7. Time t2 for the set “Big images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Figure 7. Time t2 for the set “Big images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Engproc 70 00033 g007
Figure 8. Speed-up factor for the set “Small images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Figure 8. Speed-up factor for the set “Small images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Engproc 70 00033 g008
Figure 9. Speed-up factor for the set “Big images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Figure 9. Speed-up factor for the set “Big images”: (a) mask size 3; (b) mask size 5; (c) mask size 7.
Engproc 70 00033 g009
Table 1. Information about datasets of images.
Table 1. Information about datasets of images.
ImageSmall ImagesBig Images
Resolution [pixels]Size [kb]Resolution [pixels]Size [kb]
1364 × 2392553641 × 239325,529
2396 × 2823283961 × 282532,786
3450 × 3124124281 × 297737,341
4340 × 5105093200 × 480045,001
5400 × 6007044000 × 600070,313
Table 2. Parameters of computer systems.
Table 2. Parameters of computer systems.
NameCPUCoresMemoryOS
(PC1) Lenovo IdeaPad Gaming 3Intel(R) Core(TM) i5-11320H CPU
@ 3.20GHz 3.20 GHz, 11th GEN
88 GBWindows 10 Pro, 64 bits
(PC2) Dell Inspiron N5110Intel(R) Core(TM) i7-2670QM CPU
@ 2.20GHz 2.20 GHz
88 GBWindows 10 Pro, 64 bits
Table 3. Measured parts of each programs’ execution.
Table 3. Measured parts of each programs’ execution.
NameDescriptionRMF in Scilab RMF in MATLABRMF in
C within MPI
t1Time for filtering excluding operations read/write filestic() toc()tic() toc()MPI_Wtime()
t2Time for filtering including operations with filestic() toc()tic() toc()MPI_Wtime()
t3Total time for the execution of processes for filtering one image--time()
totalTotal time for filtering one dataset of imagestic() toc()tic() toc()time()
Table 4. Average times for the set “Big images”.
Table 4. Average times for the set “Big images”.
MATLABC with MPI (1 Process)
3 × 35 × 57 × 73 × 35 × 57 × 7
PC1Avg. t1 [s]5.8613.1023.630.551.252.36
Avg. t2 [s]6.1213.3623.892.443.144.26
PC2Avg. t1 [s]13.3722.0338.141.112.243.93
Avg. t2 [s]14.1222.7638.856.627.789.48
Table 5. Total time per folder for the set “Small images”.
Table 5. Total time per folder for the set “Small images”.
Mask SizeMATLABScilabC with MPI
1 Process2 Processes4 Processes8 Processes
PC13 × 30.332235.501.031.011.081.24
5 × 50.702286.451.061.041.101.26
7 × 71.222391.151.141.111.141.29
PC23 × 30.684647.072.592.502.582.84
5 × 51.264766.002.832.752.783.01
7 × 72.084952.173.132.933.003.21
Table 6. Total time per folder for the set “Big images”.
Table 6. Total time per folder for the set “Big images”.
Mask SizeMATLABC with MPI
1 Process2 Processes4 Processes8 Processes
PC13 × 330.6113.1311.8811.4611.43
5 × 566.8216.6113.6712.6712.39
7 × 7119.4422.2216.5414.5013.64
PC23 × 370.5835.9033.3532.3432.19
5 × 5113.7941.8136.4033.7033.86
7 × 7194.2350.4441.1736.3636.23
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Andreeva, H.; Bosakova-Ardenska, A. Performance Evaluation of Recursive Mean Filter Using Scilab, MATLAB, and MPI (Message Passing Interface). Eng. Proc. 2024, 70, 33. https://doi.org/10.3390/engproc2024070033

AMA Style

Andreeva H, Bosakova-Ardenska A. Performance Evaluation of Recursive Mean Filter Using Scilab, MATLAB, and MPI (Message Passing Interface). Engineering Proceedings. 2024; 70(1):33. https://doi.org/10.3390/engproc2024070033

Chicago/Turabian Style

Andreeva, Hristina, and Atanaska Bosakova-Ardenska. 2024. "Performance Evaluation of Recursive Mean Filter Using Scilab, MATLAB, and MPI (Message Passing Interface)" Engineering Proceedings 70, no. 1: 33. https://doi.org/10.3390/engproc2024070033

Article Metrics

Back to TopTop