Text detection methods, systems and storage media in low-light environments

By combining adaptive image preprocessing and multi-stage deep learning networks, the problem of text detection in low-light and high-noise environments is solved, achieving accurate localization and recognition of text in complex scenes and improving detection accuracy.

CN122135375APending Publication Date: 2026-06-02AVIC EAST CHINA OPTOELECTRONICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
AVIC EAST CHINA OPTOELECTRONICS CO LTD
Filing Date
2026-02-09
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing text detection algorithms struggle to balance high accuracy and speed in low-light and high-noise environments. Traditional methods are complex and inefficient, failing to meet the real-time and accuracy requirements of complex scenarios.

Method used

By combining text detection, localization, and character recognition algorithms, and through a multi-stage deep learning network consisting of adaptive image quality preprocessing, object detection network, pixel segmentation network, and text recognition network, feature extraction and sequence prediction of low-light text images are achieved.

Benefits of technology

It effectively solves the problem of feature extraction in low-light and high-noise environments, achieves accurate positioning and recognition of text in complex scenes, and improves the detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122135375A_ABST
    Figure CN122135375A_ABST
Patent Text Reader

Abstract

This invention relates to the field of text detection, specifically to a text detection method, system, and storage medium in low-light environments. The method includes: acquiring a low-light text image to be detected, and performing adaptive image quality preprocessing on the low-light text image to obtain an enhanced text image; inputting the enhanced text image into a pre-trained target detection network to obtain the location coordinates of the text region in the text image; cropping the text region image based on the location coordinates of the text region, and inputting it into a pre-trained pixel segmentation network to obtain the text information contour in the text region image; extracting text information based on the text information contour, and inputting it into a pre-trained text recognition network for feature extraction and sequence prediction to form a target text sequence.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Technology Neighborhood This invention relates to the field of text detection, and more specifically to a text detection method, system, and storage medium in low-light environments. Background Technology

[0002] In recent years, Optical Character Recognition (OCR) technology has become a key technology in fields such as document digitization and autonomous driving, with increasingly complex and diverse application scenarios. This places higher demands on the performance of text detection algorithms. Traditional text detection algorithms mainly rely on manual features such as color, texture, and contour, which are effective in simple scenarios but face serious challenges in complex ones. In addition, traditional methods usually involve cumbersome post-processing steps, resulting in high algorithm complexity and low efficiency, making it difficult to meet the requirements of real-time performance and accuracy.

[0003] With the development of deep learning technology, regression-based text box and segmentation-based algorithms have gradually become mainstream, but they still have many shortcomings. For example, regression-based algorithms achieve multi-directional text detection by regressing the vertex coordinates of default bounding boxes; however, their post-processing is complex, and they are prone to missing characters on the left and right boundaries during detection, seriously affecting the accuracy of subsequent recognition. Segmentation-based algorithms, on the other hand, process text of arbitrary shapes by predicting pixel probabilities and using adaptive thresholds to avoid missing characters, but they suffer from feature loss during feature extraction and fusion, leading to inaccurate labeling of long texts and a significant performance drop when processing small or low-light texts. These methods struggle to balance high accuracy and speed when facing noise interference, lighting variations, and image deformation in natural scenes, failing to effectively meet the ever-growing demands of practical applications. Summary of the Invention

[0004] The purpose of this invention is to provide a text detection method in low-light environments. This method combines text detection, localization, and character recognition algorithms to process and analyze text images in complex scenes, and identifies and extracts text information in low-light and high-noise environments. It has good detection and recognition results and can effectively improve the text information processing capability in complex scenes.

[0005] To achieve the above objectives, embodiments of the present invention provide a text detection method in low-light environments, comprising: The low-light text image to be detected is acquired, and the low-light text image is subjected to adaptive image quality preprocessing to obtain an enhanced text image. The enhanced text image is input into a preset target detection network to obtain the location coordinates of the text region in the text image. The text region image is cropped according to the positioning coordinates and input into a preset pixel segmentation network to obtain the text information outline in the text region image; Text information is extracted based on the text information contour, and then input into a preset text recognition network for feature extraction and sequence prediction to form a target text sequence.

[0006] Optionally, the adaptive image quality preprocessing includes: Convert low-light text images to grayscale images; A text region mask is generated using threshold segmentation to divide the low-light text image into text regions and non-text regions; Calculate the gamma correction coefficients for the text region and the non-text region respectively, and use the gamma correction coefficients to adaptively enhance the brightness of the low-light text image; Differential noise reduction processing is applied to the enhanced image; The denoised image is then subjected to contrast enhancement and edge enhancement processing, and the processed image is converted back to a BGR image. The average grayscale brightness of the image after contrast enhancement is calculated, the parameters are adjusted according to the average grayscale brightness, and the image is linearly adjusted to obtain the preprocessed text image.

[0007] Optionally, calculating the gamma correction coefficients for the text region and the non-text region separately includes: The gamma correction coefficient of the text region is obtained according to formula (1). (1) in, The gamma correction coefficient for the text region is... This represents the initial average grayscale brightness. The gamma correction coefficient of the non-text region is obtained according to formula (2). (2) in, This represents the gamma correction coefficient for non-text areas.

[0008] Optionally, the enhanced average grayscale brightness of the contrast-enhanced image is calculated, parameters are adjusted based on the enhanced average grayscale brightness, and linear brightness adjustment is performed on the image to obtain the preprocessed text image, including: Calculated according to formula (3), (3) in, This is the brightness adjustment factor. To enhance the average grayscale brightness; Calculated according to formula (4), (4) in, This is the brightness offset. Determine whether the average grayscale brightness is less than the preset brightness threshold; If the average grayscale brightness is determined to be less than the preset brightness threshold, a brightness adjustment coefficient is used. and brightness offset Perform linear brightness adjustment on the image; If the average grayscale brightness is greater than or equal to a preset brightness threshold, the enhanced text image is output.

[0009] Optionally, the target detection network model includes a feature extraction backbone network, a feature fusion neck network, and a multi-scale detection head; The feature extraction backbone network includes a first convolutional layer, a second convolutional layer, several feature extraction groups, and a first C3K2 module; one end of the first convolutional layer is used to input the image to be recognized, and the other end is connected to the second convolutional layer; the second convolutional layer is used to downsample the feature map and output it to the first C3K2 module; the feature extraction group is composed of a third convolutional layer and a C3K2 module connected in series, and multiple feature extraction groups are sequentially connected in series after the first C3K2 module; The feature fusion neck network includes a Spatial Pyramid Fast Pooling (SPFF) module and a Channel Attention (C2PSA) module connected in series, as well as a first fusion component, a second fusion component, a third fusion component, and a fourth fusion component connected in series. The input of the SPFF module is connected to the output of the last-stage feature extraction group of the feature extraction backbone network. The first fusion component includes a first upsampling unit, a first splicing unit, and a first C3K2 unit. The input of the first upsampling unit is connected to the output of the C2PSA module, and the output is connected to the output of the penultimate feature extraction group in the feature extraction backbone network through the first splicing unit. The first intermediate feature is obtained after fusion by the first C3K2 unit. The second fusion component includes a second upsampling unit, a second splicing unit, and a second C3K2 unit. The input of the second upsampling unit receives the first intermediate feature, and the output is connected to the output of the third-to-last feature extraction group in the feature extraction backbone network through the second splicing unit. After fusion by the second C3K2 unit, the feature is output to the first detection branch of the multi-scale detection head. The third fusion component includes a first downsampling unit, a third stitching unit, and a third C3K2 unit. The input of the first downsampling unit receives the output of the second fusion component, and the output is connected to the first intermediate feature through the third stitching unit. After being fused by the third C3K2 unit, the feature is output to the second detection branch of the multi-scale detection head. The fourth fusion component includes a second downsampling unit, a fourth splicing unit, and a fourth C3K2 unit. The input of the second downsampling unit receives the output of the third fusion component, and the output is connected to the output of the C2PSA module through the fourth splicing unit. After fusion by the fourth C3K2 unit, the output is sent to the third detection branch of the multi-scale detection head.

[0010] Optionally, the pixel segmentation network includes a PSENet network, which uses a Feature Pyramid Network (FPN) as its backbone and employs a Progressive Scale Expansion (PSE) algorithm to obtain the complete text region contour.

[0011] Optionally, the text recognition network adopts an SVTR network architecture, which includes a patch embedding layer, a multi-stage feature processing network, and a linear prediction unit connected in sequence. The patch embedding layer is used to divide the localized text image into several character components. The multi-stage feature processing network includes three levels, each consisting of a mixing block and a merging layer. Within each level, the feature dimensions are progressively downsampled and enriched through the mixing block. The hybrid block includes a local hybrid block and a global hybrid block. The local hybrid block and the global hybrid block share the same module topology, both including a layer normalization layer, a self-attention layer, a multilayer perceptron layer, and residual connections. The difference lies in the receptive field range of the self-attention layer. The local hybrid block adopts a sliding window approach and is configured to perform self-attention calculation within a predefined neighborhood of the character component to extract the stroke morphology features and local association information of the character. The hybrid block is configured to perform self-attention calculation on the entire sequence of character components, and by establishing long-term dependencies across characters, it is used to enhance the features of text components and weaken the influence of background non-text components.

[0012] On the other hand, the present invention provides a text detection system in a low-light environment, the system including a processor configured to perform any of the text detection methods described above in this application.

[0013] In another aspect, the present invention also provides a computer-readable storage medium storing instructions for being read by a machine to cause the machine to perform any of the text detection methods described above.

[0014] Through the above technical solution, this invention provides a text detection method and system for low-light environments. The method involves acquiring a low-light text image to be detected and performing adaptive image quality preprocessing to obtain an enhanced text image. The enhanced image is then input into a target detection network to obtain location coordinates, a pixel segmentation network to obtain the text information contour, and finally, a text recognition network for feature extraction and sequence prediction. This text detection method for low-light environments effectively solves the feature extraction problem in low-light and high-noise environments by combining preprocessing algorithms with multi-stage deep learning networks, achieving accurate localization and recognition of text in complex scenes with high accuracy.

[0015] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0016] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a text detection method in a low-light environment according to one embodiment of the present invention.

[0017] Figure 2 This is a flowchart of an adaptive image quality preprocessing method according to one embodiment of the present invention.

[0018] Figure 3 This is a flowchart illustrating linear brightness adjustment of an image based on parameters, according to one embodiment of the present invention.

[0019] Figure 4 This is a structural block diagram of a target detection network model according to one embodiment of the present invention.

[0020] Figure 5 This is a schematic diagram of a pixel segmentation network according to one embodiment of the present invention.

[0021] Figure 6 This is a structural block diagram of a text recognition network model according to one embodiment of the present invention. Detailed Implementation

[0022] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.

[0023] like Figure 1 The diagram shows a flowchart of a text detection method in a low-light environment according to an embodiment of the present invention. Figure 1 In Chinese, text detection methods can include: In step S10, the low-light text image to be detected is acquired; In step S11, the enhanced text image is input into a pre-trained target detection network to obtain the local coordinates of the text region in the text image; In step S12, the text region image is cropped according to the positioning coordinates of the text region and input into a pre-trained pixel segmentation network to obtain the text information contour in the text region image. In step S13, text information is extracted based on the text information contour and input into a pre-trained text recognition network for feature extraction and sequence prediction to form a target text sequence.

[0024] Based on this Figure 1 The method shown acquires the low-light text image to be detected and performs adaptive image quality preprocessing to obtain an enhanced text image. The enhanced image is then input into a target detection network to obtain localization coordinates, a pixel segmentation network is used to obtain the text information contour, and finally, the image is input into a text recognition network for feature extraction and sequence prediction. This text detection method in low-light environments effectively solves the feature extraction challenge in low-light and high-noise environments by combining preprocessing algorithms with multi-stage deep learning networks, achieving accurate localization and recognition of text in complex scenes with high accuracy.

[0025] In Figure 1 As shown, in step S10, a low-light text image to be detected is obtained. In order to better identify text characters in low-light and high-noise environments, and also to avoid mistaking noise information in the image for text information, adaptive image quality preprocessing can be performed on the low-light text image to obtain an enhanced text image.

[0026] In step S11, the enhanced text image is input into a pre-trained target detection network to obtain the location coordinates of the text region in the text image. To identify the character content in the text region of the image and reduce the algorithm's detection of irrelevant regions, the text detection region in the image is first located to obtain the text region to be identified. Text region detection is the foundation of image text information recognition, and its effectiveness affects the accuracy of subsequent text detection and character recognition, thus affecting the accuracy and speed of image text information recognition. The specific method for target detection can be of various forms known to those skilled in the art. Similarly, the specific network of this neural network model can also be of various forms known to those skilled in the art. However, in a preferred example of this invention, the structure of the neural network model can be as follows: Figure 4 As shown, for ease of explanation, Figure 4The network components are labeled using English tags: Backbone (feature extraction backbone), Neck (feature fusion neck network), Head (multi-scale detection head), and Conv, Upsample, and Concat (convolution, upsampling, and concatenation operations, respectively). Specifically, the target detection network model includes a feature extraction backbone, a feature fusion neck network, and a multi-scale detection head. The feature extraction backbone includes a first convolutional layer, a second convolutional layer, several feature extraction groups, and a first C3K2 module. One end of the first convolutional layer is used to input the image to be recognized, and the other end is connected to the second convolutional layer. The second convolutional layer is used to downsample the feature map and output it to the first C3K2 module. Each feature extraction group consists of a third convolutional layer and a C3K2 module connected in series, with multiple feature extraction groups sequentially connected after the first C3K2 module.

[0027] The feature fusion neck network includes a Spatial Pyramid Fast Pooling (SPFF) module and a Channel Attention (C2PSA) module connected in series, as well as a first fusion component, a second fusion component, a third fusion component, and a fourth fusion component connected in series. The input of the SPFF module is connected to the output of the last-level feature extraction group of the feature extraction backbone network. The first fusion component includes a first upsampling unit, a first splicing unit, and a first C3K2 unit. The input of the first upsampling unit is connected to the output of the C2PSA module, and its output is connected to the output of the penultimate-level feature extraction group in the feature extraction backbone network via the first splicing unit. After fusion by the first C3K2 unit, a first intermediate feature is obtained. The second fusion component includes a second upsampling unit, a second splicing unit, and a second C3K2 unit. The input of the second upsampling unit receives the first intermediate feature, and its output is connected to the output of the third-to-last-level feature extraction group in the feature extraction backbone network via the second splicing unit. After fusion by the second C3K2 unit, the feature is output to the first detection branch of the multi-scale detection head. The third fusion component includes a first downsampling unit, a third stitching unit, and a third C3K2 unit. The input of the first downsampling unit receives the output of the second fusion component, and its output is connected to the first intermediate feature through the third stitching unit. After fusion by the third C3K2 unit, the output is sent to the second detection branch of the multi-scale detection head. The fourth fusion component includes a second downsampling unit, a fourth stitching unit, and a fourth C3K2 unit. The input of the second downsampling unit receives the output of the third fusion component, and its output is connected to the output of the C2PSA module through the fourth stitching unit. After fusion by the fourth C3K2 unit, the output is sent to the third detection branch of the multi-scale detection head.

[0028] In step S12, the text region image is cropped according to the positioning coordinates of the text region and input into a pre-trained pixel segmentation network to obtain the text information contour in the text region image. Currently, most common image text detection algorithms are designed for text with a relatively good distribution, but they cannot accurately handle the adhesion between characters and are not suitable for detecting text of arbitrary shapes. Therefore, in this invention, the pixel segmentation network includes a PSENet network, such as... Figure 5 As shown in the schematic diagram of the pixel segmentation network, PSENet uses a Feature Pyramid Network (FPN) as its backbone and employs the Progressive Scale Expansion (PSE) algorithm to obtain the complete text region contour. Based on FPN, PSENet generates multiple segmentation results at different scales (S1, S2, …, Sn), where S1 represents the smallest scale segmentation result and Sn represents the largest scale segmentation result. The PSE algorithm is then used to progressively expand from S1 to Sn, ultimately obtaining the complete text region.

[0029] In step S13, text information is extracted based on the text information contour and input into a pre-trained text recognition network for feature extraction and sequence prediction to form a target text sequence. Due to the influence of text deformation, font, occlusion, and cluttered backgrounds during scene text recognition, in order to accurately and efficiently convert text in natural images into character sequences, this invention employs the SVTR-T algorithm to further locate the text information region in the image, such as... Figure 6The diagram shows the SVTR text recognition network architecture used in this embodiment. For ease of illustration, the English labels for common technical terms are retained in the diagram, and their correspondence with the text description in this application is as follows: Patch Embedding corresponds to the patch embedding layer; Mixing Blocks correspond to mixing blocks; Merging corresponds to the merging layer; FC (Fully Connected Layer) corresponds to the linear prediction unit; CC (Character Component) corresponds to the character component; Stage 1 / 2 / 3 corresponds to the three levels of the multi-stage feature processing network. It includes a patch embedding layer, a multi-stage feature processing network, and a linear prediction unit connected in sequence. The patch embedding layer is used to divide the located text image into several character components. The multi-stage feature processing network includes three levels, each consisting of mixing blocks and a merging layer, and within each level, the mixing blocks progressively downsample and enrich the feature dimensions. The hybrid block includes a local hybrid block and a global hybrid block. The local hybrid block and the global hybrid block share the same module topology, both including a layer normalization layer, a self-attention layer, a multilayer perceptron layer, and residual connections. The difference lies in the receptive field range of the self-attention layer. The local hybrid block adopts a sliding window approach and is configured to perform self-attention calculation within a predefined neighborhood of the character component to extract the stroke morphology features and local association information of the character. The hybrid block is configured to perform self-attention calculation on the entire sequence of character components, and by establishing long-term dependencies across characters, it is used to enhance the features of text components and weaken the influence of background non-text components.

[0030] like Figure 2 The diagram shows a flowchart of adaptive image quality preprocessing according to one embodiment of the present invention. Figure 2 In this context, adaptive image quality preprocessing includes: In step S20, the low-light text image is converted into a grayscale image; In step S21, a text region mask is generated using threshold segmentation to divide the low-light text image into text regions and non-text regions. In step S22, the gamma correction coefficients for the text region and the non-text region are calculated respectively, and the brightness of the low-light text image is adaptively enhanced using the gamma correction coefficients. In step S23, differential noise reduction processing is performed on the enhanced image; In step S24, the denoised image is subjected to contrast enhancement and edge enhancement processing, and the processed image is converted back to a BGR image; In step S25, the average grayscale brightness of the contrast-enhanced image is calculated, the parameters are adjusted according to the average grayscale brightness, and the image is linearly adjusted to obtain the preprocessed text image.

[0031] In such Figure 2 In the adaptive image quality preprocessing shown, step S20 converts the low-light text image into a grayscale image to facilitate further image processing.

[0032] In step S21, a text region mask is generated using threshold segmentation to divide the image into text regions and non-text regions. Specifically, the Otsu method is used to perform threshold segmentation on the grayscale image to obtain a binary image. A rectangular structuring element of size (5,5) is used to perform two dilation operations and one erosion operation on the binary image to generate a text region mask, which is used to distinguish between text regions and non-text regions in the image.

[0033] In step S22, the gamma correction coefficients for the text region and the non-text region are calculated separately, and the image brightness is adaptively enhanced using the gamma correction coefficients. Specifically, in one example of the present invention, calculating the gamma correction coefficients for the text region and the non-text region may include formulas (1) and (2). The gamma correction coefficient for the text region is obtained according to formula (1). (1) in, The gamma correction coefficient for the text region. This represents the initial average grayscale brightness. The gamma correction coefficient for the non-text region is obtained according to formula (2). (2) in, This represents the gamma correction coefficient for non-text areas.

[0034] In step S23, differential denoising is performed on the enhanced image. Based on the text region mask, the initially enhanced image is divided into text regions and non-text regions. A bilateral filtering algorithm is used to denoise the text regions, with the filtering parameters set as neighborhood diameter d=3, color standard deviation sigmaColor=10, and spatial standard deviation sigmaSpace=10. A fast nonlocal mean denoising color image algorithm is used to denoise the non-text regions, with parameters set as h=7, template window size templateWindowSize=7, and search window size searchWindowSize=21. The denoised text and non-text region images are then merged to obtain the denoised image.

[0035] In step S24, the denoised image undergoes contrast enhancement and edge strengthening processing, and the processed image is converted back to a BGR image. The denoised image is converted from the BGR color space to the LAB color space, and the luminance channel L is separated. The average luminance of the text region is calculated, and the cropping limit parameters of the CLAHE algorithm are adjusted according to the formula. When the average luminance of the text region is greater than 50, the grid size of the adaptive histogram equalization is set to 8×8; otherwise, it is set to 16×16. Adaptive histogram equalization processing is performed on the luminance channel L. Canny edge detection is performed on the luminance channel L, with a low threshold of 50 and a high threshold of 150, and a dilation operation is performed using a rectangular structuring element of size (5,5). The edge detection result is fused with the processed luminance channel L with a weight of 0.9:0.1, and then merged with the A and B channels before being converted back to the BGR color space to obtain the contrast-enhanced image.

[0036] In step S25, the average grayscale brightness of the image after contrast enhancement is calculated, the parameters are adjusted according to the average grayscale brightness, and the image is linearly adjusted to obtain the preprocessed text image.

[0037] like Figure 3 The diagram shows a flowchart of linear brightness adjustment of an image based on parameters according to one embodiment of the present invention. Figure 3 In this context, linear brightness adjustment of low-light text images based on parameters can include: In steps S30 and S31, it is determined whether the average grayscale brightness is less than a preset brightness threshold. In step S32, if the average grayscale brightness is determined to be less than a preset brightness threshold, a brightness adjustment coefficient is applied. and brightness offset Perform linear brightness adjustment on the image; In step S33, if the average grayscale brightness is greater than or equal to a preset brightness threshold, the image after contrast enhancement is kept unchanged. In step S34, the enhanced text image is obtained.

[0038] Specifically, in one example of the present invention, calculating the brightness adjustment coefficient and the brightness offset may include formulas (3) and (4), calculated according to formula (3). (3) in, This is the brightness adjustment factor. To enhance the average grayscale brightness; Calculated according to formula (4), (4) in, This represents the brightness offset.

[0039] In steps S30 and S31, it is determined whether the enhanced average grayscale brightness is less than a preset brightness threshold. In one embodiment of the present invention, the brightness threshold is set to 100.

[0040] In step S32, if the enhanced average grayscale brightness is less than a preset brightness threshold, a brightness adjustment coefficient is applied. and brightness offset Perform linear brightness adjustment on the image.

[0041] In step S33, if it is determined that the enhanced average grayscale brightness is greater than or equal to a preset brightness threshold, the image after contrast enhancement is kept unchanged.

[0042] In step S34, the enhanced text image is finally obtained.

[0043] On the other hand, the present invention provides a text detection system in a low-light environment, the system including a processor configured to perform any of the text detection methods described above in this application.

[0044] In another aspect, the present invention also provides a computer-readable storage medium storing instructions for being read by a machine to cause the machine to perform any of the text detection methods described above.

[0045] Through the above technical solution, this invention provides a text detection method and system for low-light environments. By acquiring a low-light text image to be detected and performing adaptive image quality preprocessing to obtain an enhanced text image, the enhanced image is input into a target detection network to obtain location coordinates. A pixel segmentation network is used to obtain the text information contour, and finally, the image is input into a text recognition network for feature extraction and sequence prediction. This text detection method for low-light environments effectively solves the feature extraction problem in low-light and high-noise environments by combining preprocessing algorithms with multi-stage deep learning networks, achieving accurate localization and recognition of text in complex scenes with high accuracy.

[0046] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0047] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0048] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0049] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0050] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0051] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0052] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0053] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0054] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A text detection method in low-light environments, characterized in that, include: The low-light text image to be detected is acquired, and the low-light text image is subjected to adaptive image quality preprocessing to obtain an enhanced text image. The enhanced text image is input into a preset target detection network to obtain the location coordinates of the text region in the text image. The text region image is cropped according to the positioning coordinates and input into a preset pixel segmentation network to obtain the text information outline in the text region image; Text information is extracted based on the text information contour, and then input into a preset text recognition network for feature extraction and sequence prediction to form a target text sequence.

2. The text detection method according to claim 1, characterized in that, The adaptive image quality preprocessing includes: Convert low-light text images to grayscale images; A text region mask is generated using threshold segmentation to divide the low-light text image into text regions and non-text regions; Calculate the gamma correction coefficients for the text region and the non-text region respectively, and use the gamma correction coefficients to adaptively enhance the brightness of the low-light text image; Differential noise reduction processing is applied to the enhanced image; The denoised image is then subjected to contrast enhancement and edge enhancement processing, and the processed image is converted back to a BGR image. The average grayscale brightness of the image after contrast enhancement is calculated, the parameters are adjusted according to the average grayscale brightness, and the image is linearly adjusted to obtain the preprocessed text image.

3. The text detection method according to claim 2, characterized in that, The calculation of the gamma correction coefficients for the text region and the non-text region includes: The gamma correction coefficient of the text region is obtained according to formula (1). ,(1) in, The gamma correction coefficient for the text region is... This represents the initial average grayscale brightness. The gamma correction coefficient of the non-text region is obtained according to formula (2). ,(2) in, This represents the gamma correction coefficient for non-text areas.

4. The text detection method according to claim 2, characterized in that, Calculate the enhanced average grayscale brightness of the contrast-enhanced image, adjust parameters based on the enhanced average grayscale brightness, and perform linear brightness adjustment on the image to obtain the preprocessed text image, including: Calculated according to formula (3), ,(3) in, This is the brightness adjustment factor. To enhance the average grayscale brightness; Calculated according to formula (4), ,(4), in, This is the brightness offset. Determine whether the average grayscale brightness is less than the preset brightness threshold; If the average grayscale brightness is determined to be less than the preset brightness threshold, a brightness adjustment coefficient is used. and brightness offset Perform linear brightness adjustment on the image; If the average grayscale brightness is greater than or equal to a preset brightness threshold, the enhanced text image is output.

5. The text detection method according to claim 1, characterized in that, The target detection network model includes a feature extraction backbone network, a feature fusion neck network, and a multi-scale detection head; The feature extraction backbone network includes a first convolutional layer, a second convolutional layer, several feature extraction groups, and a first C3K2 module. One end of the first convolutional layer is used to input the image to be recognized, and the other end is connected to the second convolutional layer. The second convolutional layer is used to downsample the feature map and output it to the first C3K2 module. The feature extraction group is composed of a third convolutional layer and a C3K2 module connected in series. Multiple feature extraction groups are sequentially connected in series after the first C3K2 module. The feature fusion neck network includes a spatial pyramid fast pooling module and a channel attention module connected in series, as well as a first fusion component, a second fusion component, a third fusion component and a fourth fusion component connected in series, wherein the input end of the spatial pyramid fast pooling module is connected to the output end of the last-level feature extraction group of the feature extraction backbone network; The first fusion component includes a first upsampling unit, a first splicing unit, and a first C3K2 unit. The input of the first upsampling unit is connected to the output of the channel attention module, and the output is connected to the output of the penultimate feature extraction group in the feature extraction backbone network through the first splicing unit. The first intermediate feature is obtained after fusion by the first C3K2 unit. The second fusion component includes a second upsampling unit, a second splicing unit, and a second C3K2 unit. The input of the second upsampling unit receives the first intermediate feature, and the output is connected to the output of the third-to-last feature extraction group in the feature extraction backbone network through the second splicing unit. After fusion by the second C3K2 unit, the feature is output to the first detection branch of the multi-scale detection head. The third fusion component includes a first downsampling unit, a third stitching unit, and a third C3K2 unit. The input of the first downsampling unit receives the output of the second fusion component, and the output is connected to the first intermediate feature through the third stitching unit. After being fused by the third C3K2 unit, the feature is output to the second detection branch of the multi-scale detection head. The fourth fusion component includes a second downsampling unit, a fourth splicing unit, and a fourth C3K2 unit. The input of the second downsampling unit receives the output of the third fusion component, and the output is connected to the output of the channel attention module through the fourth splicing unit. After fusion by the fourth C3K2 unit, the output is sent to the third detection branch of the multi-scale detection head.

6. The text detection method according to claim 1, characterized in that, The pixel segmentation network includes the PSENet network, which uses the Feature Pyramid Network (FPN) as its backbone and employs the Progressive Scale Expansion (PSE) algorithm to obtain the complete text region contour.

7. The text detection method according to claim 1, characterized in that, The text recognition network adopts the SVTR network architecture, which includes a patch embedding layer, a multi-stage feature processing network, and a linear prediction unit connected in sequence. The patch embedding layer is used to divide the localized text image into several character components. The multi-stage feature processing network includes three levels, each consisting of a mixing block and a merging layer. Within each level, the feature dimensions are progressively downsampled and enriched through the mixing block. The hybrid block includes a local hybrid block and a global hybrid block. The local hybrid block and the global hybrid block share the same module topology, both including a layer normalization layer, a self-attention layer, a multilayer perceptron layer, and residual connections. The difference lies in the receptive field range of the self-attention layer. The local hybrid block adopts a sliding window approach and is configured to perform self-attention calculation within a predefined neighborhood of the character component to extract the stroke morphology features and local association information of the character. The global hybrid block is configured to perform self-attention calculation on the entire sequence of character components, and by establishing long-term dependencies across characters, it is used to enhance the features of text components and weaken the influence of background non-text components.

8. A text detection system for low-light environments, characterized in that, The system includes a processor configured to perform the text detection method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that are read by a machine to cause the machine to perform the text detection method as described in any one of claims 1 to 7.