Text clarity enhancement method, device, equipment and medium for homework submission

By smoothing the job image and edge detection, identifying the text area, and adjusting the grayscale mean according to the contrast characteristics, the problem of poor readability of text in the prior art is solved, and efficient and accurate evaluation of job submission is achieved.

CN118865408BActive Publication Date: 2024-12-17NINGBO SIMSHINE INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411350186.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-17
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

The prior art cannot effectively improve the image clarity and contrast of job submissions, resulting in poor text readability and affecting the accuracy and efficiency of automated job submissions.

Method used

By acquiring real-time job images, performing smoothing and edge detection, identifying text areas, determining color fill strategies based on contrast characteristics of text and background, and adjusting grayscale mean to improve the clarity and contrast of text areas.

Benefits of technology

Significantly improves the clarity and contrast of text areas, making text easier to read in the assignment images, ensuring accurate and efficient evaluation of assignments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118865408B_ABST
    Figure CN118865408B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, solves the problem that the clarity and contrast of submitted homework images cannot be improved in the prior art, and the text readability is poor, and provides a method, device, equipment and medium for enhancing the clarity of text submitted homework. The method includes: obtaining a real-time homework image submitted by a target object in a learning and accompanying scenario; performing smoothing and edge detection on the real-time homework image, and outputting a target image; performing text area recognition on the target image, and outputting text area position information; based on the text area position information, dividing the text area into a text area and a background area, and determining a color filling strategy based on the contrast characteristics between the text area and the background area; based on the text area position information, using the color filling strategy, performing clarity enhancement processing on the text area, and outputting an enhanced homework image. The present invention can improve the clarity and contrast of submitted homework images and enhance text readability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, equipment and medium for enhancing text clarity in job submission. Background Art

[0002] Automated homework submission is gradually becoming a mainstream tool, especially in distance education and large-scale classroom management. By automatically processing the images of homework submitted by students, handwritten or printed text is converted into recognizable digital content. The core function of this automated homework submission is image recognition technology, which relies on the clarity and contrast of the image to accurately extract text information. In the traditional homework submission method, teachers need to manually correct each homework, which is time-consuming and labor-intensive. Automated homework submission greatly improves the efficiency of homework submission through image processing and text recognition technology, especially when facing a large number of homework, it can quickly process and feedback results; however, the effectiveness of automated homework submission depends to a large extent on the quality of the uploaded homework image. If the image is blurred and the contrast is insufficient, the text cannot be accurately recognized, resulting in incorrect evaluation results, and even requiring teachers to intervene manually, which increases the workload. Therefore, in the context of automated homework submission, improving the clarity and contrast of the image and ensuring the readability of the text can not only ensure the recognition accuracy of the system, but also reduce the teacher's post-correction work, and improve the efficiency and fairness of the entire homework submission and evaluation process. This optimization is of great significance to promoting educational informatization and improving the quality of education.

[0003] The existing Chinese patent CN113076952A discloses a method and device for automatic text recognition and enhancement, including: obtaining an input text image; performing image preprocessing on the text image to obtain a preprocessed image of the text image; using the SUSAN corner point detection method to perform corner point detection on the preprocessed image to obtain a character area; calculating a clarity evaluation value for the character area, and determining the character area with a clarity evaluation value less than a preset threshold as a fuzzy character area; using OCR to perform character recognition on the fuzzy character area to obtain text characters; enhancing the text characters to obtain a complete and clear text image. Although the above patent discloses image enhancement of the text area to enhance clarity, it does not directly improve the clarity and contrast of the text image, because it mainly relies on OCR technology to identify and enhance the fuzzy character area, rather than adjusting the overall clarity and contrast of the entire image, which may result in the inability to effectively enhance the readability of the text when the overall quality of the text image is poor. In addition, for clear but low-contrast text areas, this solution is also difficult to improve the contrast, thereby improving the visual clarity and readability of the text.

[0004] Therefore, how to improve the clarity and contrast of submitted assignment images and enhance text readability is an urgent problem to be solved. Summary of the invention

[0005] In view of this, the present invention provides a method, device, equipment and medium for enhancing text clarity of job submission, so as to solve the problem in the prior art that the clarity and contrast of the submitted job image cannot be improved and the text readability is poor.

[0006] The technical solution adopted by the present invention is:

[0007] In a first aspect, the present invention provides a method for enhancing text clarity for job submission, the method comprising:

[0008] S1: Obtain the real-time homework image submitted by the target object in the learning and accompanying scenario;

[0009] S2: performing smoothing and edge detection on the real-time operation image, and outputting a target image;

[0010] S3: Perform text area recognition on the target image and output text area position information;

[0011] S4: dividing the text area into a text area and a background area according to the text area position information, and determining a color filling strategy according to the contrast characteristics between the text area and the background area, which is to adjust the first grayscale mean corresponding to the text area to the third grayscale mean, and / or to adjust the second grayscale mean corresponding to the background area to the fourth grayscale mean, wherein the third grayscale mean and the fourth grayscale mean are determined according to the first proportion corresponding to the text area and the second proportion of the background area;

[0012] S5: Based on the text area position information, using the color filling strategy, the text area is subjected to clarity enhancement processing, and an enhanced job image is output.

[0013] Preferably, S3 includes:

[0014] S31: Processing the target image using a preset edge detection algorithm to determine an edge image;

[0015] S32: Perform neighborhood detection on each edge pixel in the edge image to determine a target pixel set;

[0016] S33: Calculate the circumscribed rectangle of the target pixel point set to determine the position information of the text area, wherein the text area includes text and background.

[0017] Preferably, the S32 includes:

[0018] S321: Determine whether there are other edge pixels around the current edge pixel according to a plurality of preset detection directions;

[0019] S322: If there are other edge pixels around the current edge pixel, the current edge pixel is a target pixel, and the current edge pixel is output to the target pixel set;

[0020] S323: If there are no other edge pixels around the current edge pixel, the current edge pixel is not a target pixel.

[0021] Preferably, the S4 includes:

[0022] S41: dividing the text area into a text area and a background area according to the text area position information;

[0023] S42: Calculating the grayscale mean of the text area and the background area to determine a first grayscale mean corresponding to the text area and a second grayscale mean corresponding to the background area;

[0024] S43: determining a contrast feature between the text area and the background area according to a difference between the first grayscale mean and the second grayscale mean;

[0025] S44: Determine a color filling strategy according to the contrast feature.

[0026] Preferably, the S44 includes:

[0027] S441: Obtaining a preset contrast threshold;

[0028] S442: comparing the contrast feature with the contrast threshold, if the contrast feature is greater than the contrast threshold, the color filling strategy is not to perform color filling;

[0029] S443: If the contrast feature is less than or equal to the contrast threshold, the color filling strategy is to adjust the first grayscale mean to the third grayscale mean, and / or adjust the second grayscale mean to the fourth grayscale mean, wherein the third grayscale mean is greater than the first grayscale mean, and the second grayscale mean is greater than the fourth grayscale mean.

[0030] Preferably, the S443 includes:

[0031] S4431: Determine a first proportion corresponding to the text area and a second proportion corresponding to the background area according to a first number of pixels of each pixel in the text area and a second number of pixels of each pixel in the background area;

[0032] S4432: Determine a first initial grayscale value interval and a second initial grayscale value interval according to the first proportion and the second proportion;

[0033] S4433: According to the contrast threshold, select a plurality of initial grayscale value combinations that meet the conditions from the first initial grayscale value interval and the second initial grayscale value interval, each initial grayscale value combination includes a first initial grayscale value and a second initial grayscale value, the first initial grayscale value and the second initial grayscale value of different initial grayscale value combinations are different, and the difference between the first initial grayscale value and the second initial grayscale value in each initial grayscale value combination is greater than or equal to the contrast threshold;

[0034] S4434: Determine a first scoring value related to contrast according to the first initial grayscale value and the second initial grayscale value and in combination with the contrast feature;

[0035] S4435: Obtain a maximum adjustment value corresponding to a preset grayscale value, and determine a second scoring value related to visual comfort according to the maximum adjustment value, the first initial grayscale value, and the second initial grayscale value, in combination with the first grayscale mean value and the second grayscale mean value;

[0036] S4436: performing weighted averaging processing on the first score value and the second score value according to a preset weight coefficient to determine a total score value;

[0037] S4437: Using the first initial grayscale value corresponding to the highest total score value as the third grayscale mean value, and using the second initial grayscale value corresponding to the highest total score value as the fourth grayscale mean value.

[0038] Preferably, the S5 includes:

[0039] S51: processing the text area according to the color filling strategy to determine the target grayscale value corresponding to each target pixel after adjustment;

[0040] S52: Obtain target position information of each target pixel point in the text area, calculate the average of each target grayscale value, and determine the target grayscale average;

[0041] S53: According to the target grayscale mean value and the target position information, the target grayscale value of each target pixel is adjusted to the target grayscale mean value.

[0042] In a second aspect, the present invention provides a text clarity enhancement device for job submission, the device comprising:

[0043] The operation image acquisition module is used to obtain the real-time operation images submitted by the target object in the learning and accompanying scenario;

[0044] A preprocessing module, used for performing smoothing and edge detection on the real-time operation image and outputting a target image;

[0045] A text area recognition module, used to perform text area recognition on the target image and output text area position information;

[0046] A color filling strategy acquisition module is used to divide the text area into a text area and a background area according to the text area position information, and determine the color filling strategy to adjust the first grayscale mean corresponding to the text area to the third grayscale mean according to the contrast characteristics between the text area and the background area, and / or adjust the second grayscale mean corresponding to the background area to the fourth grayscale mean, wherein the third grayscale mean and the fourth grayscale mean are determined according to the first proportion corresponding to the text area and the second proportion of the background area;

[0047] The color filling module is used to perform clarity enhancement processing on the text area according to the text area position information and utilize the color filling strategy to output an enhanced job image.

[0048] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method of the first aspect in the above-mentioned embodiment.

[0049] In a fourth aspect, an embodiment of the present invention further provides a storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method of the first aspect in the above-mentioned embodiment is implemented.

[0050] In summary, the beneficial effects of the present invention are as follows:

[0051] The present invention provides a method, device, equipment and medium for enhancing the clarity of text for homework submission. The method includes: obtaining a real-time homework image submitted by a target object in a learning and accompanying scenario; performing smoothing and edge detection on the real-time homework image, and outputting a target image; performing text area recognition on the target image, and outputting text area position information; based on the text area position information, dividing the text area into a text area and a background area, and determining a color filling strategy based on the contrast characteristics between the text area and the background area to adjust the first grayscale mean corresponding to the text area to the third grayscale mean, and / or adjusting the second grayscale mean corresponding to the background area to the fourth grayscale mean, wherein the third grayscale mean and the fourth grayscale mean are determined based on the first proportion corresponding to the text area and the second proportion of the background area; based on the text area position information, using the color filling strategy, performing clarity enhancement processing on the text area, and outputting an enhanced homework image. The present invention firstly performs smoothing processing on the image, reduces the noise in the image, suppresses unnecessary details, and ensures that the subsequent edge detection is more accurate. Next, edge detection is performed on the smoothed image. Through edge detection, the text area and the background area are clearly distinguished to ensure the clarity of the text outline, which ensures that the text area is accurately identified in the image and lays the foundation for the subsequent text area identification and enhancement processing. In the text area identification process, the position of the text area is accurately located to ensure that the subsequent processing is concentrated on these key areas. Then, based on the identified text area position information, preset color filling strategies are applied. These strategies include adjusting the color contrast of the text area, increasing the difference between the text and the background, and making the text clearer and more prominent. Finally, through these steps, the clarity and contrast of the text area can be effectively improved, making the text easier to read in the submitted homework image. This processing method can significantly improve the readability of the text and ensure that the students' homework can be accurately and clearly displayed and evaluated. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings required for use in the embodiment of the present invention will be briefly introduced below. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work, and these are all within the protection scope of the present invention.

[0053] Figure 1 It is a schematic diagram of the overall working process of the text clarity enhancement method for job submission in Embodiment 1 of the present invention;

[0054] Figure 2 It is a schematic diagram of the process of smoothing and edge detection of the real-time operation image in Embodiment 1 of the present invention;

[0055] Figure 3It is a schematic diagram of the process of performing text area recognition on the target image in Embodiment 1 of the present invention;

[0056] Figure 4 Schematic diagram of the process of performing neighborhood detection on each edge pixel in an edge image in Embodiment 1 of the present invention;

[0057] Figure 5 This is a schematic diagram of a process for performing clarity enhancement processing on a text area in Embodiment 1 of the present invention;

[0058] Figure 6 This is a schematic diagram of a process for determining a color filling strategy in Embodiment 1 of the present invention;

[0059] Figure 7 This is a schematic diagram of a process for determining the third grayscale mean and the fourth grayscale mean in Embodiment 1 of the present invention;

[0060] Figure 8 This is a schematic diagram of a process of performing clarity enhancement processing on a text area according to the first grayscale mean value in Embodiment 1 of the present invention;

[0061] Fig. 9 It is a structural block diagram of a text clarity enhancement device for job submission in Embodiment 2 of the present invention;

[0062] Fig.10 It is a schematic diagram of the structure of the electronic device in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described in conjunction with the drawings in the embodiment of the present invention. It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. In the description of the present invention, it should be understood that the orientation or position relationship indicated by the terms "center", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such a process, method, article or device. In the absence of further restrictions, the elements defined by the phrase "comprising..." do not exclude the existence of other identical elements in the process, method, article or device comprising the elements. If there is no conflict, the embodiments of the present invention and the various features in the embodiments can be combined with each other, all within the protection scope of the present invention.

[0064] Example 1

[0065] See also Figure 1 Embodiment 1 of the present invention discloses a method for enhancing text clarity for job submission, the method comprising:

[0066] S1: Obtain the real-time homework image submitted by the target object in the learning and accompanying scenario;

[0067] Specifically, in the learning accompaniment scenario, the real-time homework images submitted by the target object are first obtained. These images are usually color pictures taken by a camera installed flat on the desktop. The position and angle of such a camera are carefully set to ensure that the entire homework paper can be photographed from above, capturing all written content and its surrounding environment. The flat camera helps to reduce image deformation problems caused by oblique shooting, and ensures that the text and graphics in the homework image will not be distorted or have irregular perspective effects. In addition, since the camera is fixed on the desktop and maintains the same horizontal plane as the homework paper, this setting can also minimize hand shaking or angle changes during shooting, thereby improving the stability and clarity of the image, and ensuring that the homework images submitted by students can clearly and completely reflect the actual writing content.

[0068] S2: performing smoothing and edge detection on the real-time operation image, and outputting a target image;

[0069] Specifically, the acquired real-time job image is smoothed and edge detected to generate a clear target image. The main purpose of smoothing is to reduce noise and spots in the image. These interferences may come from the shooting environment of the camera, compression distortion during image transmission, or uneven texture of the paper surface. Next, edge detection is a key step, such as the outline and separation lines of the job text. Edge detection can identify areas in the image with significant brightness changes. These areas usually correspond to characters and lines in the job. Through this processing method, the boundaries of the text areas in the target image will become more obvious, enhancing the overall clarity and contrast of the image, laying a solid foundation for subsequent text recognition and clarity enhancement processing. In one embodiment, please refer to Figure 2 , the text clarity enhancement for homework submission includes:

[0070] S21: grayscale the real-time operation image and output a grayscale image;

[0071] Specifically, in the initial stage of image processing, grayscale processing of the acquired real-time working image is a key step. The grayscale process simplifies the color information of each pixel into a single grayscale value (usually ranging from 0 to 255) by converting the color image into a grayscale image, so that the color of each pixel only reflects the intensity of light and no longer contains color information. The main purpose of this step is to reduce the computational complexity, because grayscale images occupy less storage space and are faster to process than color images. In addition, after removing the color information, the interference of color on subsequent text recognition and color analysis can be reduced, so that the algorithm can focus more on processing brightness differences, which are usually the key features between text and background, thus laying the foundation for subsequent edge detection and text recognition.

[0072] S22: Using a Gaussian blur algorithm, filtering the grayscale image, and outputting a filtered target image.

[0073] Specifically, after the grayscale processing of the image is completed, the Gaussian blur algorithm is applied to filter the grayscale image. Gaussian blur is an image smoothing algorithm based on the Gaussian function. It reduces the noise and irregular edges in the image by weighted averaging each pixel in the image and its surrounding neighborhood pixels. The algorithm can effectively smooth small brightness changes in the image and weaken the impact of noise on the image while retaining large-scale brightness changes, such as the outline of the text. The target image after filtering presents a more coherent and smooth feature, eliminates interference, and makes the edges of the text area clearer. Such processing improves the accuracy of subsequent text recognition and analysis, and prepares for the steps of enhancing text clarity and contrast.

[0074] S3: Perform text area recognition on the target image and output text area position information;

[0075] Specifically, after grayscale processing and Gaussian blur processing, the noise of the target image is effectively reduced, and the overall clarity of the image is improved, which lays a solid foundation for the subsequent text area recognition. The purpose of text area recognition is to accurately locate the area containing text from the target image. This step is crucial because it directly affects the subsequent text clarity enhancement and contrast enhancement process. By using edge detection algorithms and combining connectivity analysis techniques, the system can identify the edge sets containing text in the image and process these edge sets to determine the bounding rectangle of each text area. This bounding rectangle can accurately frame the boundaries of the text, thereby separating the text area from the background area. Ultimately, the result of this step is to output the location information of the text area, including the boundary coordinates and size of each text area. This information will provide a basis for the subsequent text clarity and contrast enhancement, ensuring that the enhancement process only acts on the area containing text, making the final job image clearer and easier to read.

[0076] In one embodiment, see Figure 3 , said S3 comprises:

[0077] S31: Processing the target image using a preset edge detection algorithm to determine an edge image;

[0078] Specifically, in the image processing process, edge detection is a key step for identifying areas in the image where light and dark changes significantly, which usually correspond to the boundaries of objects or the outlines of text. By applying a preset edge detection algorithm, such as the Canny edge detection algorithm, the system is able to identify all possible edges in the target image. The Canny algorithm calculates the gradient of image pixels to determine where there are significant intensity changes and marks these change points as edges. The edge image generated by this step is a binary image in which pixels are either edges or non-edges, which provides clear boundary information for subsequent text area recognition.

[0079] S32: Perform neighborhood detection on each edge pixel in the edge image to determine a target pixel set;

[0080] Specifically, after generating the edge image, the next step is to perform neighborhood detection on each edge pixel to identify those edge pixels that are connected to each other as target pixels, thereby forming a complete set of target pixels. These target pixel sets can then be used to calculate the circumscribed rectangle to frame the text area, providing an accurate position reference for subsequent clarity enhancement and color filling.

[0081] In one embodiment, see Figure 4 , the S32 comprises:

[0082] S321: Determine whether there are other edge pixels around the current edge pixel according to a plurality of preset detection directions;

[0083] Specifically, the neighborhood around the current edge pixel is checked by using multiple preset detection directions. These detection directions include up and down, left and right, and four diagonal directions. For each edge pixel, the system checks the neighboring pixels around it to determine whether there are other edge pixels. If there are other edge pixels in the neighborhood, it means that the current edge pixel may belong to a coherent edge portion. This detection helps to identify and integrate adjacent edge points, thereby better outlining the boundaries of the text area.

[0084] S322: If there are other edge pixels around the current edge pixel, the current edge pixel is a target pixel, and the current edge pixel is output to the target pixel set;

[0085] Specifically, if there are other edge pixels in the neighborhood of the current edge pixel during the detection process, the system will mark the current edge pixel as a target pixel. This means that the edge pixel is part of a coherent edge and can be connected to its neighboring edge pixels. The edge points marked as target pixels are further processed to form a complete set of edges for determining the outline of the text area. This step is critical in the edge detection process because it ensures that the edges of the text area are accurately identified and processed.

[0086] S323: If there are no other edge pixels around the current edge pixel, the current edge pixel is not a target pixel.

[0087] Specifically, on the contrary, if there are no other edge pixels in the surrounding neighborhood of the current edge pixel, the system will exclude this edge pixel from the target pixel. This indicates that the edge pixel may be isolated and not connected to other edge pixels. Such edge points are not considered as part of the target edge and therefore will not be included in the final edge set. This step helps to remove isolated and irrelevant edge pixels, thereby improving the accuracy of text area recognition.

[0088] S33: Calculate the circumscribed rectangle of the target pixel point set to determine the position information of the text area, wherein the text area includes text and background.

[0089] Specifically, after completing the marking and screening of edge pixels, the system processes the identified target pixel set and calculates its bounding rectangle. The bounding rectangle refers to the smallest rectangular area surrounding the target pixel set, which covers the text and background of the text area. By calculating the bounding rectangle of these target pixel sets, the system can determine the location and range of the text area. This step provides accurate area information for subsequent text clarity enhancement processing, ensuring that both the text and the background can be effectively identified and processed.

[0090] S4: dividing the text area into a text area and a background area according to the text area position information, and determining a color filling strategy according to the contrast characteristics between the text area and the background area, which is to adjust the first grayscale mean corresponding to the text area to the third grayscale mean, and / or to adjust the second grayscale mean corresponding to the background area to the fourth grayscale mean, wherein the third grayscale mean and the fourth grayscale mean are determined according to the first proportion corresponding to the text area and the second proportion of the background area;

[0091] In one embodiment, see Figure 5 , said S4 comprises:

[0092] S41: dividing the text area into a text area and a background area according to the text area position information;

[0093] Specifically, at this stage, the regions in the image are classified into text regions and background regions based on the previously identified text region location information. Specifically, first, based on the results of edge detection and text contour recognition, the parts containing text (text regions) and the background parts surrounding these text (background regions) are marked in the image. This segmentation not only facilitates the subsequent grayscale mean calculation, but also lays the foundation for targeted color filling and contrast enhancement strategies. By accurately distinguishing between text and background regions, subsequent processing and adjustments can be performed more accurately.

[0094] S42: Calculating the grayscale mean of the text area and the background area to determine a first grayscale mean corresponding to the text area and a second grayscale mean corresponding to the background area;

[0095] Specifically, the identified text area and background area are grayed out, and the average gray value of the two areas is calculated respectively. The specific operation includes converting all pixels in each area into gray values, and then calculating the gray average value of these pixels. Among them, G 文本 and G 背景 Represent the first grayscale mean of the text area and the second grayscale mean of the background, respectively. N and M represent the number of pixels in the text area and the background area respectively. The grayscale mean of the text area (first grayscale mean) reflects the color brightness of the text, while the grayscale mean of the background area (second grayscale mean) represents the color brightness of the background. This process helps determine the basic contrast between the text and the background, providing data support for the subsequent contrast difference calculation.

[0096] S43: determining a contrast feature between the text area and the background area according to a difference between the first grayscale mean and the second grayscale mean;

[0097] Specifically, after obtaining the average grayscale values ​​of the text area and the background area, the contrast is evaluated by calculating the difference between the two values, and the calculated contrast difference is used as the contrast feature between the text area and the background area. The calculation formula for the contrast difference is: C 对比度 The greater the contrast difference between the text and the background, the higher the contrast, and the more obvious the distinction between the text and the background, which is crucial to improving text readability.

[0098] S44: Determine a color filling strategy according to the contrast feature;

[0099] Specifically, based on the calculated contrast difference, an appropriate color filling strategy is selected to enhance the clarity of the text in the image.

[0100] In one embodiment, see Figure 6 , the S44 comprises:

[0101] S441: Obtaining a preset contrast threshold;

[0102] Specifically, in this step, a preset contrast threshold is obtained, which is used to determine whether the contrast between the text and the background is sufficient. The contrast threshold is a standard value set by the system during the design phase, usually based on empirical data or user needs in actual applications. This threshold is used to evaluate whether the contrast difference of the current image reaches an acceptable level. If the contrast difference is greater than this threshold, it means that the contrast between the text and the background is already high enough and no further adjustment is required; if the contrast difference is lower than or equal to this threshold, it means that the contrast is insufficient and color filling is required to enhance the clarity of the text.

[0103] S442: comparing the contrast feature with the contrast threshold, if the contrast feature is greater than the contrast threshold, the color filling strategy is not to perform color filling;

[0104] Specifically, the calculated contrast difference is compared with the preset contrast threshold. If the contrast difference is greater than the threshold, it means that the contrast between the text and the background is high enough to meet the readability requirement. In this case, the system does not need to perform additional color filling processing to avoid interference with the image or unnecessary adjustments. This judgment mechanism can ensure that unnecessary processing is avoided when the contrast is sufficient, improve the efficiency of the system and the naturalness of image processing.

[0105] S443: If the contrast feature is less than or equal to the contrast threshold, the color filling strategy is to adjust the first grayscale mean to the third grayscale mean, and / or adjust the second grayscale mean to the fourth grayscale mean, wherein the third grayscale mean is greater than the first grayscale mean, and the second grayscale mean is greater than the fourth grayscale mean.

[0106] Specifically, if the contrast difference is less than or equal to the preset contrast threshold, it means that the contrast of the current image is insufficient and the readability of the text may be affected. Therefore, the system needs to perform color filling processing to improve the contrast. This process includes: adjusting the first grayscale mean of the text area to a higher grayscale mean (third grayscale mean) to make the color of the text darker, thereby increasing the contrast with the background, and / or, adjusting the second grayscale mean of the background area to a lower grayscale mean (fourth grayscale mean) to make the background color lighter, thereby further increasing the contrast with the text. The purpose of these two adjustments is to increase the grayscale value of the text area and reduce the grayscale value of the background area, ensuring that the contrast between the text and the background is significantly improved, thereby enhancing the clarity and readability of the text.

[0107] In one embodiment, see Figure 7 , the S443 includes:

[0108] S4431: Determine a first proportion corresponding to the text area and a second proportion corresponding to the background area according to a first number of pixels of each pixel in the text area and a second number of pixels of each pixel in the background area;

[0109] Specifically, obtain the first pixel number of each pixel in the text area and the second pixel number of each pixel in the background area. For example, the first pixel number of the text area is N. text , the number of second pixels in the background area is N background , then the total number of pixels in the text area is N total , calculate the first proportion corresponding to the text area and the second proportion of the background area, the calculation formula is as follows: , Among them, P text is the first proportion corresponding to the text area, P background is the second largest proportion of the background area.

[0110] S4432: Determine a first initial grayscale value interval and a second initial grayscale value interval according to the first proportion and the second proportion;

[0111] Specifically, first, according to the first proportion corresponding to the text area and the second proportion corresponding to the background area, two independent grayscale value intervals are determined: one for the text area, that is, the first initial grayscale value interval, and the other for the background area, that is, the second initial grayscale value interval; the settings of the first initial grayscale value interval and the second initial grayscale value interval are adjusted according to the proportion and visual habits. For example, when the text area accounts for a large proportion, in order to improve the reading experience, a brighter grayscale value interval is selected to make the text more prominent; and when the background area accounts for a large proportion, in order to avoid background interference, a darker grayscale interval is selected. Assuming that in a certain reading interface, the text accounts for a relatively high proportion, such as 70%. In order to ensure a good visual effect, the grayscale value of the text is set in a brighter range, such as between 180 and 220, and the grayscale value of the background is set in a darker range, such as between 60 and 100; this interval setting can enhance the contrast and ensure that the text area is clear and readable.

[0112] S4433: According to the contrast threshold, select a plurality of initial grayscale value combinations that meet the conditions from the first initial grayscale value interval and the second initial grayscale value interval, each initial grayscale value combination includes a first initial grayscale value and a second initial grayscale value, the first initial grayscale value and the second initial grayscale value of different initial grayscale value combinations are different, and the difference between the first initial grayscale value and the second initial grayscale value in each initial grayscale value combination is greater than or equal to the contrast threshold;

[0113] Specifically, according to the preset contrast threshold, that is, the minimum grayscale difference that needs to be satisfied between the text and the background, several grayscale value combinations that meet the conditions are screened out from the previously determined initial grayscale value interval, each grayscale combination includes a grayscale value of a text area, that is, a first initial grayscale value, and a grayscale value of a background area, that is, a second initial grayscale value, and the difference between them must meet the contrast threshold, that is, the difference is large enough to ensure that the contrast is obvious enough; assuming that the grayscale value interval of the text area is 180 to 220, the grayscale value interval of the background area is 60 to 100, and the contrast threshold is set to 50, this means that it is necessary to select a grayscale value combination with a grayscale difference greater than or equal to 50 from the grayscale interval of the text and the background. For example, a combination with a text grayscale of 200 and a background grayscale of 80 meets the conditions because the difference between the two is 120, which is far greater than the contrast threshold. In order to cater to visual habits, in some application scenarios, a green-leaning combination may be selected based on color tendencies to further improve comfort and readability.

[0114] S4434: Determine a first scoring value related to contrast according to the first initial grayscale value and the second initial grayscale value and in combination with the contrast feature;

[0115] Specifically, in this step, based on the first initial grayscale value and the second initial grayscale value obtained in the previous step, combined with the current contrast difference value, a score value related to the contrast is calculated, that is, a first score value, and its calculation formula is as follows: Among them, C current , that is, C 对比度 , which represents the contrast difference between text and background; G text,new Represents the first initial gray value; G background,new represents the second initial gray value; ΔC gain Represents the first score value. Contrast is the key to clearly distinguish text from background areas. Therefore, this step evaluates the contrast enhancement effect of the text area after preliminary adjustment and assigns a score value. This score value is used to quantify the effect of preliminary grayscale adjustment on the overall contrast improvement of the image.

[0116] S4435: Obtain a maximum adjustment value corresponding to a preset grayscale value, and determine a second scoring value related to visual comfort according to the maximum adjustment value, the first initial grayscale value, and the second initial grayscale value, in combination with the first grayscale mean value and the second grayscale mean value;

[0117] Specifically, the factor of visual comfort needs to be considered. In this step, the score value related to visual comfort, i.e., the second score value, is calculated by combining the preset maximum grayscale adjustment value, the first initial grayscale value, the second initial grayscale value, and the grayscale mean of the text area and the background area. The calculation formula is as follows: Among them, G text Represents the first grayscale mean; G background Represents the second grayscale mean; S comfort represents the second score value, ΔG max is the maximum adjustment range allowed, that is, the maximum grayscale adjustment value, ensuring the comfort score S comfort Between 0 and 1, the higher the value, the better; visual comfort takes into account the impact of adjusting the grayscale value on the overall image and the audience's visual experience, ensuring that the grayscale adjustment can not only improve the contrast but also does not cause visual fatigue to the overall image. The higher the second score value, the better the adjusted image is in contrast and more visually comfortable.

[0118] S4436: performing weighted averaging processing on the first score value and the second score value according to a preset weight coefficient to determine a total score value;

[0119] Specifically, according to the preset weight coefficient, the first score value and the second score value calculated previously are weighted and averaged to obtain the final total score value, and the calculation formula is as follows: Among them, w 1 and w 2 The weights of contrast and comfort are respectively set according to actual needs. The weight coefficient setting will be adjusted according to the actual application scenario. For example, contrast may be more important in some scenarios, while visual comfort is more critical in other scenarios. The total score obtained after weighted average is the final score S that comprehensively considers contrast and visual comfort. final .

[0120] S4437: Using the first initial grayscale value corresponding to the highest total score value as the third grayscale mean value, and using the second initial grayscale value corresponding to the highest total score value as the fourth grayscale mean value.

[0121] Specifically, finally, among all possible grayscale adjustment schemes, the group of corresponding grayscale values ​​with the highest total score value is selected as the final grayscale adjustment result. Specifically, the first initial grayscale value corresponding to the highest total score value is used as the adjusted third grayscale mean, and the second initial grayscale value corresponding to the highest total score value is used as the adjusted fourth grayscale mean. This step ensures the optimal balance between contrast enhancement and visual comfort, thereby achieving the best image processing effect.

[0122] S5: Based on the text area position information, using the color filling strategy, the text area is subjected to clarity enhancement processing, and an enhanced job image is output.

[0123] Specifically, based on the text area location information, the text area is enhanced using a preset color filling strategy, and all pixels belonging to the area in the image are identified according to the previously determined text area location. These areas include the text part and its background. Then, the system applies a preset color filling strategy to adjust the color contrast and brightness of the text area, and outputs an enhanced job image.

[0124] In one embodiment, see Figure 8 , the S5 comprises:

[0125] S51: processing the text area according to the color filling strategy to determine the target grayscale value corresponding to each target pixel after adjustment;

[0126] Specifically, the text area is first processed according to the previously determined color filling strategy, including increasing the grayscale value of the text area or reducing the grayscale value of the background area. The goal is to obtain the adjusted target grayscale value of each target pixel point in the text area on the basis of enhancing the contrast between the text and the background, ensuring that the adjusted text pixel value is more visually prominent and easier for users to identify and read.

[0127] S52: Obtain target position information of each target pixel point in the text area, calculate the average of each target grayscale value, and determine the target grayscale average;

[0128] Specifically, by locating each target pixel in the text area, the target position information of these target pixels is obtained, and then the target grayscale value corresponding to each pixel is averaged to determine the target grayscale average of the entire text area. The purpose of this step is to provide a basis for subsequent unified grayscale adjustment by calculating the overall grayscale level of the text area. Calculating the average helps to unify the grayscale adjustment, making the brightness of the entire text area consistent and enhancing readability.

[0129] S53: According to the target grayscale mean value and the target position information, the target grayscale value of each target pixel is adjusted to the target grayscale mean value.

[0130] Specifically, according to the target grayscale mean calculated in the previous step, the grayscale value of each pixel in the text area is adjusted to this mean; the purpose of this is to ensure that the entire text area has a consistent grayscale level and avoid local areas being too bright or too dark, resulting in reduced readability. In this way, the visual effect of the text area can be ensured to be more uniform and consistent, while greatly improving the contrast between the text and the background, thereby enhancing the user's visual comfort.

[0131] Example 2

[0132] See also Fig. 9 Embodiment 2 of the present invention further provides a device for enhancing text clarity for job submission, the device comprising:

[0133] The operation image acquisition module is used to obtain the real-time operation images submitted by the target object in the learning and accompanying scenario;

[0134] A preprocessing module, used for performing smoothing and edge detection on the real-time operation image and outputting a target image;

[0135] A text area recognition module, used to perform text area recognition on the target image and output text area position information;

[0136] A color filling strategy acquisition module is used to divide the text area into a text area and a background area according to the text area position information, and determine the color filling strategy to adjust the first grayscale mean corresponding to the text area to the third grayscale mean according to the contrast characteristics between the text area and the background area, and / or adjust the second grayscale mean corresponding to the background area to the fourth grayscale mean, wherein the third grayscale mean and the fourth grayscale mean are determined according to the first proportion corresponding to the text area and the second proportion of the background area;

[0137] The color filling module is used to perform clarity enhancement processing on the text area according to the text area position information and utilize the color filling strategy to output an enhanced job image.

[0138] Specifically, a device for enhancing the clarity of text for homework submission provided by an embodiment of the present invention is used, and the device includes: a homework image acquisition module, which is used to acquire a real-time homework image submitted by a target object in a learning and accompanying scenario; a preprocessing module, which is used to perform smoothing and edge detection on the real-time homework image and output a target image; a text area recognition module, which is used to perform text area recognition on the target image and output text area position information; a color filling strategy acquisition module, which is used to divide the text area into a text area and a background area according to the text area position information, and determine the color filling strategy to adjust the first grayscale mean corresponding to the text area to the third grayscale mean and / or the second grayscale mean corresponding to the background area to the fourth grayscale mean according to the contrast characteristics between the text area and the background area, wherein the third grayscale mean and the fourth grayscale mean are determined according to the first proportion corresponding to the text area and the second proportion of the background area; a color filling module, which is used to perform clarity enhancement processing on the text area using the color filling strategy according to the text area position information and output the enhanced homework image. The device first smoothes the image to reduce noise in the image, suppresses unnecessary details, and ensures that subsequent edge detection is more accurate. Next, edge detection is performed on the smoothed image. Through edge detection, the text area and the background area are clearly distinguished to ensure the clarity of the text outline. This ensures that the text area is accurately identified in the image and lays the foundation for subsequent text area identification and enhancement processing. In the text area identification process, the position of the text area is accurately located to ensure that subsequent processing is concentrated on these key areas. Then, based on the identified text area position information, preset color filling strategies are applied. These strategies include adjusting the color contrast of the text area, increasing the difference between the text and the background, and making the text clearer and more prominent. Finally, through these steps, the clarity and contrast of the text area can be effectively improved, making the text easier to read in the submitted homework image. This processing method can significantly improve the readability of the text and ensure that the students' homework can be accurately and clearly displayed and evaluated.

[0139] Example 3

[0140] In addition, combined Figure 1 The text clarity enhancement method for job submission described in Embodiment 1 of the present invention may be implemented by an electronic device. Fig.10 A schematic diagram of the hardware structure of an electronic device provided in Embodiment 3 of the present invention is shown.

[0141] The electronic device may include a processor and a memory storing computer program instructions.

[0142] Specifically, the processor may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.

[0143] The memory may include a large capacity memory for data or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory may include a removable or non-removable (or fixed) medium. Where appropriate, the memory may be inside or outside the data processing device. In a particular embodiment, the memory is a non-volatile solid-state memory. In a particular embodiment, the memory includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0144] The processor implements any one of the text clarity enhancement methods for job submission in the above embodiments by reading and executing computer program instructions stored in the memory.

[0145] In one example, the electronic device may further include a communication interface and a bus. Fig.10 As shown, the processor, memory, and communication interface are connected via a bus and communicate with each other.

[0146] The communication interface is mainly used to implement communication between the modules, devices, units and / or equipment in the embodiments of the present invention.

[0147] The bus includes hardware, software or both, and the components of the device are coupled to each other. For example, but not limitation, the bus may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnection, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnection, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, the bus may include one or more buses. Although the embodiments of the present invention describe and illustrate a specific bus, the present invention contemplates any suitable bus or interconnection.

[0148] Example 4

[0149] In addition, in combination with the text clarity enhancement method for job submission in the above embodiment 1, embodiment 4 of the present invention can also provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the text clarity enhancement methods for job submission in the above embodiments is implemented.

[0150] In summary, the embodiments of the present invention provide a method, apparatus, device and medium for enhancing text clarity in job submission.

[0151] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0152] The functional blocks shown in the structural block diagram described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0153] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant location, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0154] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.

[0155] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.

Claims

1. A method for enhancing text clarity for homework submission, characterized in that: The method comprises: S1: Obtain the real-time homework image submitted by the target object in the learning and accompanying scenario; S2: performing smoothing and edge detection on the real-time operation image, and outputting a target image; S3: Perform text area recognition on the target image and output text area position information; S4: dividing the text area into a text area and a background area according to the text area position information, and determining a color filling strategy according to the contrast characteristics between the text area and the background area, which is to adjust the first grayscale mean corresponding to the text area to the third grayscale mean, and / or to adjust the second grayscale mean corresponding to the background area to the fourth grayscale mean, wherein the third grayscale mean and the fourth grayscale mean are determined according to the first proportion corresponding to the text area and the second proportion of the background area; S5: Based on the text area position information, using the color filling strategy, performing clarity enhancement processing on the text area, and outputting an enhanced job image; The S4 includes: S41: dividing the text area into a text area and a background area according to the text area position information; S42: Calculating the grayscale mean of the text area and the background area to determine a first grayscale mean corresponding to the text area and a second grayscale mean corresponding to the background area; S43: determining a contrast feature between the text area and the background area according to a difference between the first grayscale mean and the second grayscale mean; S44: Determine a color filling strategy according to the contrast feature; The S44 includes: S441: Obtaining a preset contrast threshold; S442: comparing the contrast feature with the contrast threshold, if the contrast feature is greater than the contrast threshold, the color filling strategy is not to perform color filling; S443: If the contrast feature is less than or equal to the contrast threshold, the color filling strategy is to adjust the first grayscale mean to the third grayscale mean, and / or adjust the second grayscale mean to the fourth grayscale mean, wherein the third grayscale mean is greater than the first grayscale mean, and the second grayscale mean is greater than the fourth grayscale mean; The S443 includes: S4431: Determine a first proportion corresponding to the text area and a second proportion corresponding to the background area according to a first number of pixels of each pixel in the text area and a second number of pixels of each pixel in the background area; S4432: Determine a first initial grayscale value interval and a second initial grayscale value interval according to the first proportion and the second proportion; S4433: According to the contrast threshold, select a plurality of initial grayscale value combinations that meet the conditions from the first initial grayscale value interval and the second initial grayscale value interval, each initial grayscale value combination includes a first initial grayscale value and a second initial grayscale value, the first initial grayscale value and the second initial grayscale value of different initial grayscale value combinations are different, and the difference between the first initial grayscale value and the second initial grayscale value in each initial grayscale value combination is greater than or equal to the contrast threshold; S4434: Determine a first scoring value related to contrast according to the first initial grayscale value and the second initial grayscale value and in combination with the contrast feature; S4435: Obtain a maximum adjustment value corresponding to a preset grayscale value, and determine a second scoring value related to visual comfort according to the maximum adjustment value, the first initial grayscale value, and the second initial grayscale value, in combination with the first grayscale mean value and the second grayscale mean value; S4436: performing weighted averaging processing on the first score value and the second score value according to a preset weight coefficient to determine a total score value; S4437: Using the first initial grayscale value corresponding to the highest total score value as the third grayscale mean value, and using the second initial grayscale value corresponding to the highest total score value as the fourth grayscale mean value.

2. The text clarity enhancement method for homework submission according to claim 1, characterized in that: The S3 includes: S31: Processing the target image using a preset edge detection algorithm to determine an edge image; S32: Perform neighborhood detection on each edge pixel in the edge image to determine a target pixel set; S33: Calculate the circumscribed rectangle of the target pixel point set to determine the position information of the text area, wherein the text area includes text and background.

3. The text clarity enhancement method for homework submission according to claim 2, characterized in that: The S32 includes: S321: Determine whether there are other edge pixels around the current edge pixel according to a plurality of preset detection directions; S322: If there are other edge pixels around the current edge pixel, the current edge pixel is a target pixel, and the current edge pixel is output to the target pixel set; S323: If there are no other edge pixels around the current edge pixel, the current edge pixel is not a target pixel.

4. The text clarity enhancement method for homework submission according to claim 1, characterized in that: The S5 includes: S51: processing the text area according to the color filling strategy to determine the target grayscale value corresponding to each target pixel after adjustment; S52: Obtain target position information of each target pixel point in the text area, calculate the average of each target grayscale value, and determine the target grayscale average; S53: According to the target grayscale mean value and the target position information, the target grayscale value of each target pixel is adjusted to the target grayscale mean value.

5. A text clarity enhancement device for homework submission, characterized in that: The device comprises: The operation image acquisition module is used to obtain the real-time operation images submitted by the target object in the learning and accompanying scenario; A preprocessing module, used for performing smoothing and edge detection on the real-time operation image and outputting a target image; A text area recognition module, used to perform text area recognition on the target image and output text area position information; A color filling strategy acquisition module is used to divide the text area into a text area and a background area according to the text area position information, and determine the color filling strategy to adjust the first grayscale mean corresponding to the text area to the third grayscale mean according to the contrast characteristics between the text area and the background area, and / or adjust the second grayscale mean corresponding to the background area to the fourth grayscale mean, wherein the third grayscale mean and the fourth grayscale mean are determined according to the first proportion corresponding to the text area and the second proportion of the background area; A color filling module, used to perform clarity enhancement processing on the text area according to the text area position information and using the color filling strategy, and output an enhanced job image; The method of dividing the text area into a text area and a background area according to the text area position information, and determining a color filling strategy according to the contrast characteristics between the text area and the background area is to adjust the first grayscale mean corresponding to the text area to the third grayscale mean, and / or to adjust the second grayscale mean corresponding to the background area to the fourth grayscale mean, wherein the third grayscale mean and the fourth grayscale mean are determined according to the first proportion corresponding to the text area and the second proportion of the background area, and includes: According to the text area position information, the text area is divided into a text area and a background area; Calculating the grayscale mean of the text area and the background area to determine a first grayscale mean corresponding to the text area and a second grayscale mean corresponding to the background area; Determining a contrast feature between the text area and the background area according to a difference between the first grayscale mean and the second grayscale mean; Determining a color filling strategy according to the contrast characteristics; Determining the color filling strategy according to the contrast feature includes: Get the preset contrast threshold; Compare the contrast feature with the contrast threshold, and if the contrast feature is greater than the contrast threshold, the color filling strategy is not to perform color filling; If the contrast feature is less than or equal to the contrast threshold, the color filling strategy is to adjust the first grayscale mean to the third grayscale mean, and / or adjust the second grayscale mean to the fourth grayscale mean, wherein the third grayscale mean is greater than the first grayscale mean, and the second grayscale mean is greater than the fourth grayscale mean; If the contrast feature is less than or equal to the contrast threshold, the color filling strategy is to adjust the first grayscale mean to the third grayscale mean, and / or adjust the second grayscale mean to the fourth grayscale mean, wherein the third grayscale mean is greater than the first grayscale mean, and the second grayscale mean is greater than the fourth grayscale mean, including: Determine a first proportion corresponding to the text area and a second proportion corresponding to the background area according to a first number of pixels in each pixel in the text area and a second number of pixels in each pixel in the background area; Determining a first initial grayscale value interval and a second initial grayscale value interval according to the first proportion and the second proportion; According to the contrast threshold, selecting a plurality of initial grayscale value combinations that meet the conditions from the first initial grayscale value interval and the second initial grayscale value interval, each initial grayscale value combination includes a first initial grayscale value and a second initial grayscale value, the first initial grayscale value and the second initial grayscale value of different initial grayscale value combinations are different, and the difference between the first initial grayscale value and the second initial grayscale value in each initial grayscale value combination is greater than or equal to the contrast threshold; Determining a first contrast-related scoring value according to the first initial grayscale value and the second initial grayscale value in combination with the contrast feature; Obtaining a maximum adjustment value corresponding to a preset grayscale value, and determining a second scoring value related to visual comfort according to the maximum adjustment value, the first initial grayscale value, and the second initial grayscale value, in combination with the first grayscale mean value and the second grayscale mean value; According to a preset weight coefficient, the first score value and the second score value are weighted and averaged to determine a total score value; The first initial grayscale value corresponding to the highest total score value is used as the third grayscale mean value, and the second initial grayscale value corresponding to the highest total score value is used as the fourth grayscale mean value.

6. An electronic device, characterized in that: include: At least one processor, at least one memory and computer program instructions stored in the memory, when the computer program instructions are executed by the processor, implement the method according to any one of claims 1 to 4.

7. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.