Image content recognition system based on deep learning
The image content recognition system using deep learning detects and corrects image tilt, solving the problem of image tilt caused by input device precision defects and human factors, and improving the accuracy of image recognition.
Patent Information
- Application Number
- CN202411784316.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-01-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing image recognition process, the accuracy of subsequent recognition is affected by the inaccuracy of the input device and the image tilt caused by human factors.
The image content recognition system based on deep learning includes modules for image processing, edge point acquisition, boundary line fitting, tilt angle acquisition, tilt determination, and tilt correction. It detects and corrects image tilt and calculates the correction coordinates using the slope and tilt angle of the boundary line fitting equation.
It effectively corrects image tilt, improves image recognition accuracy, and reduces the difficulties and impacts of tilt on subsequent processing.
Smart Images

Figure CN119273998A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image content recognition, and in particular to an image content recognition system based on deep learning. Background Art
[0002] With the development of information technology, image recognition technology has been widely used in many fields, such as text recognition, face recognition, object recognition, etc. In these application scenarios, the accuracy of the image is crucial to the recognition results. Traditional image recognition methods often have high requirements on the quality and angle of the input image, and have limited processing capabilities for tilted images. Some simple correction methods may not accurately correct the tilt angle of the image, or may introduce new errors during the correction process. Therefore, a method that can accurately detect and correct image tilt is needed to improve the accuracy and reliability of image recognition.
[0003] However, in the process of image processing and recognition, due to the precision defects of the input device and the inevitable human factors in the operation process, there are corresponding errors in the image input, which causes the input image to be tilted to a certain extent, which will cause certain difficulties and impacts on the image content recognition in the subsequent process. Therefore, it is particularly important to perform tilt correction before image content recognition. Based on this, an image content recognition system based on deep learning is proposed. Summary of the invention
[0004] The purpose of the present invention is to provide an information interaction method for power field operations, which solves the technical problem that during the image processing and recognition process, due to the accuracy defects of the input device and the inevitable human factors during the operation, there are corresponding errors in the image input, resulting in the input image being more or less tilted to a certain extent, which in turn causes certain difficulties and influences on the image content recognition in the subsequent process.
[0005] Image content recognition system based on deep learning, including; An image processing module processes the image to be identified to obtain a black and white binary image of the image to be identified; The edge point acquisition module scans the black-and-white binary image to obtain the coordinates of each edge point in the black-and-white binary image; The boundary line fitting module analyzes the coordinates of each edge point in the black and white binary image of the image to be identified, and then obtains the slope of the boundary line fitting equation; The tilt angle acquisition module calculates the tilt angle of the image to be identified according to the slope of the boundary line fitting equation; The tilt determination module compares and analyzes the tilt angle of the image to be identified with a preset tilt threshold, and determines and generates a tilt mark; The tilt correction module analyzes and obtains the correction coordinates corresponding to each pixel point in the image to be identified for generating the tilt mark according to the slope in the boundary line fitting equation and the tilt angle of the image to be identified.
[0006] As a further solution of the present invention: the specific method of obtaining the black and white binary image of the image to be identified is: The image to be identified is evenly divided into multiple pixels, and the grayscale value of each pixel is obtained, so that the pixels greater than the grayscale threshold Y1 become white, and the pixels less than or equal to the grayscale threshold Y1 become black, thereby obtaining a black and white binary image of the image to be identified.
[0007] As a further solution of the present invention: the specific method of obtaining the coordinates of each edge point in the black and white binary image is: A two-dimensional coordinate system is set in the black-and-white binary image, and the black-and-white binary image is sequentially scanned from left to right and from bottom to top. The coordinates of the pixel point that changes from white to black for the first time on each scan line are recorded as the edge point Aa (AXa, AYa), where a refers to different edge points in the black-and-white binary image, a is a positive integer, and a>1.
[0008] As a further solution of the present invention: the specific method of obtaining the slope in the boundary line fitting equation is: By formula, ; Calculate the slope k of the boundary line fitting equation, where n is the number of edge points in the black and white binary image of the image to be identified, AXi and AYi are any one of AXa and AYa, respectively, satisfying n≥i>.
[0009] As a further solution of the present invention: the specific method of obtaining the tilt angle of the image to be identified is: The inverse tangent function value of the slope k is defined as the inclination angle θ of the image to be recognized.
[0010] As a further solution of the present invention: the specific method of determining and generating the tilt mark is: The tilt angle of the image to be identified is compared with the preset tilt threshold Y2. When the tilt angle is greater than the preset tilt threshold Y2, it is determined that the image to be identified is tilted and a tilt mark is generated. Otherwise, no processing is performed.
[0011] As a further solution of the present invention: the specific method of analyzing and obtaining the correction coordinates corresponding to each pixel point in the image to be identified for generating the tilt mark is: By formula ; and the formula ; Calculate the corresponding values of cosθ and sinθ, obtain the coordinates of the center point and each pixel point of the image to be identified from the black and white binary image, and conduct a comprehensive analysis with the sine value, cosine value of the inclination angle θ of the image to be identified and the slope of the boundary line fitting equation to obtain the corrected horizontal coordinate and corrected vertical coordinate corresponding to each pixel point in the image to be identified, and then obtain the corrected coordinates corresponding to each pixel point in the image to be identified.
[0012] As a further solution of the present invention: the specific method of obtaining the corrected horizontal coordinates corresponding to each pixel point in the image to be identified is: Obtain the center point coordinates Z (ZX, ZY) of the image to be identified and the coordinates Di (DXi, DYi) of each pixel point from the black-and-white binary image, where i refers to different pixel points in the image to be identified, i is a positive integer, and i>1; First, add the product of the cosine value cosθ and sine value sinθ of the tilt angle θ to the horizontal coordinate DXi and vertical coordinate DYi of each pixel point, then subtract the sum of the products of the horizontal coordinate and vertical coordinate of the center point with the cosine value cosθ and sine value sinθ of the tilt angle θ, and finally add the horizontal coordinate of the center point to obtain the corrected horizontal coordinate corresponding to each pixel point in the image to be identified.
[0013] As a further solution of the present invention: the specific method of obtaining the corrected vertical coordinates corresponding to each pixel point in the image to be identified is: First, add the product of the sine value sinθ and the cosine value cosθ of each pixel point to the horizontal coordinate DXi and the vertical coordinate DYi respectively, then subtract the difference between the horizontal coordinate and the vertical coordinate of the center point and the product of the sine value sinθ and the cosine value cosθ of the tilt angle θ, and finally add the vertical coordinate of the center point to obtain the corrected vertical coordinate corresponding to each pixel point in the image to be identified.
[0014] As a further solution of the present invention: each pixel point in the image to be identified is located at its corresponding correction coordinate, so as to implement a tilt correction operation on the image to be identified.
[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention determines whether an image is tilted and generates a corresponding mark by comparing the tilt angle with a preset tilt threshold, determines whether correction is needed, and after determining that the image is tilted, calculates correction coordinates according to the coordinates of the image center point, the pixel point coordinates, the tilt angle and the slope, and adjusts the pixel point positions in the tilted image, thereby achieving image correction. The correction operation restores the image to a relatively normal state, which is convenient for subsequent image content recognition, thereby reducing the difficulty and influence of the tilt on subsequent image content recognition and improving the image recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic diagram of the system framework structure of the present invention; Figure 2 It is a schematic diagram of the framework structure of the method of the present invention. DETAILED DESCRIPTION
[0017] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of 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.
[0018] Embodiment 1 See also Figure 1 ,This application provides an image content recognition system based on deep learning, including; The image processing module is used to process the image to be identified, thereby obtaining a black and white binary image of the image to be identified. The specific method is as follows: First, the image to be identified is evenly divided into multiple pixels, the grayscale value of each pixel is obtained, and the integer part of the grayscale value of each pixel is retained as the calibrated grayscale value corresponding to each pixel in the image to be identified, and they are marked as Gi, where i refers to different pixels in the image to be identified, i is a positive integer, and i>1; Then, a grayscale threshold Y1 is set, so that the pixels greater than the grayscale threshold Y1 become white, and the pixels less than or equal to the grayscale threshold Y1 become black, thereby obtaining a black and white binary image of the image to be identified, so as to separate the image from the background of the image to be identified, and facilitate accurate detection of the image boundary corresponding to the image to be identified in the later stage. The specific value of the grayscale threshold Y1 is formulated by relevant personnel according to actual needs; Finally, the black and white binary image of the image to be recognized has two colors, black and white. In the black and white binary image, 1 represents white and 0 represents black. For example, suppose there is an image to be identified, which is evenly divided into 10 pixels, and their grayscale values are 50, 60, 70, 80, 90, 100, 110, 120, 130 and 140 respectively. The grayscale threshold Y1 is set to 85, then the pixel grayscale value greater than 85 becomes white, and the pixel grayscale value less than or equal to 85 becomes black. Therefore, the first four pixels in the image to be identified here become black, and the last six pixels become white. I then use 0 to represent black and 1 to represent white. Therefore, the final black and white binary image is expressed as: [0,0,0,0,1,1,1,1,1,1]; By setting a suitable grayscale threshold, the image to be identified is converted into a black and white binary image, so that the image and the background can be separated, which is convenient for subsequent operations. This processing method can reduce the interference of background information on image feature extraction to a certain extent. Even when there is an input error that causes the image to be tilted, it can provide a relatively clear image structure basis for subsequent processing.
[0019] The edge point acquisition module sets a two-dimensional coordinate system in the black-and-white binary image of the image to be identified, and scans the black-and-white binary image to obtain the coordinates of each edge point in the black-and-white binary image. The specific method is as follows: Scan the black-and-white binary image of the image to be identified from left to right and from bottom to top, record the coordinates of the pixel point on each scan line that changes from white to black for the first time, and define it as the edge point Aa (AXa, AYa) of the black-and-white binary image of the image to be identified, where a refers to different edge points in the black-and-white binary image, a is a positive integer, and a>1; For example, a two-dimensional coordinate system is set in a black-and-white binary image. When the black-and-white binary image is scanned, the black-and-white binary image is scanned from left to right and from bottom to top. If the coordinate of the pixel point that changes from white to black for the first time on the first scan line is (5, 0), then this pixel point is marked as an edge point. The coordinate of this pixel point is the edge point coordinate A1 (AX1=5, AY1=0). Then continue to scan other scan lines in the same way and record the coordinates of other edge points. The black and white binary image is scanned from left to right and from bottom to top, and the coordinates of the pixels where white turns black for the first time are recorded as edge points. This method can obtain the edge information of the image more accurately. Even if the image is tilted, the relative position relationship of the edge points can still reflect the general outline of the image, providing data support for subsequent boundary line fitting.
[0020] The boundary line fitting module analyzes and obtains the boundary line fitting equation according to the coordinates of each edge point in the black and white binary image of the image to be identified. The specific method is as follows: By formula, ; Calculate the slope k of the boundary line fitting equation, and then use the formula, ; Calculate the intercept b of the boundary line fitting equation; Substitute it into the preset boundary line fitting equation AYa=kAXa+b; Where n is the number of edge points in the black and white binary image to be identified, n>1, AXi and AYi are any one of AXa and AYa, respectively, satisfying n≥i>1; According to the acquired edge point coordinates, the slope and intercept of the boundary line fitting equation are calculated using a specific formula. In this way, the straight line features of the lower boundary of the image can be extracted from the edge point data, thereby providing a basis for determining the tilt angle of the image. Even if the input image is tilted and has errors, relatively accurate straight line fitting results can be obtained through statistical analysis of the edge points.
[0021] The tilt angle acquisition module calculates and analyzes the slope k of the boundary line fitting equation to obtain the tilt angle of the image to be identified. The specific method is as follows: By formula, ; Calculate the tilt angle θ of the image to be identified, where tan -1 is the inverse tangent function, which converts the slope k into an angle; For example, if the coordinates of the edge points in the black and white binary image to be identified are (1,2), (2,3), (3,4) and (4,5), then , , , , n=4, then k=-3, b=11, , we can obtain the boundary line fitting equation AYa=-3AXa+11 and the tilt angle θ of the image to be identified; Based on the slope of the boundary line fitting equation, the inclination angle of the image to be identified is calculated through the inverse tangent function, which can quantify the degree of inclination of the image and provide key parameters for subsequent correction operations.
[0022] The tilt determination module compares and analyzes the tilt angle θ of the image to be identified with the preset tilt threshold, and determines whether the image to be identified is tilted according to the comparison and analysis results. If so, a tilt mark is generated, otherwise no processing is performed. The specific method is as follows: When the tilt angle θ of the image to be identified is greater than the preset tilt threshold Y2, it is determined that the image to be identified is tilted, and then a tilt mark is generated. When the tilt angle θ of the image to be identified is less than or equal to the preset tilt threshold Y2, it is determined that the image to be identified is not tilted, and then no processing is performed. Here, the specific value of the preset tilt threshold Y2 is formulated by relevant staff according to actual needs; The calculated tilt angle is compared with the preset tilt threshold to determine whether the image is tilted and generate a corresponding mark to determine whether correction is needed.
[0023] Embodiment 2 As the second embodiment of the present invention, when the present application is implemented, compared with the first embodiment, the technical solution of the present embodiment is different from that of the first embodiment only in that the present embodiment further includes a tilt correction module; The tilt correction module, when determining that the image to be identified is tilted and generating a tilt mark, calculates the correction coordinates corresponding to each pixel point in the image to be identified according to the slope in the boundary line fitting equation and the tilt angle θ of the image to be identified. The specific method is as follows: First, obtain the coordinates of the center point of the image to be identified from the black and white binary image of the image to be identified, and mark it as Z (ZX, ZY). At the same time, obtain the coordinates of each pixel point in the image to be identified, and mark them as Di (DXi, DYi), where i refers to different pixel points in the image to be identified, i is a positive integer, and i>1; Then, according to the trigonometric function relationship, through the formula ; and the formula ; Calculate the corresponding values of cosθ and sinθ; Finally, according to the formula, EXi=DXicosθ+DYisinθ-ZXcosθ-ZYsinθ+ZX; calculate and obtain the corrected horizontal coordinates EXi corresponding to each pixel point in the image to be identified; According to the formula, EYi=DXisinθ+DYicosθ+ZXsinθ-ZYcosθ+ZY, the corrected vertical coordinate EYi corresponding to each pixel point in the image to be identified is calculated; Obtain the correction coordinates Ei (EXi, EXi) corresponding to each pixel point in the image to be identified; Each pixel point in the image to be identified is located at its corresponding correction coordinate Ei (EXi, EXi), thereby achieving a tilt correction operation on the image to be identified; After determining that the image is tilted, the correction coordinates are calculated based on the coordinates of the center point of the image, the coordinates of the pixel points, the tilt angle and the slope. Through this coordinate transformation method, the pixel position in the tilted image can be adjusted to achieve image correction. Even if the input image has errors that cause tilt, the image can be restored to a relatively normal state through the correction operation, which is convenient for subsequent image content recognition and can effectively detect and correct the tilt of the image. In the case that the input image is tilted, the image can be restored to a relatively normal state through the correction operation, thereby reducing the difficulty and influence of the tilt on subsequent image content recognition and improving the image recognition accuracy.
[0024] Embodiment 3 As the third embodiment of the present invention, when the present application is specifically implemented, compared with the first and second embodiments, the technical solution of this embodiment is to combine the solutions of the first and second embodiments mentioned above for implementation.
[0025] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0026] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. Image content recognition system based on deep learning, characterized in that: include; An image processing module processes the image to be identified to obtain a black and white binary image of the image to be identified; The edge point acquisition module scans the black-and-white binary image to obtain the coordinates of each edge point in the black-and-white binary image; The boundary line fitting module analyzes the coordinates of each edge point in the black and white binary image of the image to be identified, and then obtains the slope of the boundary line fitting equation; The tilt angle acquisition module calculates the tilt angle of the image to be identified according to the slope of the boundary line fitting equation; The tilt determination module compares and analyzes the tilt angle of the image to be identified with a preset tilt threshold, and determines and generates a tilt mark; The tilt correction module analyzes and obtains the correction coordinates corresponding to each pixel point in the image to be identified for generating the tilt mark according to the slope of the boundary line fitting equation and the tilt angle of the image to be identified.
2. The image content recognition system based on deep learning according to claim 1, characterized in that: The specific method of obtaining the black and white binary image of the image to be recognized is: The image to be identified is evenly divided into multiple pixels, and the grayscale value of each pixel is obtained, so that the pixels greater than the grayscale threshold Y1 become white, and the pixels less than or equal to the grayscale threshold Y1 become black, thereby obtaining a black and white binary image of the image to be identified.
3. The image content recognition system based on deep learning according to claim 2, characterized in that: The specific method of obtaining the coordinates of each edge point in the black and white binary image is: A two-dimensional coordinate system is set in the black-and-white binary image, and the black-and-white binary image is sequentially scanned from left to right and from bottom to top. The coordinates of the pixel point that changes from white to black for the first time on each scan line are recorded as the edge point Aa (AXa, AYa), where a refers to different edge points in the black-and-white binary image, a is a positive integer, and a>1.
4. The image content recognition system based on deep learning according to claim 3, characterized in that: The specific method for obtaining the slope of the boundary line fitting equation is: By formula, ; Calculate the slope k of the boundary line fitting equation, where n is the number of edge points in the black-and-white binary image of the image to be identified, AXi and AYi are any one of AXa and AYa, respectively, satisfying n≥i>
1.
5. The deep learning-based image content recognition system according to claim 4, characterized in that: The specific method of obtaining the tilt angle of the image to be recognized is: The inverse tangent function value of the slope k is defined as the inclination angle θ of the image to be recognized.
6. The deep learning-based image content recognition system according to claim 5, characterized in that: The specific method for determining and generating the tilt mark is as follows: The tilt angle of the image to be identified is compared with the preset tilt threshold Y2. When the tilt angle is greater than the preset tilt threshold Y2, it is determined that the image to be identified is tilted and a tilt mark is generated. Otherwise, no processing is performed.
7. The deep learning-based image content recognition system according to claim 6, characterized in that: The specific method of analyzing and obtaining the correction coordinates corresponding to each pixel point in the image to be identified for generating the tilt mark is as follows: By formula ; and the formula ; Calculate the corresponding values of cosθ and sinθ, obtain the coordinates of the center point and each pixel point of the image to be identified from the black and white binary image, and conduct a comprehensive analysis with the sine value, cosine value of the inclination angle θ of the image to be identified and the slope of the boundary line fitting equation to obtain the corrected horizontal coordinate and corrected vertical coordinate corresponding to each pixel point in the image to be identified, and then obtain the corrected coordinates corresponding to each pixel point in the image to be identified.
8. The deep learning-based image content recognition system according to claim 7, characterized in that: The specific method of obtaining the corrected horizontal coordinates corresponding to each pixel point in the image to be identified is: Obtain the center point coordinates Z (ZX, ZY) of the image to be identified and the coordinates Di (DXi, DYi) of each pixel point from the black-and-white binary image, where i refers to different pixel points in the image to be identified, i is a positive integer, and i>1; First, add the product of the cosine value cosθ and sine value sinθ of the tilt angle θ to the horizontal coordinate DXi and vertical coordinate DYi of each pixel point, then subtract the sum of the products of the horizontal coordinate and vertical coordinate of the center point with the cosine value cosθ and sine value sinθ of the tilt angle θ, and finally add the horizontal coordinate of the center point to obtain the corrected horizontal coordinate corresponding to each pixel point in the image to be identified.
9. The deep learning-based image content recognition system according to claim 8, characterized in that: The specific method of obtaining the corrected vertical coordinates corresponding to each pixel point in the image to be identified is: First, add the product of the sine value sinθ and the cosine value cosθ of each pixel point to the horizontal coordinate DXi and the vertical coordinate DYi respectively, then subtract the difference between the horizontal coordinate and the vertical coordinate of the center point and the product of the sine value sinθ and the cosine value cosθ of the tilt angle θ, and finally add the vertical coordinate of the center point to obtain the corrected vertical coordinate corresponding to each pixel point in the image to be identified.
10. The image content recognition system based on deep learning according to claim 1, characterized in that: Each pixel point in the image to be identified is placed at its corresponding correction coordinate to implement the tilt correction operation on the image to be identified.
Citation Information
Patent Citations
Text detection method and device based on image processing, medium and electronic equipment
CN110781885A
Table image inclination angle determination method based on support vector machine
CN113516103A
Edge recognition method and system based on adaptive threshold, and storage medium
CN113538491A
Image inclination angle identification method, computer equipment and storage medium
CN117409074A
Surface paving object detection method and device based on mobile cleaning robot
CN118261931A
Cited By
Translation machine linear motion method, system and equipment based on image recognition and medium
CN120339400A
Unsupervised polygonal structural member shape fitting method
CN121616596A
Unsupervised polygonal structure fitting method
CN121616596B