Brightness Equalization Algorithm for Chinese Painting Pigments in Low-Light Environment Based on Region Division

—With the promotion and development of Chinese painting and the advancement of photography technology, people can appreciate various types of Chinese paintings through image and other methods. However, Chinese painting images in low-light environments face the problem of extreme uneven brightness distribution. The currently proposed solutions for this problem are not sufficient. Therefore, this research proposes a brightness equalization algorithm for Chinese painting pigments in low-light environments based on region division. This algorithm also utilizes guided filtering for image denoising. In performance testing, the proposed method has a runtime of 16.63 seconds under a scaling factor of 1 and a runtime of 8.37 seconds under a scaling factor of 0.1, which are the fastest among the compared algorithms. In simulation experiments, the brightness equalization value of the proposed method is 198.93, which is listed at the best among all the compared algorithms. This research provides a valuable research direction for the brightness equalization of Chinese painting pigments.


I. INTRODUCTION
In the process of promoting Chinese painting, pigments are one of the most visually impactful elements for viewers, as they directly determine the visual effects of the artwork [1].However, due to the limitations of low-light environments, Chinese paintings in low-light scenes may face the problem of uneven pigment brightness, which affects the visibility and artistic quality of the artwork to some extent.A low-light environment refers to an environment with dim lighting or insufficient light sources [2].In such environments, due to the scarcity and weakening of light, details in the image are difficult to display clearly, and the differences in pigment brightness become more pronounced.This significantly affects the appreciation of Chinese paintings by viewers.At present, the processing methods for low light images include image enhancement, noise removal, and multi frame image fusion, which can be divided into two approaches: hardware and software.However, the focus is mainly on software upgrades and improvements [3].Due to the uneven lighting in the shooting environment, the brightness of captured images may be uneven, with some areas appearing too bright while others are too dark.Existing brightness equalization algorithms not only enhance the noise in the image but also have issues with inconsistent equalization across different regions [4].
Therefore, this research proposes a brightness equalization algorithm for Chinese painting pigments in low-light environments based on region division.This study will provide reference and guidance for the application of region-based brightness equalization algorithms in the field of Chinese painting pigment brightness equalization and other related fields.The research is divided into five sections: an overview of the research in Section I, a review of domestic and foreign studies in Section II, a study on the algorithm's methodology in Section III, performance testing of the algorithm in Section IV, and a summary and outlook on the limitations of this research in Section V.

II. LITERATURE REVIEW
Researchers have focused on using image region division techniques to improve image enhancement methods.Matsuyama E proposed a segmentation method for chest X-ray images.This method can automatically remove the scapular region, mediastinal region, and diaphragm region from various chest X-ray images as the learning data for this method.The method uses a simple linear iterative clustering algorithm and local entropy filtering to generate an entropy map, which is then subjected to morphological operations to perform region segmentation on the lung image.The method was tested, and the results showed that it can remove non-pulmonary markings from the image and present clear X-ray images of the lungs [5].Chen et al. found that the evaluation metrics of existing iris segmentation algorithms may be influenced by inaccurate localization of the Ground Truth image.Therefore, researchers proposed using a mask image segmented based on deep learning algorithms as a substitute for the Ground Truth image.Experimental results showed that the mask image segmented based on deep learning algorithms can completely replace the original Ground Truth image [6].Cao et al. found that existing line art coloring methods can produce credible coloring results, but these methods are often affected by color bleeding issues.Therefore, researchers proposed an explicit segmentation fusion mechanism.Testing outcomes shows that the model can better fulfill the coloring instructions given by the user and can greatly alleviate the problem of color bleeding artifacts [7].
Image enhancement methods are applicable in various fields, and researchers have made many improvements to these methods.Tirumani et al. found that existing image enhancement methods have unstable effects on contrast and resolution enhancement.Therefore, researchers process the resolution of the image, and then used auto optimization to enhance the resolution and brightness.Testing outcomes showed that this method can effectively and stably enhance the resolution and contrast of the image [8].Xu et al. proposed a multi-scale fusion framework for low-light image enhancement.This framework first generates multiple artificially multi-exposure images using a mapping function, then combines exposure to create a weight map, and finally fuses different frequency bands of the image.Testing outcomes showed that this method outperforms existing algorithms in enhancing low-light images [9].Lu et al. believed that the current image enhancement methods based on convolutional neural network models do not differentiate image features on different channels, which hinders the learning of hierarchical features.Therefore, researchers proposed a channel-split attention network that can analyze shallow features in a targeted manner by splitting them into residual and dense branches.Experimental results showed that this method exhibited excellent performance in both qualitative and quantitative evaluations [10].
In summary, although region division methods have been applied in multiple fields, their combination with image enhancement for brightness equalization of Chinese painting pigments is relatively rare.Therefore, this research proposes a brightness equalization algorithm for Chinese painting pigments in low-light environments based on region division, providing effective technical support for the promotion of Chinese painting.

III. REGION-BASED BRIGHTNESS EQUALIZATION ALGORITHM FOR CHINESE PAINTING PIGMENTS IN LOW-LIGHT ENVIRONMENTS
Chinese painting images in low-light environments often suffer from uneven lighting in the pigment display [11].Traditional image brightness equalization algorithms have limitations in achieving sufficient brightness equalization and enhancing all local details [12].To address this issue, this research proposes a region-based brightness equalization algorithm for Chinese painting pigments in low-light environments.This algorithm improves existing image enhancement algorithms and provides effective assistance in the refinement of image enhancement algorithms.

A. Single-Frame Image Brightness Equalization Enhancement Method in Low-Light Environments
Images in image processing come in various formats, including RGB, LAB, YUV, HSV, HIS, etc.The main image format studied in this research is HSV.In this research, the RGB image is first converted to the HSV image.In HSV, H represents the hue of the image, S represents the saturation, and V represents the value or brightness of the image.The advantage of the HSV format is that the color information of the image does not affect the brightness component, which ensures that the original colors of the image are preserved during brightness enhancement.The schematic diagram of an HSV image is shown in Fig. 1.
In Fig. 1, a cone shape is hired to manifest the HSV color space, where the hue is determined by the rotation angle around the center of the cone, with each 120° representing a different color.The closer to the center of the cross-section, the less saturated the color is, and the closer to the apex of the cone, the weaker the brightness.The conversion of RGB to HSV is represented by Eq. (1).In Eq. ( 1), , , R G B represent the three primary colors in the RGB color space, where R means red, B represents blue, and G represents green.The converted S value is represented by Eq. (2).

{ }
min , , , 0 In Eq. ( 2), V represents the value obtained from Eq. (1 In Eq. ( 3), R represents the R value in the RGB.The brightness of an HSV image is divided into different levels [13].The average brightness range of the V channel is [0,1] .An empirical threshold th I is set, and when the average brightness of an image is below this threshold, the image is considered a high-brightness image.Therefore, the brightness range of high-brightness images is [ ,1] th I . For the enhancement of high-brightness images, the focus is mainly on enhancing the contrast [14].Since the enhancement results of high-brightness images are similar to those of low-brightness images, this research converts high-brightness images to low-brightness images for enhancement and then converts them back to high-brightness images after enhancement [15].The formula for obtaining the limited brightness image is represented by Eq. ( 4).lim , 1 , In Eq. ( 4), lim I represents the limited brightness channel image, v I represents the V channel image extracted after converting from RGB to HSV, and v I represents the average brightness of the V channel image.The brightness region division of the image in this research is divided into four steps.The first step is the initial enhancement of the limited V channel image, and the enhancement formula is represented by Eq. ( 5).
2 lim log ( 1) In Eq. ( 5), lim I represents the limited V channel image, and F represents the image after initial enhancement.The region segmentation of the image in this research is divided into four steps.The second step is the binarization of the multi-scale image [16].Two different binarization methods are used for the edges and region shapes of the image.The first binarization method first applies mean filtering to the image F after initial enhancement to obtain the neighborhood mean value of each pixel.Then, the brightness value is divided by the neighborhood mean value, and the result is compared with the adaptive sensitivity factor T .Finally, the binarized V channel brightness image is obtained.The calculation process is represented by Eq. ( 6).
In Eq. ( 6), ( , ) F x y represents the brightness value of each pixel, and 1 1 ( , ) represents the neighborhood mean value.The second binarization method subtracts the mean filtering image from F , and then subtracts a constant C to obtain the difference image sm I .Then, based on the pixel values of I, binarization is performed to obtain a binary image containing texture boundaries.The calculation process is represented by Eq. ( 7).
In Eq. ( 7), ( , ) sm I x y represents the pixel values of the image sm I .The second step of region image processing is fusion, which involves merging the two binarized images obtained earlier to create a new binary image.The fusion formula is shown in Eq. ( 8).

_1
_ 2 binary binary binary In Eq. ( 8), ⊕ represents the logical AND operator.The third step is noise reduction using morphology.The fourth step is region segmentation.The specific operation involves first marking the boundaries of the denoised regions, and then dividing the image into multiple regions and assigning them numbers based on the marked content.The schematic diagram of image segmentation is shown in Fig. 2.
In Fig. 2, the images from left to right are the original image, the two binarized images, the fused image obtained from the fusion calculation of the two binarized images, the denoised binary image, and the segmented image.Due to the significant brightness differences between different regions in images with uneven lighting, targeted brightness adjustment is needed [17].The image is marked based on the different brightness levels in different regions, and the marking rule is shown in Eq. ( 9).min ( ) 0.5, 2 ,

Fusion
Denoising Partition The first type of binarization In Eq. ( 9), i represents the index of the region, min i V represents the minimum brightness value in that region, and i V represents the average brightness of that region.

B. Image Brightness Equalization Enhancement Method Based on Region Denoising
Denoising is an important step in image enhancement.Currently, there are various denoising methods, including bilateral filtering-based denoising, Gaussian filtering-based denoising, and linear guided filtering-based denoising [18].The denoising method based on bilateral filtering is computationally complex and slow.The denoising method based on Gaussian filtering tends to blur the edges of the denoised image and result in unclear presentation of image details.The denoising method based on linear guided filtering produces clear edges in the denoised image without artifacts and has a faster computation speed.Therefore, in this research, the guided filtering method is used for image denoising.The workflow of the guided filtering denoising method is shown in Fig. 3.
q aI b = + Fig. 3. Guiding the workflow of filtering and noise reduction methods.
In Fig. 3, the workflow of guided filtering includes a guidance image I , an input image p , and an output image q .The guidance image can be pre-set based on different application scenarios, but it can also be replaced by the input image.The guided filtering principle is based on the premise assumption that a linear relationship exists between the guidance image and the output image.Assuming that in a window m ω centered at pixel m , q is a linear transformation of I , the transformation formula is shown in Eq. (10). , In Eq. ( 10), m a and m b represent the assumed linear invariant coefficients within the window m ω , and m ω is a square window with a radius of r centered at pixel m .To determine the values of m a and m b , constraints need to be applied to the input image p , and the constraints are shown in Eq. (11).
In Eq. (11), n represents the excess information in q , where most of the irrelevant information is noise.The linear regression model established in window m ω is shown in Eq. ( 12).
In Eq. ( 12), ε is a regularization parameter to constrain m a , and its solution is shown in Eq. ( 13).ω , there will be multiple values of i q in different windows.Therefore, Eq. ( 14) is used to determine the value of Therefore, Eq. ( 14) can also be written as Eq.(15).
In Eq. ( 15), In Fig. 4, Fig. 4(b) is the image after denoising with Gaussian filtering, Fig. 4(c) is the image after denoising with bilateral filtering, and Fig. 4(d) is the image after denoising with guided filtering.Fig. 4(a) is the original one.The image after denoising with Gaussian filtering appears darker in color and has unclear edges.The image after denoising with bilateral filtering has clear brightness edges.The image after denoising with guided filtering has clear brightness edges and the details in each region are smoothed, which better matches the actual lighting distribution [19].In order to achieve better enhancement of the image, this research uses a two-dimensional gamma function to perform brightness correction on images with uneven lighting [20].The formula for the two-dimensional gamma function is shown in Eq. ( 16).www.ijacsa.thesai.orgIn Eq. ( 16), F represents the preliminarily enhanced image after transformation, g < , indicating an increase in brightness for ( , ) F x y ; otherwise, the brightness is reduced.The image obtained is further filtered using guided filtering with a radius of six and a regularization parameter of 1 4 e − for denoising.Then, contrast-limited histogram equalization is applied to obtain the image c I , which is then weighted fused using the weighted fusion formula shown in Eq. ( 17).I from the initial input image, and the S (saturation) channel image S I are combined to form an HSV image, which is then converted to the RGB format and output as the final RGB image.In summary, the workflow of the brightness equalization algorithm based on region division in low-light conditions is shown in Fig. 5.

Start
Input RGB image RGB→HSV Extracting V-channel images In Fig. 5, the first step is to input the original image in RGB format.The second step is to convert the original RGB image to the HSV format and extract the V channel image V I .The third step is to calculate the grayscale mean of image V I and determine if the mean is greater than a set empirical threshold th I .If the mean is less than th I , the mean remains unchanged.If the mean is greater than th I , the mean is inverted, resulting in a mean-limited grayscale image lim I .The fourth step consists of three operations.The first operation is logarithmic transformation followed by binarization to obtain a binary image containing texture edges.Then, the binary image is segmented into regions.The second operation is 8-neighborhood mean filtering to obtain neighborhood information for each pixel.The third operation is denoising of the grayscale image lim I using guided filtering, resulting in an illumination map q I .The fifth step of the algorithm is to construct the target mean i M for each region based on the brightness mean, minimum value, and image mean of the original input image within the regions segmented in the first operation of the fourth step.The sixth step is to perform gamma correction on the preliminarily enhanced image to achieve brightness correction, resulting in the image g I .The seventh step is to determine whether the inversion operation was performed in the third step.If inversion was performed, the image g I is restored; if not, it remains unchanged.The eighth step is to denoise the image g I using guided filtering to obtain the denoised image.The ninth step is to perform contrast-limited histogram equalization on g I and then perform weighted fusion to obtain the corrected image out I .The final step is to combine the H and S channels back into the HSV color space, convert it to RGB format, and output the brightness equalized image.

A. Performance Analysis of Region-based Image Brightness Equalization Algorithm
The processor used for this performance test is an Intel(R) Core (TM) i9-13900HX CPU with a clock speed of 5.4GHz, 16GB RAM, and a 64-bit operating system.The simulation software used is MATLAB R2022a.The images used in this experiment were obtained by continuously capturing 300 frames of the same Chinese painting in a low-light indoor environment.Five frames were randomly selected from the 300 frames of Chinese painting images and named Frame 1 to 5. The information entropy and Structural Similarity (SSIM) of the images enhanced by different algorithms were compared.The comparison of information entropy is Table I.
From Table Ⅰ, the original images information entropy is generally in the range of 4-6.After MSRCR processing, it is in the range of 5-7.After Dong processing, the information entropy is in the range of 6-8.After Zohair processing, the information entropy is in the range of 7-9.After processing with the proposed method, the information entropy of the images is in the range of 9-10.A higher information entropy value indicates more detailed information in the image.The images processed by the proposed algorithm in this study show significantly more detailed information compared to other algorithms.The comparison results of SSIM are shown in Table Ⅱ.From Table Ⅱ, the SSIM of the images reinforced by MSRCR is in the range of 0.06-0.23.The SSIM of the images enhanced by Dong is in the range of 0.09-0.26.The SSIM of the images enhanced by Zohair is in the range of 0.19-0.26.The SSIM of the images enhanced by the proposed method in this study is in the range of 0.30-0.36.The SSIM of the images enhanced by the method is significantly higher than other algorithms, indicating that the details of the images preserved by the method are more complete and the enhancement effect is better compared to other algorithms.A comparison was made between the adaptive gamma brightness correction method used in the algorithm and the fixed parameter gamma correction method.The experimental results are shown in Fig. 6.In Fig. 6, from the experimental results, it can be observed that when the input images are in the range of 1-300 frames, the brightness fluctuation of the images corrected by the www.ijacsa.thesai.orgimproved adaptive gamma correction method in this study significantly decreases compared to the original images.On the other hand, the images corrected by the fixed parameter gamma correction method exhibit larger brightness fluctuations compared to the original images.The adaptive gamma correction method used in this study outputs a standard deviation of brightness of Fig. 7(a) represents the runtime of different algorithms with varying group numbers under a scaling factor of 1.It can be observed that under a scaling factor of 1, the runtime of all algorithms increases with the increase in group numbers.When the group number reaches 200, the proposed algorithm in this study has the shortest runtime among all algorithms, which is 16.63 seconds.Fig. 7(b) represents the runtime of different algorithms with varying group numbers under a scaling factor of 0.1.It can be seen that under a scaling factor of 0.1, the runtime of all algorithms is significantly shorter compared to the case of a scaling factor of 1.Among them, the proposed algorithm in this study has the shortest runtime among all group numbers, which is 8.37 seconds when the group number reaches 200.

B. Simulation Experiment of Brightness Equalization Algorithm for Chinese Painting Images Based on Regional Division
The comparison of the average brightness of Chinese painting pigments enhanced by different enhancement algorithms in low-light environments is shown in Fig. 8.
In Fig. 8, the image enhanced by the MSRCR image enhancement algorithm has the lowest average brightness among the five algorithms, indicating that its brightness equalization processing is the worst among the five algorithms.The image enhanced by the Dong image enhancement algorithm has a lower average brightness and a slower growth rate.The image enhanced by the Zohair image enhancement algorithm has a higher average brightness and a faster growth rate.The image enhanced by the algorithm proposed maintains a high level of average brightness and has a fast growth rate.This study introduced the Peak Signal-to-Noise Ratio (PSNR) for evaluating the fidelity of the images.PSNR tests were conducted on different algorithms using the Brightening dataset and the LOL dataset, and the results are shown in Fig. 9.In Fig. 9, Fig. 9(a) shows the comparison of PSNR for different algorithms under the Brightening dataset.The PSNR of the MSRCR algorithm is close to that of the Dong algorithm, and both algorithms have large fluctuations.The PSNR of the Zohair algorithm is higher, and its fluctuations are more stable than the above two algorithms.The PSNR of the algorithm proposed is greater than the above three at bit rates ranging from 0 to 2000, and it has a fast growth rate.The maximum PSNR values for the four algorithms are obtained when the bit rate reaches 2000, which are 26.6db,28.4db, 32.5db, and 37.6db, respectively.Fig. 9(b) shows the comparison of PSNR for different algorithms under the LOL dataset.Except for the method proposed, the PSNR of the other three algorithms fluctuates significantly under the LOL dataset.However, the maximum PSNR values for each algorithm are still obtained at a bit rate of 2000, which are 28.2db,32.6db, 35.8db, and 37.1db, respectively.The maximum PSNR for the four algorithms has improved under the LOL dataset.

m∑
represent the variance and mean of I within window m ω , ω represents the number of pixels in m represents the mean of p within window m ω .Since pixel i is included in different m of the calculated results of the linear coefficients for pixel i .The denoising effects of different denoising methods on the same image are shown in Fig.4.

(
Eq. (17), a represents the weighting coefficient for the output of contrast-limited histogram equalization, b represents the weighting coefficient for g I , and ( ) v I m represents the mean brightness of the V channel image of the original image.Finally, the out I channel image, the H (hue) channel image H

Fig. 5 .
Fig. 5. Flow chart of brightness equalization algorithm for Chinese painting pigments in low illumination environments based on region division.

Fig. 8 .
Fig. 8. Average brightness results of Chinese painting pigments in low illuminance environments with different enhancement algorithms for image enhancement.