|
Algorithm 3: Image noise enhancement algorithm based on mean filtering |
|
Input: image kernel_size |
|
Output: enhanced_image |
| 1: functionenhance_noise_with_average_filter(image, kernel_size) |
| 2: height, width = image.shape |
| 3: Creates a blank image of the same size as the original image. |
| 4: Gets the height and width of the image. |
| 5: Performs noise enhancement on the image. |
| 6: for y = 0 to height − 1 do
|
| 7: for x = 0 to width − 1 do
|
| 8: Calculate the boundary coordinates of the filter. Assume that the coordinates of the computational boundary are .
|
| 9: The average value is calculated for the pixels within the filter.
|
| 10: The average value is used as the enhanced pixel value.
|
| 11: end for
|
| 12: end for
|
| 13: return enhanced_image |
| 14: end function
|