A time labeling automatic identification method for a complex background, an electronic device, and a computer readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU TITANIUM DATA TECHNOLOGY CO LTD
- Filing Date
- 2026-03-02
- Publication Date
- 2026-06-05
AI Technical Summary
Existing OCR technology has a low accuracy rate when recognizing time markers in surveillance videos with complex backgrounds, making it difficult to accurately separate the marker elements from the background, which leads to difficulties in automatic recognition.
By extracting time-stamped sub-images from video frames, creating time-stamped grayscale images, performing erosion and dilation operations to eliminate background interference, and using convolutional neural networks to recognize numbers and accurately locate character positions, automatic time stamp recognition is achieved.
It improved the automatic recognition accuracy of time markers in complex backgrounds, reaching 95.85%, which is significantly better than existing technologies.
Smart Images

Figure CN122156746A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, specifically relating to an automatic time-marking recognition method for complex backgrounds, an electronic device, and a computer-readable storage medium. Background Technology
[0002] Surveillance videos often use timestamps in the format of "**** year ** month ** day ** :** :** to indicate the monitoring time (e.g.) Figure 1 As shown in the figure, these time stamps need to be automatically identified in many applications.
[0003] The time markers in the surveillance video are selected based on the overall background color of the location of the marker element (number, text, symbol) to ensure that the time markers are clearly visible. However, the following problems exist in the process of automatic machine recognition of time markers: (1) The color of the marker element is based on the overall background color of its location. Due to the complexity and variability of the surveillance screen, it is often difficult to distinguish the color of some marker elements from the background color, such as Figure 2 The “2”, “0”, and “5” are shown in the red border. (2) The original time stamps are pure black or pure white. However, video compression algorithms can confuse the color of the time stamps with the background color of their location, making it more difficult to accurately separate the time stamps from the background. These problems make it difficult to use machines to automatically identify time stamps.
[0004] Automatic time stamp recognition falls under the field of Optical Character Recognition (OCR). Current OCR technologies include Tesseract and PaddleOCR; however, these technologies do not achieve ideal accuracy when recognizing time stamps with complex backgrounds. For example… Figure 2 As shown, neither Tesseract nor PaddleOCR could fully recognize the time stamps; the numbers within the red borders were not correctly identified. Experiments show that, for time stamp recognition of 10,000 video surveillance images with complex backgrounds, Tesseract's accuracy was only 68.3%, while PaddleOCR's accuracy was 75.12%. Summary of the Invention
[0005] This invention aims to provide an automatic time stamp recognition method, electronic device, and computer-readable storage medium for complex backgrounds. This automatic time stamp recognition method for complex backgrounds can automatically recognize time information marked in surveillance videos and has the advantage of high recognition accuracy.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: An automatic time stamp recognition method for complex backgrounds is provided, the method comprising: S10: Extract a time-stamped sub-image from the video frame to obtain the time-stamped sub-image. The extracted time-stamped sub-image Includes labeled time information; S20: Extract time-labeled subplots The time-marked pixels in the data include: S21: Subgraph based on time stamp Create a time-stamped grayscale image The time-stamped grayscale image The black pixels in the image represent the time-marked sub-image. The near-black pixels and near-white pixels in the time-stamped grayscale image The white pixels in the image represent the time-marked sub-image. Other color pixels; S22: Eliminate the time-stamped grayscale image through erosion and dilation operations. Background interference was eliminated to obtain an enhanced time-stamped grayscale image. ; S30: Extract the enhanced time-marked grayscale image The time stamp characters in the text include: S31: Locate the enhanced time-marked grayscale image. The set of pixels corresponding to each character in the time stamp; S32: Locate the enhanced time-marked grayscale image. The precise upper and lower boundaries of the time markers in the text; S33: Locate the enhanced time-marked grayscale image. The precise position of characters in the time stamp; S40: Based on the enhanced time-marked grayscale image The extracted time stamp characters are used to identify the numbers and restore the time stamp.
[0007] Preferably, in step S10, the time-marked sub-image is extracted. The method involves cropping based on the estimated coordinates of the four vertices.
[0008] Preferably, step S21 specifically includes: S211: Based on the time-marked subgraph Construct the first pixel labeled sub-image : Given the time-marked subgraph pixel position and the pixels here The value is determined according to the following formula for the first pixel annotation sub-image. The corresponding position grayscale value at : ; S212: Based on the time-marked subgraph Construct the second pixel labeled sub-image : The time-marked subgraph Convert to grayscale Given the grayscale image pixel position and the grayscale value of this pixel The second pixel annotation sub-image is determined according to the following formula. The corresponding position grayscale value at : , . Preferably, step S22 specifically includes: S221: For the aforementioned time-marked grayscale image Perform corrosion operation: The time-marked grayscale image The white pixels are set to 0, and the black pixels are set to 1, forming the matrix shown below: , The erosion operation kernel is an elliptical kernel with a size of [size missing]. As shown below: , The time-marked grayscale image is traversed using an erosion kernel as a window. The matrix, assuming that a window at a certain moment during the traversal corresponds to the aforementioned time-marked grayscale image. The matrix element values are: , After the corrosion of the core, The value is: , S222: Time-annotated grayscale image after the etching operation Matrix expansion operation: The expansion operation also selects an elliptical kernel, with a kernel size of [missing value]. The time-stamped grayscale image after window traversal erosion operation is represented by an inflating kernel. Matrix, assuming the window corresponds to a certain moment during the traversal. The matrix element values are: , After corrosion and expansion operations, the following is obtained: Figure 4 The enhanced time-stamped grayscale image shown .
[0009] Preferably, step S31 specifically includes: searching for the enhanced time-stamped grayscale image. All connected components, for the enhanced time-labeled grayscale image For all pixels with a grayscale value of 0, a connected component is constructed using 4-neighborhood connectivity, assuming the enhanced time-labeled grayscale image... Contains m connected components First, based on the number of pixels contained in the connected components... Perform filtering: If Then assume connected components For character connectivity branches.
[0010] Preferably, step S32 specifically includes: Given a set of connected character branches For each traverse all its pixel positions Find the maximum pixel height. and minimum value This forms the set of maximum pixel heights. and the set of minimum pixel heights ; Remove the set of maximum pixel heights and the set of minimum pixel heights The extreme values in the set of maximum pixel heights The elements are first arranged in ascending order to form a sequence. Iterate through the elements sequentially and adjust the element values according to the following formula: , For the corrected sequence Take the majority As the upper bound of the time marker; Form the corrected sequence in the same manner as above. Take the majority As the lower bound of the time marker, according to and Cropping the enhanced time-marked grayscale image .
[0011] Preferably, step S33 specifically includes: providing the cropped enhanced time-annotated grayscale image. Its width range is The height range is Traverse positions from left to right Regarding location If from coordinates arrive If no black pixel is encountered, the counter... Increment by one; if a black pixel is encountered, the counter... Clear to zero; after the traversal is complete, the counter is... The starting position corresponding to the maximum value and end position That is, the blank position, starting from the aforementioned starting position. To the left and from the end position By moving the character to the right by the corresponding width, you can precisely locate its position.
[0012] Preferably, in step S40, using a convolutional neural network to recognize digital images includes: S41: Manually collect and label digital images, and divide the labeled digital images into training set, test set and validation set; S42: Constructing a convolutional neural network: The convolutional kernel size in the convolutional layer is 3×3, with 1 input channel and 64 output channels, and the ReLU activation function is used; the pooling layer uses max pooling operation, and the pooling window size is 2×2; the fully connected layer has 1024 input nodes and 10 output nodes, and the Softmax activation function is used. S43: Model training is performed using the Adam optimizer; S44: Model usage, the digital images obtained in step S33 are sequentially input into the convolutional neural network, the recognition results are output, and the images are spliced together to restore the time label.
[0013] The present invention also provides an electronic device, including a processor and a memory communicatively connected thereto, the memory storing instructions executable by the processor, the instructions being executed by the processor to enable the processor to perform the automatic time stamp recognition method for complex backgrounds described in any of the preceding claims.
[0014] The present invention also provides a non-volatile computer-readable storage medium containing computer-readable instructions, which, when executed by a processor, cause the processor to perform the automatic time stamp recognition method for complex backgrounds described in any of the preceding claims.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: The automatic time stamp recognition method for complex backgrounds includes processing steps such as cropping a time stamp region sub-image, extracting time stamp pixels, extracting time stamp characters, and recognizing numbers to restore the time stamp. When extracting time stamp pixels, near-black pixels, near-white pixels, and other colored pixels in the time stamp sub-image are processed separately, and the image is enhanced. When extracting time stamp characters, the precise position of each character is obtained through a series of methods, thereby providing a basis for subsequent accurate number recognition. This method can solve the problem of automatic time stamp recognition in complex backgrounds and has the advantage of high recognition accuracy. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 Images showing timestamps in surveillance videos indicating the monitoring time.
[0017] Figure 2 This is a sub-image of the time-marked region extracted in one embodiment of the automatic time-marking recognition method for complex backgrounds according to the present invention.
[0018] Figure 3 for Figure 2 The corresponding time-stamped grayscale image.
[0019] Figure 4 This is an enhanced time-annotated grayscale image obtained after corrosion and expansion operations.
[0020] Figure 5 Add grayscale images to the cropped, enhanced time.
[0021] Figure 6 This is a diagram illustrating the location of each character in the marked time. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] In one embodiment, an automatic time stamp recognition method for complex backgrounds is provided. This method includes the following steps: cropping a sub-image of the time stamp region, extracting time stamp pixels, extracting time stamp characters, and recognizing numbers to restore the time stamp. The steps of this method are described in detail below: S10: Extract a time-stamped sub-image from the video frame to obtain the time-stamped sub-image. The extracted time-stamped sub-image It includes labeled time information.
[0024] In this step, to improve the accuracy and efficiency of time stamp recognition, a sub-image (called the time stamp sub-image) is first extracted based on the approximate location of the time stamp. The extraction method involves extracting the data based on the estimated coordinates of the four vertices. The extracted data is shown below. Figure 2 As shown, the extracted time-stamped sub-image It contains labeled time information.
[0025] In surveillance videos, time markers are typically placed at corresponding locations based on user requirements (e.g., a user requests a time marker to be added to the top center of the video frame). The positions where video surveillance equipment adds time markers to video frames are relatively fixed, therefore, the extracted time marker sub-images... Its position in the video frame is relatively fixed.
[0026] S20: Extract time-labeled subplots The time marker pixels in the image.
[0027] For time-labeled subgraphs It is necessary to extract as many time-marked pixels as possible. The characters in the time-marked text may be white or black. The time-marked pixels should be extracted according to the following steps: S21: Subgraph based on time stamp Create a time-stamped grayscale image Time-stamped grayscale image The black pixels in the image represent the time-marked sub-image. Near-black and near-white pixels in the time-stamped grayscale image. The white pixels in the image represent the time-marked sub-image. Other color pixels in the middle.
[0028] Created time-stamped grayscale image It contains only black pixels (grayscale value of 0) and white pixels (grayscale value of 255), and its height and width are the same as the time-marked subimage. Same. Create a time-stamped grayscale image. The process is as follows: S211: Subgraph based on time stamp Construct the first pixel labeled sub-image .
[0029] Given a time-labeled subgraph pixel position and the pixels here The value is determined by the following formula for the first pixel annotation sub-image. The corresponding position grayscale value at :
[0030] This formula is based on the time-marked subgraph. The near-black pixels in the image will label the first pixel as a sub-image. The corresponding element in the text is marked in black.
[0031] S212: Subgraph based on time stamp Construct the second pixel labeled sub-image .
[0032] Time-marked subgraph Convert to grayscale Given a grayscale image pixel position in and the grayscale value of this pixel The second pixel annotation sub-image is determined according to the following formula. The corresponding position grayscale value at :
[0033] This formula is based on the time-marked subgraph. The near-white pixels in the image will label the second pixel in the sub-image. The corresponding element in the text is marked in black.
[0034] S213: Merge the first pixel labeled sub-image Second pixel labeled sub-image Generate time-stamped grayscale images Given a time-annotated grayscale image pixel position pixel grayscale value as follows:
[0035] Figure 2 Corresponding time-stamped grayscale image like Figure 3 As shown. That is, the first pixel labeled sub-image The corresponding pixel value is 0. That is, the second pixel labeled sub-image The corresponding pixel value is 0.
[0036] S22: Eliminating time-stamped grayscale images through erosion and dilation operations Background interference.
[0037] Depend on Figure 3 As can be seen, since the background of time-monitoring videos is usually quite complex, the time marker pixels extracted from the color contain a lot of interference. Therefore, it is necessary to eliminate background interference as much as possible through erosion and dilation operations. The specific steps are as follows: S221: Grayscale image with time annotation Perform corrosion operation.
[0038] Time-marked grayscale image The white pixels are set to 0, and the black pixels are set to 1, forming the matrix shown below:
[0039] The erosion operation kernel is an elliptical kernel with a size of 3×3, as shown below:
[0040] Use an erosion kernel to annotate grayscale images for window traversal time. A matrix, assuming a window at a certain moment during the traversal corresponds to a grayscale image with time annotations. The matrix element values are:
[0041] After the corrosion of the core, The value is:
[0042] S222: Time-annotated grayscale image after the etching operation The matrix is expanded.
[0043] The dilation operation also selects an elliptical kernel with a size of 3×3. The dilated kernel is used to annotate the grayscale image during window traversal. Matrix, assuming the window corresponds to a certain moment during the traversal. The matrix element values are:
[0044] After the expansion of the core, The value is:
[0045] After corrosion and expansion operations, the following is obtained: Figure 4 The enhanced time-stamped grayscale image shown .
[0046] S30: Extract enhanced time-labeled grayscale image The time stamp character in the text.
[0047] For enhanced time-stamped grayscale images To extract all the numbers from the timestamp, the specific steps are as follows: S31: Find the enhanced time-annotated grayscale image The set of pixels corresponding to each character in the time stamp.
[0048] First, find the enhanced time-marked grayscale image. All connected components, where a connected component is a region in an image that consists of adjacent pixels with the same pixel value. This is for enhanced time-labeled grayscale images. For all pixels with a grayscale value of 0, construct connected components using 4-neighborhood connectivity (i.e., the four pixels above, below, left, and right of the current pixel are connected pixels). Assume an enhanced time-labeled grayscale image. Contains m connected components First, based on the number of pixels contained in the connected component. Perform filtering: If Then assume connected components For character connectivity branches. This threshold range can remove large or small interfering noise pixels affected by the background, minimizing background interference.
[0049] S32: Find the enhanced time-annotated grayscale image The precise upper and lower boundaries of the time stamp.
[0050] Given a set of connected components For each traverse all its pixel positions Find the maximum pixel height. and minimum value This forms the set of maximum pixel heights. and the set of minimum pixel heights .
[0051] To eliminate interference from the background (i.e., mistaking background interference components for character connectivity components), it is necessary to remove the set. and The extreme values in. For The elements are first arranged in ascending order to form a sequence. Iterate through the elements sequentially and adjust the element values according to the following formula:
[0052] For the corrected sequence Take the majority As the upper bound of the time marker.
[0053] Similarly, the corrected sequence is formed in the same way. Take the majority As the lower bound of the time marker. According to and Clipping Enhancement Time-Labeled Grayscale Image ,like Figure 5 As shown.
[0054] S33: Find the enhanced time-annotated grayscale image The precise position of characters in the time stamp.
[0055] In time stamps, there is a noticeable blank space between "year, month, day" and "hour, minute, second" that can be used to locate the left and right boundaries of the time stamp; therefore, it is necessary to locate this blank space. (Given a cropped, enhanced grayscale image of the time stamp.) Its width range is The height range is Traverse positions from left to right Regarding location If from coordinates arrive (that is, in) (Scanning from top to bottom) If no black pixel is encountered, the counter... Add one; if a black pixel is encountered, then... Clear to zero. After the traversal is complete, The starting position corresponding to the maximum value and end position That is, the blank space.
[0056] Since the width of each number, "-", and ":" in the time stamp is fixed, then from To the left and By moving the character to the right by the corresponding width, you can precisely locate its exact position. Figure 6 As shown.
[0057] S40: Based on the enhanced time-annotated grayscale image The extracted time stamp characters are used to identify the numbers and restore the time stamp.
[0058] The specific steps for using a convolutional neural network to recognize digital images are as follows: S41: Manually collect and label digital images, and divide the labeled digital images into training set, test set and validation set.
[0059] For example, 5,000 digital images are manually collected and labeled, with 3,000 used as the training set, 1,000 as the test set, and 1,000 as the validation set.
[0060] S42: Constructing a Convolutional Neural Network: The convolutional kernel size in the convolutional layer is 3×3, with 1 input channel and 64 output channels, using the ReLU activation function; the pooling layer uses max pooling, with a pooling window size of [missing value]. The fully connected layer has 1024 input nodes and 10 output nodes, and uses the Softmax activation function.
[0061] S43: Model Training. The Adam optimizer was used with a learning rate of 0.001, and the training iterations were 20 times, with 50 images trained each time.
[0062] S44: Model Usage. The digital images obtained in step S33 are sequentially input into the convolutional neural network, which outputs the recognition results and then concatenates them to restore the time labeling.
[0063] This method for automatic time stamp recognition in complex backgrounds solves the problem of automatic time stamp recognition in complex backgrounds through the steps of cropping time stamp region sub-images, extracting time stamp pixels, extracting time stamp characters, and recognizing numbers to restore the time stamp. It boasts a high recognition accuracy. Compared to existing technologies like Tesseract and PaddleOCR, in an experiment involving the time stamp recognition of 10,000 video surveillance images with complex backgrounds, Tesseract achieved an accuracy of only 68.3%, while PaddleOCR achieved 79.12%. The method proposed in this invention achieves a recognition accuracy of 95.85%.
[0064] In one embodiment, an electronic device is provided, including a processor and a memory communicatively connected thereto. The memory stores instructions executable by the processor, which, when executed, enable the processor to perform any of the preceding automatic time-marking recognition methods for complex backgrounds. Specifically, the memory can be communicatively connected to the processor via a bus or other means. As a non-volatile computer-readable storage medium, the memory can be used to store non-volatile software programs, such as the rules corresponding to the method steps in the preceding embodiments, which are stored in the memory. The processor executes the corresponding functional application in the electronic device by running the non-volatile software program stored in the memory, thereby implementing the method in the above embodiments to automatically recognize the time information marked in video frames.
[0065] In one embodiment, a non-volatile computer-readable storage medium containing computer-readable instructions is provided. When executed by a processor, the computer-readable instructions cause the processor to perform any of the preceding methods for automatic time stamp identification in complex contexts. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0066] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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.
[0067] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for automatic recognition of time stamps in complex backgrounds, characterized in that, The method includes: S10: Extract a time-stamped sub-image from the video frame to obtain the time-stamped sub-image. The extracted time-stamped sub-image Includes labeled time information; S20: Extract time-labeled subplots The time-marked pixels in the data include: S21: Subgraph based on time stamp Create a time-stamped grayscale image The time-stamped grayscale image The black pixels in the image represent the time-marked sub-image. The near-black pixels and near-white pixels in the time-stamped grayscale image The white pixels in the image represent the time-marked sub-image. Other color pixels; S22: Eliminate the time-stamped grayscale image through erosion and dilation operations. Background interference was eliminated to obtain an enhanced time-stamped grayscale image. ; S30: Extract the enhanced time-marked grayscale image The time stamp characters in the text include: S31: Locate the enhanced time-marked grayscale image. The set of pixels corresponding to each character in the time stamp; S32: Locate the enhanced time-marked grayscale image. The precise upper and lower boundaries of the time markers in the text; S33: Locate the enhanced time-marked grayscale image. The precise position of characters in the time stamp; S40: Based on the enhanced time-marked grayscale image The extracted time stamp characters are used to identify the numbers and restore the time stamp.
2. The automatic time stamp recognition method for complex backgrounds according to claim 1, characterized in that: In step S10, the time-marked sub-image is extracted. The method involves cropping based on the estimated coordinates of the four vertices.
3. The automatic time stamp recognition method for complex backgrounds according to claim 1, characterized in that, The steps in S21 specifically include: S211: Based on the time-marked subgraph Construct the first pixel labeled sub-image : Given the time-marked subgraph pixel position The first pixel annotation sub-image is determined based on the RGB value of the pixel here, according to the following formula. The corresponding position grayscale value at : ; S212: Based on the time-marked subgraph Construct the second pixel labeled sub-image : The time-marked subgraph Convert to grayscale Given the grayscale image pixel position and the grayscale value of this pixel The second pixel annotation sub-image is determined according to the following formula. The corresponding position grayscale value at : ; S213: Merge the first pixel-annotated sub-image and the second pixel labeled sub-image Generate time-stamped grayscale images The time-stamped grayscale image pixel position pixel grayscale value as follows:
4. The automatic time stamp recognition method for complex backgrounds according to claim 1, characterized in that, The steps in S22 specifically include: S221: For the aforementioned time-marked grayscale image Perform corrosion operation: The time-marked grayscale image The white pixels are set to 0, and the black pixels are set to 1, forming the matrix shown below: , The time-marked grayscale image is traversed using an erosion kernel as a window. The matrix, assuming that a window at a certain moment during the traversal corresponds to the aforementioned time-marked grayscale image. The matrix element values are: , S222: Time-annotated grayscale image after the etching operation Matrix expansion operation: The expansion operation also selects an elliptical kernel, with a kernel size of [missing value]. The time-stamped grayscale image after window traversal erosion operation is represented by an inflating kernel. Matrix, assuming the window corresponds to a certain moment during the traversal. The matrix element values are: After erosion and dilation operations, an enhanced time-annotated grayscale image is obtained. .
5. The automatic time stamp recognition method for complex backgrounds according to claim 1, characterized in that, The specific steps in S31 include: searching for the enhanced time-marked grayscale image. All connected components, for the enhanced time-labeled grayscale image For all pixels with a grayscale value of 0, a connected component is constructed using 4-neighborhood connectivity, assuming the enhanced time-labeled grayscale image... Contains m connected components First, based on the number of pixels contained in the connected component. Filter: Then assume connected components For character connectivity branches.
6. The automatic time stamp recognition method for complex backgrounds according to claim 5, characterized in that, The steps in S32 specifically include: Given a set of connected character branches For each traverse all its pixel positions Find the maximum value of the pixel height. and minimum value This forms the set of maximum pixel heights. and the set of minimum pixel heights ; Remove the set of maximum pixel heights and the set of minimum pixel heights The extreme values in the set of maximum pixel heights The elements are first arranged in ascending order to form a sequence. Iterate through the elements sequentially and adjust the element values according to the following formula: , The corrected sequence is formed in the same manner as above. Take the mode As the lower bound of the time marker, according to Cropping the enhanced time-marked grayscale image 7. The automatic time stamp recognition method for complex backgrounds according to claim 6, characterized in that, The specific steps in S33 include: providing the cropped enhanced time-annotated grayscale image. Its width range is [0, w], and its height range is [0, h]. Traverse positions from left to right. Regarding location If from coordinates If no black pixel is encountered, the counter... Increment by one; if a black pixel is encountered, the counter... Clear to zero; after the traversal is complete, the counter is... The starting position corresponding to the maximum value and end position That is, the blank position, starting from the aforementioned starting position. To the left and from the end position By moving the character to the right by the corresponding width, you can precisely locate its position.
8. The automatic time stamp recognition method for complex backgrounds according to claim 1, characterized in that, In step S40, the use of a convolutional neural network to recognize digital images includes: S41: Manually collect and label digital images, and divide the labeled digital images into training set, test set and validation set; S42: Constructing a convolutional neural network: The convolutional kernel size in the convolutional layer is 3×3, with 1 input channel and 64 output channels, and the ReLU activation function is used; the pooling layer uses max pooling operation, and the pooling window size is 2×2; the fully connected layer has 1024 input nodes and 10 output nodes, and the Softmax activation function is used. S43: Model training is performed using the Adam optimizer; S44: Model usage, the digital images obtained in step S33 are sequentially input into the convolutional neural network, the recognition results are output, and the images are spliced together to restore the time label.
9. An electronic device, characterized in that, It includes a processor and a memory communicatively connected thereto, the memory storing instructions executable by the processor, the instructions being executed by the processor to enable the processor to perform the automatic time-marking recognition method for complex backgrounds as described in any one of claims 1 to 8.
10. A non-volatile computer-readable storage medium containing computer-readable instructions, characterized in that, When the computer-readable instructions are executed by the processor, the processor performs the automatic time stamp recognition method for complex backgrounds as described in any one of claims 1-8.