Handwritten character recognition system and method for wood end face

Through the combination of object detection, autofocus, generative adversarial network and semantic segmentation network, the problems of poor recognition effect, insufficient generalization ability and insufficient environmental adaptability of the freight wood end face handwritten character recognition system are solved, and efficient and accurate wood end face character recognition is achieved.

CN119672734APending Publication Date: 2025-03-21AEROSPACE SCI & ENG INTELLIGENT ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411633407.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The existing handwritten character recognition system has problems such as poor recognition effect, insufficient generalization ability and insufficient environmental adaptability in the application of freight wood end surfaces.

Method used

Through the method of object detection and automatic focus control, the images of the wood staple work site are obtained in real time, and the end face of the wood is detected and focused. The generated adversarial network and semantic segmentation network are used to improve image clarity and process interference areas, and finally handwritten character recognition is performed.

Benefits of technology

It significantly improves the accuracy and efficiency of wood end face character recognition, and can effectively recognize handwritten characters under complex backgrounds and low-quality image conditions, which is suitable for the automated identification requirements of freight wood.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672734A_ABST
    Figure CN119672734A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, and discloses a handwritten character recognition system and method for a wood end face. The method comprises the following steps: acquiring an image of a wood tallying operation site in real time; detecting the wood end face in the wood clamping scene image, and obtaining and outputting a detection frame; by taking the detection frame as a reference, controlling the position of the image acquisition device over against the detection frame, and performing focusing operation on the wood end face in the detection frame; the focused detection frame is intercepted, and the definition of the wood end face in the focused detection frame is improved through the generative adversarial network; segmenting an interference area of the wood end face through a semantic segmentation network, and complementing the interference area by using a background color of the wood end face to obtain a processed wood end face; handwritten character recognition is conducted on the processed wood end face, and a character recognition result is obtained; and setting characters in the character recognition result into a preset format according to a preset rule so as to obtain related data of the wood end face and store the related data of the wood end face.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of computer vision, and in particular to a handwritten character recognition system and method for wood end faces. Background Art

[0002] The existing handwritten character recognition system has many problems when used for the handwritten character recognition task of the end surface of freight timber, as follows:

[0003] 1. Lack of practical applications

[0004] Currently, most timber tallying processes still rely on workers to manually record the handwritten characters on the timber at the loading and unloading site. However, manual recognition and recording of these handwritten numbers and codes are inefficient and have poor security. There is an urgent need for an automated handwritten character recognition system for timber end faces.

[0005] 2. Insufficient generalization ability

[0006] The existing handwritten character recognition system has been successfully applied to containers and structured cargo, but the recognition effect is poor when applied to freight timber, and there is a lack of effective technical means to deal with the interference problems unique to the end faces of timber, such as the materials of different types of timber, cracks on the timber, and interference from grooves.

[0007] 3. Insufficient ability to adapt to the environment

[0008] Freight timber is exposed to wind, sun and rain for a long time, and handwritten characters are difficult to recognize due to fading and blurring. Existing technologies often cannot achieve ideal results when processing images in these complex environments. Summary of the invention

[0009] The invention provides a handwritten character recognition system and method for wood end faces, which can solve the technical problems in the prior art.

[0010] The present invention provides a handwritten character recognition method for a wood end surface, wherein the method comprises:

[0011] The image acquisition device is used to acquire images of the timber tallying operation site in real time, wherein the images acquired in real time include images of the timber clamping scene;

[0012] The detection device detects the end face of the wood in the clamped wood scene image, obtains and outputs a detection frame, which is a rectangular bounding frame circumscribed with the end face of the wood;

[0013] Taking the detection frame as a reference, the control device controls the position of the image acquisition device facing the detection frame, and performs a focusing operation on the end face of the wood in the detection frame;

[0014] The focused detection frame is intercepted by an interception device, and the clarity of the wood end surface in the focused detection frame is improved by a generative adversarial network;

[0015] The interference area of ​​the wood end surface is segmented through the semantic segmentation network, and the background color of the wood end surface is used to complete the interference area to obtain the processed wood end surface;

[0016] Performing handwritten character recognition on the processed wood end surface by a recognition device to obtain a character recognition result;

[0017] The characters in the character recognition result are set to a predetermined format according to a predetermined rule by a processing device to obtain the relevant data of the wood end surface and store the relevant data of the wood end surface.

[0018] Preferably, the method further comprises: while detecting the end face of the wood, detecting the type information of the wood by means of a detection device, and visually displaying the detected type information of the wood with a corresponding category label above the detection frame.

[0019] Preferably, controlling the position of the image acquisition device facing the detection frame includes:

[0020] Determining a horizontal angle and a vertical angle of rotation of the image acquisition device;

[0021] The position of the image acquisition device facing the detection frame is controlled according to the horizontal angle to be rotated and the vertical angle to be rotated.

[0022] Preferably, the horizontal angle to be rotated and the vertical angle to be rotated of the image acquisition device are determined by the following formula:

[0023]

[0024] Among them, θ H1 and θ V1 are the horizontal angle to be rotated and the vertical angle to be rotated, θ H and θ V are the current horizontal angle and the current vertical angle of the image acquisition device, θ H is the horizontal angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, α V is the vertical angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, (x min ,y min ) and (x max ,y max ) are the detection frame coordinates, W is the field of view width of the image acquisition device, and H is the field of view height of the image acquisition device.

[0025] Preferably, the interference region includes a crack region and a gully region.

[0026] The present invention also provides a handwritten character recognition system for wood end faces, wherein the system comprises:

[0027] An image acquisition device is used to acquire images of the timber tallying operation site in real time, wherein the images acquired in real time include images of the timber clamping scene;

[0028] A detection device is used to detect the end face of the wood in the clamped wood scene image, obtain and output a detection frame, where the detection frame is a rectangular enclosing frame circumscribed with the end face of the wood;

[0029] A control device, used to control the position of the image acquisition device facing the detection frame based on the detection frame, and to perform a focusing operation on the end face of the wood in the detection frame;

[0030] A capture device, used for capturing the detection frame after focusing;

[0031] Generate adversarial networks to improve the clarity of the wood end faces in the focused detection frame;

[0032] The semantic segmentation network is used to segment the interference area of ​​the wood end surface and use the background color of the wood end surface to complete the interference area to obtain the processed wood end surface;

[0033] A recognition device, used for performing handwritten character recognition on the processed wood end surface to obtain a character recognition result;

[0034] The processing device is used to set the characters in the character recognition result into a predetermined format according to a predetermined rule to obtain the relevant data of the wood end surface and store the relevant data of the wood end surface.

[0035] Preferably, the detection device is also used to detect the type information of the wood while detecting the end face of the wood, and visually display the detected wood type information with a corresponding category label above the detection frame.

[0036] Preferably, controlling the position of the image acquisition device facing the detection frame includes:

[0037] Determining a horizontal angle and a vertical angle of rotation of the image acquisition device;

[0038] The position of the image acquisition device facing the detection frame is controlled according to the horizontal angle to be rotated and the vertical angle to be rotated.

[0039] Preferably, the horizontal angle to be rotated and the vertical angle to be rotated of the image acquisition device are determined by the following formula:

[0040]

[0041] Among them, θ H1 and θV1 are the horizontal angle to be rotated and the vertical angle to be rotated, θ H and θ V are the current horizontal angle and the current vertical angle of the image acquisition device, respectively, H is the horizontal angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, α V is the vertical angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, (x min ,y min ) and (x max ,y max ) are the detection frame coordinates, W is the field of view width of the image acquisition device, and H is the field of view height of the image acquisition device.

[0042] Preferably, the interference region includes a crack region and a gully region.

[0043] Through the above technical solution, the wood end face recognition based on target detection and automatic focus control can achieve efficient focus control through deep learning target detection algorithm and automatic control of image acquisition device, significantly improving the clarity and resolution of the image used for character recognition. In addition, the wood end face processing through generative adversarial network and semantic segmentation network can effectively improve the clarity and visibility of handwritten characters in complex backgrounds and insufficient image quality, thereby improving the accuracy of recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The included drawings are used to provide a further understanding of the embodiments of the present invention, which constitute a part of the specification, are used to illustrate the embodiments of the present invention, and together with the text description, explain the principles of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0045] Figure 1 A flow chart of a handwritten character recognition method for a wood end surface according to an embodiment of the present invention is shown;

[0046] Figure 2 A schematic diagram of a handwritten character recognition system for a wood end surface according to an embodiment of the present invention is shown;

[0047] Figure 3 A schematic diagram of camera and gimbal rotation based on target detection according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0048] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0050] Unless otherwise specifically stated, the relative arrangement of the parts and steps described in these embodiments, numerical expressions and numerical values ​​do not limit the scope of the present invention. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to ordinary technicians in the relevant field may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be regarded as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.

[0051] Figure 1 A flow chart of a handwritten character recognition method for a wood end surface according to an embodiment of the present invention is shown.

[0052] like Figure 1 As shown, an embodiment of the present invention provides a handwritten character recognition method for a wood end surface, wherein the method comprises:

[0053] The image acquisition device is used to acquire images of the timber tallying operation site in real time, wherein the images acquired in real time include images of the timber clamping scene;

[0054] The image acquisition device may be a high-definition camera with a zoom function, mounted on a pan-tilt platform with two degrees of freedom.

[0055] The detection device detects the end face of the wood in the clamped wood scene image, obtains and outputs a detection frame, which is a rectangular bounding frame circumscribed with the end face of the wood;

[0056] Taking the detection frame as a reference, the control device controls the position of the image acquisition device facing the detection frame, and performs a focusing operation on the end face of the wood in the detection frame;

[0057] The focused detection frame is intercepted by an interception device, and the clarity of the wood end surface in the focused detection frame is improved by a generative adversarial network;

[0058] The interference area of ​​the wood end surface is segmented through the semantic segmentation network, and the background color of the wood end surface is used to complete the interference area to obtain the processed wood end surface;

[0059] Performing handwritten character recognition on the processed wood end surface by a recognition device to obtain a character recognition result;

[0060] The characters in the character recognition result are set to a predetermined format according to a predetermined rule by a processing device to obtain the relevant data of the wood end surface and store the relevant data of the wood end surface.

[0061] Through the above technical solution, the wood end face recognition based on target detection and automatic focus control can achieve efficient focus control through deep learning target detection algorithm and automatic control of image acquisition device, significantly improving the clarity and resolution of the image used for character recognition. In addition, the wood end face processing through generative adversarial network and semantic segmentation network can effectively improve the clarity and visibility of handwritten characters in complex backgrounds and insufficient image quality, thereby improving the accuracy of recognition.

[0062] According to an embodiment of the present invention, the method further comprises: while detecting the end face of the wood, detecting the type information of the wood by a detection device, and visually displaying the detected type information of the wood with a corresponding category label above the detection frame.

[0063] Thus, the type of wood can be known in time, and the background color of the corresponding type of wood can be obtained according to the type of wood, so as to complete the interference area according to the background color, ensuring that the completed image is visually continuous and consistent.

[0064] According to one embodiment of the present invention, controlling the position of the image acquisition device facing the detection frame includes:

[0065] Determining a horizontal angle and a vertical angle of rotation of the image acquisition device;

[0066] The position of the image acquisition device facing the detection frame is controlled according to the horizontal angle to be rotated and the vertical angle to be rotated.

[0067] For an image acquisition device disposed on a pan-tilt platform, the image acquisition device can be finally rotated to a position facing the detection frame by controlling the rotation of the pan-tilt platform.

[0068] According to one embodiment of the present invention, the horizontal angle to be rotated and the vertical angle to be rotated of the image acquisition device are determined by the following formula:

[0069]

[0070] Among them, θ H1 and θ V1 are the horizontal angle to be rotated and the vertical angle to be rotated, θ H and θ V are the current horizontal angle and the current vertical angle of the image acquisition device, respectively, H is the horizontal angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, α V is the vertical angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, (x min ,y min ) and (x max ,y max ) are the detection frame coordinates, W is the field of view width of the image acquisition device, and H is the field of view height of the image acquisition device.

[0071] According to an embodiment of the present invention, the interference region includes a crack region and a gully region.

[0072] Figure 2 A schematic diagram of a handwritten character recognition system for a wood end surface according to an embodiment of the present invention is shown.

[0073] like Figure 2 As shown, an embodiment of the present invention further provides a handwritten character recognition system for a wood end surface, wherein the system comprises:

[0074] An image acquisition device is used to acquire images of the timber tallying operation site in real time, wherein the images acquired in real time include images of the timber clamping scene;

[0075] A detection device is used to detect the end face of the wood in the clamped wood scene image, obtain and output a detection frame, where the detection frame is a rectangular enclosing frame circumscribed with the end face of the wood;

[0076] A control device, used to control the position of the image acquisition device facing the detection frame based on the detection frame, and to perform a focusing operation on the end face of the wood in the detection frame;

[0077] A capture device, used for capturing the detection frame after focusing;

[0078] Generate adversarial networks to improve the clarity of the wood end faces in the focused detection frame;

[0079] The semantic segmentation network is used to segment the interference area of ​​the wood end surface and use the background color of the wood end surface to complete the interference area to obtain the processed wood end surface;

[0080] A recognition device, used for performing handwritten character recognition on the processed wood end surface to obtain a character recognition result;

[0081] Among them, handwritten character recognition includes determining the position of the handwritten character and recognizing and reading the content of the handwritten character.

[0082] The processing device is used to set the characters in the character recognition result into a predetermined format according to a predetermined rule to obtain the relevant data of the wood end surface and store the relevant data of the wood end surface.

[0083] Through the above technical solution, the wood end face recognition based on target detection and automatic focus control can achieve efficient focus control through deep learning target detection algorithm and automatic control of image acquisition device, significantly improving the clarity and resolution of the image used for character recognition. In addition, the wood end face processing through generative adversarial network and semantic segmentation network can effectively improve the clarity and visibility of handwritten characters in complex backgrounds and insufficient image quality, thereby improving the accuracy of recognition.

[0084] Specifically, through targeted processing of the end faces of wood, the clarity and visibility of handwritten characters in complex backgrounds and insufficient image quality can be effectively improved, and the accuracy of subsequent character recognition can be improved, which is suitable for handwritten character recognition of freight wood; through the combination of image processing, deep learning, automatic control and other technologies, the stability and reliability of handwritten character recognition can still be guaranteed in the actual application of the tallying process, and it has the ability to handle handwritten character recognition in complex backgrounds and multiple interference factors; it has the ability to synchronize handwritten character recognition with freight wood loading and unloading, handling and other operations, which significantly improves the efficiency of the overall tallying operation and reduces labor costs.

[0085] According to an embodiment of the present invention, the detection device is also used to detect the type information of the wood while detecting the end face of the wood, and visually display the detected wood type information with corresponding category labels above the detection frame.

[0086] According to one embodiment of the present invention, controlling the position of the image acquisition device facing the detection frame includes:

[0087] Determining a horizontal angle and a vertical angle of rotation of the image acquisition device;

[0088] The position of the image acquisition device facing the detection frame is controlled according to the horizontal angle to be rotated and the vertical angle to be rotated.

[0089] According to one embodiment of the present invention, the horizontal angle to be rotated and the vertical angle to be rotated of the image acquisition device are determined by the following formula:

[0090]

[0091] Among them, θ H1 and θ V1 are the horizontal angle to be rotated and the vertical angle to be rotated, θ H and θ V are the current horizontal angle and vertical angle of the image acquisition device, θ H is the horizontal angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, α V is the vertical angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, (x min ,y min ) and (x max ,y max ) are the detection frame coordinates, W is the field of view width of the image acquisition device, and H is the field of view height of the image acquisition device.

[0092] According to an embodiment of the present invention, the interference region includes a crack region and a gully region.

[0093] The handwritten character recognition system for wood end faces of the present invention is described below with reference to examples.

[0094] The system is equipped with a high-definition camera with zoom function, which is mounted on a pan-tilt head with two degrees of freedom.

[0095] The HD camera can be used to obtain real-time images of the wood loading and unloading process. The camera's field of view can cover the entire wood loading and unloading and transportation work area, and the pan / tilt has horizontal and vertical rotation functions. After the system is started, the camera begins real-time image acquisition and transmission.

[0096] During the brief pause when the loader grabs the wood, the detection device detects and classifies the wood end faces in the real-time image through a deep learning-based target detection algorithm. When the wood end face is detected, a rectangular bounding box circumscribed to the wood end face can be output in the image. This rectangular bounding box is the detection box. When the wood end face is detected, the algorithm can visualize the predicted wood species information with the corresponding category label above the detection box.

[0097] With the center point of the detection frame as a reference, the control device can control the pan / tilt to rotate so that the camera rotates to a position facing the detection frame.

[0098] like Figure 3 As shown, Figure 3 (a) is a top view, (b) is a side view, where ∠A'OA is the horizontal field of view FOV H =θ H , point O is the location of the camera lens, point C is the center point of the current image frame, point R is the center point of the detection frame, and ∠B'OB is the vertical field of view FOV V =θ V The resolution of the current image frame is W×H, that is, W=A'A (the length of the line segment between the two points A'A horizontally, called the field of view width), H=B'B (the length of the line segment between the two points B'B vertically, called the field of view height), and the coordinates of the center point C of the current image frame are:

[0099] Assume the output detection box coordinates are: (x min ,y min ) and (x max ,y max ), then the coordinates of the center point R of the detection box are: The horizontal distance difference between the image midpoint and the target point (center point C and center point R) is: Δx = x c -x r , let the horizontal angle difference be α H , in ΔAOC we have: We can get: Similarly, the vertical distance difference between the image midpoint and the target point (center point C and center point R) is: Δy = y c -y r , let the vertical angle difference be α V , we can get:

[0100] When the gimbal is rotated to face the detection frame with the center point of the detection frame as the reference, the camera is facing the detection frame center point R. Assume that the horizontal and vertical angles of the current gimbal are θ H and θ V , the horizontal angle that the gimbal needs to rotate is: The vertical angle is:

[0101] After the pan / tilt rotates to the point where the camera is facing the detection frame, the local focus function of the camera is triggered, and the camera is focused on the midpoint of the detection frame. The capture device selects the first frame image after the focus is completed, and captures part of the image in the detection frame in the frame image for further processing.

[0102] First, the system uses a generative adversarial network to perform super-resolution processing on the wood end face image to improve the image clarity. The generative adversarial network consists of two parts: the generator and the discriminator. The low-resolution wood end face image is input into the generator, and the low-resolution image is converted into a high-resolution image through multiple layers of convolution and deconvolution operations. The discriminator discriminates the generated high-resolution image, continuously feeds back the output quality of the generator, and prompts the generator to generate clearer images.

[0103] After super-resolution processing, the semantic segmentation network is used to perform semantic segmentation on the cracks, grooves, and black and dark marks similar to handwritten characters on the end surface, and the cracks are completed with the background color. The semantic segmentation network can be composed of an encoder and a decoder. The encoder part consists of a series of convolutional layers and pooling layers, and the decoder part consists of a series of deconvolutional layers and upsampling layers with the same number of layers as the encoder. When the image of the end surface of the wood is input, the encoder will extract a multi-level feature map from the image. After each layer of convolution of the encoder, the feature map will be passed to the corresponding layer of the decoder through a jump connection. After receiving the feature map transmitted by the encoder, the decoder gradually restores the spatial resolution of the image through upsampling and deconvolution operations, and combines the features of the encoder to perform fine segmentation. The final output segmentation map clearly marks the interference areas such as cracks and grooves on the end surface of the wood. Specifically:

[0104] Suppose the wood end face image input to the semantic segmentation network is I. The encoder extracts high-level features of the image layer by layer through convolution operation. The convolution operation scans the feature map through the convolution kernel to generate each pixel value of the segmentation map. The encoding process is:

[0105] Conv1 = ReLU(BN(Conv(I)))

[0106] Conv i =ReLU(BN(Conv(Conv i-1 )))

[0107] Among them, Conv1 represents the first layer of convolution operation, Conv i represents the i-th layer convolution operation, BN represents batch normalization, and ReLU is a nonlinear activation function.

[0108] The decoder restores the spatial resolution of the image layer by layer through deconvolution operations, and combines the jump connection features of the encoder to generate a fine segmentation map. The decoding process is:

[0109] UpConv i =ReLU(BN(UpConv(Conv i+1 )))

[0110] Among them, UpConv i Represents the convolution operation of the i-th layer. The skip connection directly passes the feature maps of each layer of the encoder to the corresponding layer of the decoder, retaining high-resolution features and enhancing segmentation accuracy. The formula is:

[0111]

[0112] in, Represents the connection operation of the feature map, n represents the total number of convolutional layers of the encoder, and is also the total number of deconvolutional layers of the decoder.

[0113] The last layer of the semantic segmentation network is the convolutional layer. The input of this layer is the feature map of the last layer of the decoder. After a layer of convolution operation, a segmentation map with the same size as the input image is output. It is used to mark cracks and background interference areas. The segmentation map (SegMap) is:

[0114] SegMap(x,y)=σ(Conv final (UpConv1(x,y)))

[0115] Among them, σ represents the Sigmoid activation function, which is used to normalize the output to a probability value between 0 and 1, indicating the probability of each pixel in the segmentation map belonging to a certain category. final It is the last layer of convolution operation. UpConv1 is the output feature map of the last layer of the decoder, and (x, y) represents the pixel position in the image.

[0116] Assume that cracks, gullies and other interference areas are segmentation targets, and classify each pixel as a segmentation target category or background according to the probability value in the segmentation map SegMap:

[0117]

[0118] Among them, α is the threshold for the pixel to be classified as a target category. If it is greater than α, it means that the pixel is a segmentation target. Class indicates the category to which the pixel belongs. 1 is the segmentation target and 0 is the background.

[0119] After segmenting cracks and grooves through the semantic segmentation network, the background color of the corresponding type of wood is found from the labels of the predefined wood end dataset according to the wood category label predicted during the wood end detection process. The background color is applied to the segmented crack and groove areas to ensure that the completed image is visually continuous and consistent. Let the wood category label be L, and the background color of the wood type corresponding to label L be C bg , the background color filling process is:

[0120]

[0121] Among them, Ifilled Represents the image after padding.

[0122] The processed end face image is subjected to handwritten character recognition using the OCR (Optical Character Recognition) algorithm. The main steps of the OCR algorithm are: character detection, direction classification and character recognition. The steps are:

[0123] (1) Character detection: The processed wood end image is input and normalized and resized to meet the input requirements of the OCR model. A convolutional neural network is used to extract feature maps from the image, and a text detection model (such as DBNet or EAST) is used to locate the handwritten character area on the feature map to generate a character detection box. The detection box containing the character position is output for subsequent direction classification and character recognition.

[0124] (2) Direction classification: Handwritten characters may have different directions and angles. The purpose of direction classification is to adjust these characters to a standard readable direction. First, the image area within the character detection frame is input into a direction classification network (such as ResNet) to extract image features. The direction classification network predicts the direction category of the character (for example, 0 degrees, 90 degrees, 180 degrees, 270 degrees) based on the feature map. According to the predicted direction category, the character image is rotated to ensure that all characters are in a standard readable direction.

[0125] (3) Character recognition: Input the character image after direction classification and adjustment into the Transformer model to extract character features. Use the encoder-decoder structure of the Transformer model to model and decode the character image features to generate a character sequence. Output the recognition result, i.e. the text information of the handwritten character, and save the character content.

[0126] After obtaining the handwritten digit recognition results of the timber end face, the recognized characters are organized into a predetermined format according to the specific needs of timber tally management. The format may include information such as the length, type, number and code of the timber. The recognized character sequence is parsed and organized using a rule engine to convert it into structured data. For example, the recognized character sequence may contain numbers, codes and other identification information, which are stored in corresponding fields after parsing.

[0127] Clean and verify the parsed data to ensure data integrity and accuracy. Insert the cleaned data into the database, which can be stored in a relational database (such as MySQL, PostgreSQL) or a NoSQL database (such as MongoDB). Index and optimize the stored data to ensure efficient data query and retrieval. The character information stored in the database can be used for subsequent query and management, supporting operations such as timber registration, warehousing, and outbound storage, providing reliable data support.

[0128] It can be seen from the above embodiments that the handwritten character recognition system and method for wood end faces of the present invention have at least the following advantages:

[0129] 1) Through the integration of multiple technologies and algorithms, fully automatic target detection, focus control, image processing and character recognition are realized, which reduces the dependence on manual intervention, improves the efficiency of tallying operations, reduces labor costs, and avoids possible negligence and errors in the manual identification process, which is more suitable for the high-frequency cargo loading and unloading needs of ports.

[0130] 2) Combining the target detection algorithm and the autofocus control technology, it can quickly and accurately locate and focus on the end of the wood in a complex background. Compared with the existing technology, it can more accurately capture the end of the wood and obtain a clear image after focusing during the loading and unloading of freight wood.

[0131] 3) Generate adversarial networks to improve image clarity, and use semantic segmentation algorithms to handle interference such as cracks and grooves on the wood end faces, complete the background color, and ensure the visibility of handwritten characters in various backgrounds. For freight wood that has been exposed to the natural environment for a long time, it can overcome the influence of the wood itself and external environmental conditions on the wood end faces and handwritten characters, and enhance the adaptability of character recognition algorithms in tallying scenarios.

[0132] In the description of the present invention, it is necessary to understand that the directions or positional relationships indicated by directional words such as "front, back, up, down, left, right", "lateral, vertical, perpendicular, horizontal" and "top, bottom" are usually based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the devices or elements referred to must have a specific direction or be constructed and operated in a specific direction. Therefore, they cannot be understood as limiting the scope of protection of the present invention. The directional words "inside and outside" refer to the inside and outside relative to the contours of each component itself.

[0133] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.

[0134] In addition, it should be noted that the use of terms such as "first" and "second" to limit components is only for the convenience of distinguishing the corresponding components. If not otherwise stated, the above terms have no special meaning and therefore cannot be understood as limiting the scope of protection of the present invention.

[0135] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for handwritten character recognition on a wood end surface, characterized in that: The method includes: The image acquisition device is used to acquire images of the timber tallying operation site in real time, wherein the images acquired in real time include images of the timber clamping scene; The detection device detects the end face of the wood in the clamped wood scene image, obtains and outputs a detection frame, which is a rectangular bounding frame circumscribed with the end face of the wood; Taking the detection frame as a reference, the control device controls the position of the image acquisition device facing the detection frame, and performs a focusing operation on the end face of the wood in the detection frame; The focused detection frame is intercepted by an interception device, and the clarity of the wood end surface in the focused detection frame is improved by a generative adversarial network; The interference area of ​​the wood end surface is segmented through the semantic segmentation network, and the background color of the wood end surface is used to complete the interference area to obtain the processed wood end surface; Performing handwritten character recognition on the processed wood end surface by a recognition device to obtain a character recognition result; The characters in the character recognition result are set to a predetermined format according to a predetermined rule by a processing device to obtain the relevant data of the wood end surface and store the relevant data of the wood end surface.

2. The method according to claim 1, characterized in that The method further comprises: while detecting the end face of the wood, detecting the type information of the wood by a detection device, and visually displaying the detected type information of the wood with a corresponding category label above the detection frame.

3. The method according to claim 2, characterized in that Controlling the position of the image acquisition device facing the detection frame includes: Determining a horizontal angle and a vertical angle of rotation of the image acquisition device; The position of the image acquisition device facing the detection frame is controlled according to the horizontal angle to be rotated and the vertical angle to be rotated.

4. The method according to claim 3, characterized in that The horizontal angle and vertical angle of rotation of the image acquisition device are determined by the following formula: Among them, θ H1 and θ V1 are the horizontal angle to be rotated and the vertical angle to be rotated, θ H and θ V are the current horizontal angle and the current vertical angle of the image acquisition device, respectively, H is the horizontal angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, α V is the vertical angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, (x min ,y min ) and (x max ,y max ) are the detection frame coordinates, W is the field of view width of the image acquisition device, and H is the field of view height of the image acquisition device.

5. The method according to claim 4, characterized in that The interference areas include crack areas and gully areas.

6. A handwritten character recognition system for wood end faces, characterized in that: The system includes: An image acquisition device is used to acquire images of the timber tallying operation site in real time, wherein the images acquired in real time include images of the timber clamping scene; A detection device is used to detect the end face of the wood in the clamped wood scene image, obtain and output a detection frame, where the detection frame is a rectangular enclosing frame circumscribed with the end face of the wood; A control device, used to control the position of the image acquisition device facing the detection frame based on the detection frame, and to perform a focusing operation on the end face of the wood in the detection frame; A capture device, used for capturing the detection frame after focusing; Generate adversarial networks to improve the clarity of the wood end faces in the focused detection frame; The semantic segmentation network is used to segment the interference area of ​​the wood end surface and use the background color of the wood end surface to complete the interference area to obtain the processed wood end surface; A recognition device, used for performing handwritten character recognition on the processed wood end surface to obtain a character recognition result; The processing device is used to set the characters in the character recognition result into a predetermined format according to a predetermined rule to obtain the relevant data of the wood end surface and store the relevant data of the wood end surface.

7. The system according to claim 6, characterized in that The detection device is also used to detect the type information of the wood while detecting the end face of the wood, and to visually display the detected type information of the wood with a corresponding category label above the detection frame.

8. The system according to claim 7, characterized in that Controlling the position of the image acquisition device facing the detection frame includes: Determining a horizontal angle and a vertical angle of rotation of the image acquisition device; The position of the image acquisition device facing the detection frame is controlled according to the horizontal angle to be rotated and the vertical angle to be rotated.

9. The system according to claim 8, characterized in that The horizontal angle and vertical angle of rotation of the image acquisition device are determined by the following formula: Among them, θ H1 and θ V1 are the horizontal angle to be rotated and the vertical angle to be rotated, θ H and θ V are the current horizontal angle and the current vertical angle of the image acquisition device, respectively, H is the horizontal angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, α V is the vertical angle difference between the center point of the current clamped wood scene image and the center point of the detection frame, (x min ,y min ) and (x max ,y max ) are the detection frame coordinates, W is the field of view width of the image acquisition device, and H is the field of view height of the image acquisition device.

10. The system according to claim 9, characterized in that The interference areas include crack areas and gully areas.