Method for separating and identifying handwritten characters on section of log
By designing a special character extraction and separation algorithm, combined with YOLOv8n and MobileNet networks, the problem of handwritten characters recognition on log cross section is solved, and efficient character separation and recognition effects are achieved.
Patent Information
- Application Number
- CN202411764379.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-18
AI Technical Summary
Existing handwritten character recognition methods are difficult to effectively deal with handwritten characters on log cross sections. It is mainly due to the complex texture of the wood section and the strong background interference, resulting in poor character segmentation and recognition effects.
A special character extraction and separation algorithm is designed, combined with YOLOv8n and MobileNet networks, and through steps such as image preprocessing, outline search and segmentation, classification recognition, etc., it can effectively separate and recognize handwritten characters from log cross sections.
Through this algorithm, the separation effect of handwritten characters on the log cross section is significantly improved, the integrity and independence of characters are guaranteed, and the automatic recognition of handwritten characters on the log cross section is successfully achieved.
Smart Images

Figure CN119649377A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of handwritten character recognition and relates to an image processing method for separating and recognizing handwritten characters on a log cross section. Background Art
[0002] As the level of automation and intelligence in the wood industry continues to improve, the demand for automatic collection and processing of information in the production process is gradually increasing.
[0003] During the storage and transportation of wood, some companies will mark some handwritten characters on the cross section of logs to record important production information (such as number, size or batch, etc.). Therefore, how to realize the automatic recognition of handwritten characters on the cross section of logs has become an urgent problem to be solved.
[0004] Existing handwritten character recognition methods usually work on images with a solid background. Characters can be separated by simple binarization and denoising, and then segmented and recognized. However, due to the complex texture of wood cross-sections and strong background interference, traditional character segmentation methods often fail to meet actual needs. Summary of the invention
[0005] Aiming at the special background of log cross section, the present invention designs a set of special character extraction and separation algorithms, fully considering the texture characteristics of wood cross section and the morphological characteristics of handwritten characters, and flexibly using various image processing techniques to ensure that the separated characters have high integrity and independence, and are successfully recognized.
[0006] To achieve the above object, the present invention specifically comprises the following steps:
[0007] We collected images on site to create a character positioning dataset, and collected handwritten characters online to create a classification dataset, which were divided into training set, test set, and validation set in a ratio of 8:1:1.
[0008] Use YOLOv8n and MobileNet networks to train character localization and classification models, respectively, and deploy the algorithms and models to computers or mobile devices;
[0009] Use the camera as the image data source, obtain the image and transfer it to the YOLOv8n target detection network to locate the characters as a whole;
[0010] The positioning result is cropped, and the image is preprocessed through steps such as pixel screening, opening operation, closing operation, etc., to separate the characters to be recognized from the background, and the image is converted into a binary image;
[0011] Find contours, merge all contours into a whole after screening and rotate;
[0012] Sort the closed contours by coordinate position, and then separate the characters;
[0013] The segmented characters are recognized by the MobileNet classification network, and the recognition results are recorded. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is an example block diagram of the technical process of the present invention;
[0015] Figure 2 This is the algorithm flow chart for image preprocessing and character segmentation. DETAILED DESCRIPTION
[0016] In order to clearly explain the above-mentioned purpose and features of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the following detailed description is illustrative and does not limit the scope of the present invention in any way.
[0017] Embodiment 1:
[0018] like Figure 1 As shown in the figure, the example block diagram demonstrates a method for separating and recognizing handwritten characters on a log cross section. The specific process is as follows:
[0019] Create the data set required for character positioning and classification, divide it into training set, test set and validation set in a ratio of 8:1:1, and train the model;
[0020] Deploy the algorithm and trained model to a computer or mobile device and use a camera to capture images;
[0021] Input the collected image into the object detection network, locate the character position, and crop the positioning result;
[0022] The cropped image is preprocessed and character segmented. The processing flow chart is as follows: Figure 2 The specific process is as follows:
[0023] First, filter out most of the interfering background based on the RGB range of black pixels;
[0024] Small noises are removed by opening operations, and small breaks in characters are closed by closing operations.
[0025] Find edges and obtain the contours of all objects in the image, and further remove noise through conditions such as contour length and area to retain the characters to be recognized;
[0026] Treat the outlines of all characters to be recognized as a whole, find the minimum enclosing rectangle, and rotate the entire image according to the shape of the minimum enclosing rectangle;
[0027] The characters are segmented one by one according to their positions in the image, and the segmented individual characters are input into the classification network for recognition, and the recognition results are recorded in the original character format.
[0028] Embodiment 2:
[0029] This embodiment provides a method for separating and recognizing handwritten characters on a log cross section, and the process is as follows:
[0030] Input the collected image into the object detection network, locate the character position, and crop the positioning result;
[0031] Process the cropped image, the processing flow chart is as follows Figure 2 As shown, the process is described as follows:
[0032] First, filter out most of the interfering background based on the color range of black pixels;
[0033] Small noises are removed by opening operations, and small breaks in characters are closed by closing operations.
[0034] Find edges, obtain the contours of all objects in the image, further remove noise through conditions such as contour length and area, and retain the characters to be recognized;
[0035] Treat the outlines of all characters to be recognized as a whole, find the minimum enclosing rectangle, and rotate the entire image according to the shape of the minimum enclosing rectangle;
[0036] The characters are segmented one by one according to their positions in the image, and the segmented individual characters are input into the classification network for recognition, and the recognition results are recorded in the original character format.
[0037] The above is only a preferred embodiment of the present invention. In addition, for those skilled in the art, various modifications and variations can be made to the invention while maintaining the principle of the present invention. If the modifications and variations fall within the scope of the claims of the present invention and the equivalent technology, these modifications and variations shall also be regarded as the protection scope of the present invention.
Claims
1. A method for separating and recognizing handwritten characters on a log cross section, characterized in that: include: Create a dataset of handwritten characters on log cross sections; Train models for character localization and character recognition; Deploy the algorithm to mobile devices and collect data with cameras; Position and cut the characters to be recognized; Perform preprocessing to separate the characters to be recognized from the background; Rotate the image so that most characters have less tilt; Separate and recognize the characters to be recognized in sequence.
2. The method according to claim 1 is characterized in that the data set includes a positioning data set and a classification data set, the positioning data set is self-made by field shooting and collection, and the classification data set is collected online, and is divided into a training set, a test set, and a validation set in a ratio of 8:1:
1.
3. The method according to claim 1 is characterized in that the algorithm deployment can be deployed on a computer or a mobile device, which is convenient for mobile work and can perform distortion correction and other processing on the camera.
4. The method according to claim 1 is characterized in that the image captured by the camera is positioned through a target detection algorithm, and the positioning result is cropped.
5. The method according to claim 4 is characterized in that the cropping result is preprocessed to remove the image background according to the RGB value of the pixel and retain the characters to be recognized.
6. The method according to claim 5 is characterized in that all characters to be recognized are regarded as a whole, the whole is processed, and the whole is rotated to a positive direction.
7. The method according to claim 6 is characterized in that the characters are segmented according to the contours of all characters to be recognized, in order of position and format, and are sent to the classification network for recognition one by one.