Gray Level Homogeneity Analysis: A Novel Approach

In this article, we propose a method that helps us to analyze the homogeneity of gray levels locally by calculating a coefficient for each pixel based on the nature of neighboring pixels. This principle of encoding pixels according to their adjacent neighbors is described the nature of the distribution of gray levels within the image and measures their degree of homogeneity locally. This allows us to detect the different regions of the image and their contours based on the coefficient of homogeneity of the gray levels. In addition, this allows us to exploit these homogeneity coefficients to restructure regions of the image, extract and enhance the image contours while reducing the noise present in the image. This homogeneity study principle has several functions in the study and analysis of image texture, as do other methods of homogeneity assessment, such as the local contrast descriptor (LCD) and the co-occurrence matrix.

order to enhance texture analysis, this field has a number of noteworthy strengths.Local geometric primitives, random field modeling, and fractals are some of the techniques used; others are based on the analysis and characterization of pixel distribution, the measurement of gray level homogeneity, or statistical evaluation of texture.Among the methods of analysis in this context, we find: The co-occurrence matrix of gray levels (GLCM), often referred to as the Haralick method, (1) is a texture analysis approach that calculates the likelihood that two grayscale level pairings would coincide in an image.The statistical characteristics of this matrix can be used to assess the homogeneity of textures and pixels in a picture.There are many GLCM qualities that may be used to evaluate a texture's homogeneity.
The local contrast distribution is assessed using the LCD (local contrast distribution) approach. 2It is important for examining the homogeneity of pixels and textures since it lets you measure the variation of gray or color levels in various sections of the image.This method may be applied in many domains where texture analysis is essential, including computer vision, object identification, medical image processing, and other areas.
In this work, we propose a method for analyzing texture based on pixel encoding to characterize image texture by comparing the gray level of the central pixel with its eight neighbors.This principle focuses on studying the homogeneity of gray levels between different regions, allowing us to determine the pixel density at the same gray level. (3)This encoding method specifically focuses on the homogeneity of gray levels, which is more crucial than the LCD and Haralick methods.This is because each image has unique encoding coefficient, while the Haralick method's parameters are associated with distance and direction.In addition, our calculation method is simpler and less time-consuming than LCD and GLCM.These encoding coefficients will be used to detect image areas, improve weak contours, and reduce noise.This method can be applied in various areas, as we will discuss in this work.

Matrice CLH
The coding principle of the central pixel is the cardinal of the central pixel and its neighbors of the same gray level.The coding matrix that we will define for any image is as follows: A is the generated matrix, which can be called the matrix of coefficients of local homogeneity, as noted by CLH.
By definition, the coding matrix coefficients range from 1 to 9, with each coefficient corresponding to a model depicted in figure 1.The central pixel, possessing the highest coefficient, exhibits the greatest uniformity with its neighboring pixels.A coefficient of 9 signifies that the pixel matches the color of its neighbors, while coefficients 8 and 7 indicate a homogeneity level almost equivalent to coefficient 9.These three coefficients (9, 8, and 7) signify a notable uniformity in local gray levels.However, the 3x3 matrix surrounding central coefficients 1, 2, and 3 demonstrates lower homogeneity with its neighbors, representing a mixture of gray levels or noise.Particularly, coefficient 1 suggests a foreign pixel among its eight neighboring pixels. (4,5)egarding coefficients 4, 5, and 6, frequently located at region borders, with emphasis on index 6 being the most likely, these coefficients portray a 3x3 matrix as a region characterized by average homogeneity.

Representation of the matrix CLH
We can describe and distinguish image regions according to their homogeneity levels by applying the coefficients that are obtained from the CLH matrix.To effectively represent the matrix as an image, we propose to augment the coding coefficients in this framework.
Let A be the CLH matrix with: A (i,j) ∈ {1,...,9} The 255/8 scaling factor is utilized to increase the distance between homogeneity coefficients in order to visually highlight the smoothing change as a function of gray levels.The matrix serves as an efficient method for identifying boundaries within image shapes characterized by higher levels of gray level homogeneity.However, challenges arise when dealing with shapes exhibiting lower homogeneity.The resolution to this issue lies in the second-degree matrix, exemplified in image (c), which effectively delineates the boundaries of regions with lower homogeneity. (6)

Histogram of the matrix CLH
The quantitative distribution of coding coefficients, or the histogram of the CLH matrix, can help us understand the image's characteristics and more clearly illustrate how homogeneous a given pixel is with its neighbors.The coding coefficients, which show how homogeneous a pixel is with its neighbors, are displayed in the histogram.The coefficients that characterize the image's texture are presumably the most quantitative.This histogram analysis leads us to the conclusion that frequency coefficients of homogeneity can be used to categorize the nature of images. (7)At this point, we can define an indicator that, in general, captures the essence of the picture and use it to get a sense of the most common and likely homogeneity coefficients.The following is the indicator. (8,10) is the average rate of the coefficients of the CLH matrix, which means the homogeneity rate of pixels among themselves.

Detection of regions
Our endeavor involves employing the coefficients from the CLH matrix to identify image regions.By relying on these indicators, we can ascertain the texture of the image and delineate its component shapes based on homogeneity. (11,12,13,14)n this phase, we suggest a computation relying on the coding coefficients to bring grayscale levels into closer alignment with their neighbors and standardize their distribution.This algorithm is systematically applied in a recursive manner to a submatrix of dimensions 2x2.
In line with this principle, the suggested approach for delineating image regions through the coefficients of the CLH matrix in the new image is elucidated by the following formula: The formula for analyzing gray levels aids in precisely delineating the borders of regions characterized by similar gray level homogeneity.This enables the identification of distinct areas within the image, categorizing them as either having weak or strong homogeneity, and facilitating the differentiation of nearly identical regions. (15,17)

Improve weak contours
Various techniques such as Sobel, Roberts, and Prewitt (1,14,17) are commonly employed to identify image contours, presenting them in a straightforward and comprehensible manner.Several approaches exist to enhance the accuracy of detecting image contours. (11)The challenge at hand involves refining faint or imperceptible contours within the image, a prevalent issue in image processing, particularly in fields like radiography (in medicine), where meticulous analysis of image contours is crucial.The CLH matrix proves advantageous in addressing this concern by offering improvements to weak contours.The fundamental approach involves Data and Metadata.2023;2:170 4 applying a specific edge detection operator to the image processed through the coding matrix, as outlined in the preceding mathematical formula. (1)Below, we present comparisons of edge detection using the same operator (Sobel) on the original image and the image processed by CLH.The contours of the image processed by CLH are sharper and more distinct than the other thanks to the same Sobel mask; the masks that were used are: The operator uses convolution matrices.The matrix of size 3x3 will convoled with the image to calculate approximations of the horizontal and vertical derivatives.Let M be the initial image or the image processed by CHL matrix.
At each point, the horizontal and vertical gradient approximations can be combined as follows to obtain an approximation of the gradient norm:

Noise reduction
Image noise poses a significant challenge in the realm of image processing, prompting ongoing efforts to enhance image quality and recover lost information. (18,19)Consequently, researchers have dedicated considerable work to devising methods and techniques for noise removal from images, (7,10,18,20) striving to minimize noise and restore images closer to their original state.
At this juncture, we aim to employ our approach, which computes the average of gray levels based on the coefficients of the CLH matrix.Leveraging these coefficients allows us to identify pixels associated with the smallest coefficients, which can be deemed as noisy pixels.This distinction is crucial for determining the pixels to be addressed, contingent on the chosen homogeneity level for our computation.We retain the gray levels for pixels that exhibit greater homogeneity with their neighbors.The calculation formula is expressed as follows: with: (n,m)∈{-1,0,1} 2 and i+n>0 ,j+m>0 I the noisy image, A is the CLH matrix associated to the figure 1. c∈ {1, ..., 9} is the coefficient corresponding to the degree of homogeneity chosen for the pixels we will process.

RESULTS AND DISCUSSION
In this study, the homogeneity matrix of gray levels was used to detect and improve contours in texture analysis applications, as well as to improve contrast between image regions and reduce noise.
With regard to the image contour detection by the gray level homogeneity matrix, it is highly sensitive to variations in gray levels between the regions of the image and detects the contours for all variations, which can result in noise due to the large number of contours in the images, especially those that are non-homogeneous and have irregular areas.However, the importance of the homogeneity matrix lies in the detection of contours between regions with almost equal levels of gray and which cannot be distinguished by the naked eye, which is an important feature of the matrix of homogeneity compared to other methods of contour detection, as we will see through various examples on this subject. (21)ta and Metadata.2023;2:170 6 Note, for example, that the LCH matrix gives all the details about changing gray levels, which explains the large number of edges in some examples, unlike other methods that specify edges for areas concerned only in the image.The importance of the matrix lies in tracking all changes in the homogeneity of gray levels in the image.
For edge detection in images with nearly equal gray levels, it poses a significant challenge for conventional methods (Canny, Sobel, …).However, with the LCH matrix approach, contours between image regions can be identified, regardless of their differences, whether distinguishable by the naked eye or not.
With regard to improving the contours of an image using the CLH matrix, it is very excellent, thanks to which we can clearly show the weak contours in an image, as well as show the relatively invisible contours.This is a very important thing for medical imaging and in other areas.
The application of the CLH matrix extends to improving weak contours in images, particularly in medical imaging, where clear depiction of contours is crucial.The matrix proves effective in enhancing the visibility of subtle contours that may be challenging to identify with traditional edge detection operators.

CONCLUSION
In this study, we introduced the concept of computing the Local Homogeneity Coefficient matrix (LCH) as a metric for evaluating the local texture structure.This calculation is founded on relationships with neighboring pixels, providing an assessment of local gray level homogeneity.Our findings indicate that this approach effectively regulates image regions based on gray level homogeneity, particularly discerning contours in wellhomogeneous areas while enhancing faint or imperceptible contours.The method demonstrates sensitivity to variations in gray levels, proving adept at detecting contours between similar regions.In summary, CLH emerges as a promising solution for tasks such as texture analysis, contour detection, and noise reduction.

Figure 1 .
Figure 1.Coding of the pixel as a function of its adjacent neighbors

Figure 2 .
Figure 2. (a): original image, (b): image written by the CLH matrix associated with the original image, (c): image written by the CLH matrix associated with the image (b)

Figure 3 .
Figure 3.The histogram of the CLH matrix associated with the image

Figure 4 .
Figure 4.The histogram (first) reflects an average homogeneity with h=8, indicating that the corresponding image is more uniform.On the other hand, histogram (second) signifies an average homogeneity with h=1, suggesting that the image associated with this histogram exhibits lower homogeneity

Figure 5 .Figure 6 .
Figure 5. (a): initial image, (b): new image created by the initial image with its CLH matrix according to the mathematical formula (1)

Figure 7 .
Figure 7. Example of noise reduction with the choice c=5

Figure 8 .
Figure 8.Here are some examples of detection of the contours of some images by the CLH matrix and their comparison with the Canny method

Figure 9 .
Figure 9. Example of detection of contours between areas with almost equal levels of gray