Method and system for acquiring light bar sub-pixel edge in light bar image of large-scale high-temperature forging
By acquiring pixels with pixel-level edges as the center in high-temperature forging images and establishing a coordinate system, and using curve δ to obtain subpixel-level edges, the problem of the change in curvature of light strips due to indentation affects the extraction accuracy of subpixel edges, achieving high Accurate subpixel edge acquisition.
Patent Information
- Application Number
- CN202411663325.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-07
AI Technical Summary
During the forging of high-temperature forging, indentation may appear on the surface of the forging, resulting in changes in curvature of the light strips and affecting the accuracy of the extraction of subpixel edges.
By obtaining pixels in the N1×N2 range with the pixel-level edge as the center in the forging image, and establishing a coordinate system, the curve δ is obtained based on the grayscale of the pixel, and the curve δ intersects the edge line of the pixel-level edge to obtain the subpixel-level edge. .
It realizes high-precision acquisition of the subpixel edge of the light bar in high-temperature forging images, which is especially suitable for handling cases where the curvature of the light bar is greatly changed due to indentation.
Smart Images

Figure CN119399233A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision detection, and in particular to a method and system for obtaining sub-pixel edges of light stripes in a light strip image of a large high-temperature forging. Background Art
[0002] In industries such as electricity, petroleum, chemical industry, shipbuilding, and aerospace, the core components of key equipment are mostly large components, and the mass of their blanks is usually between tens of tons and hundreds of tons, and these large components are mostly processed by free forging technology. During the forging process, the temperature of the forging will be maintained in the high temperature range of 1000-1200℃, so it is regarded as a high-temperature part. Since high-temperature forgings emit strong radiation light, in order to avoid the influence of this light when shooting, a short-wave pass filter is usually installed in front of the camera lens. Then, a projector, laser transmitter and other equipment are used to project the light bar onto the surface of the forging, and a series of processing - including the recognition of the light bar, the extraction of sub-pixel edges and three-dimensional reconstruction - is used to obtain the three-dimensional information of the shape of the high-temperature forging, which can then be used for the accurate measurement of the forging size.
[0003] In the above process, extracting the sub-pixel edge of the projected light strip on the surface of the high-temperature forging is a crucial step, because it is directly related to the accuracy and reliability of the 3D reconstruction of the forging shape. However, it is worth noting that indentations may appear on the surface of the free forging during the forging process, and the sub-pixel edge extraction accuracy of these indentation positions still needs to be further improved. Summary of the invention
[0004] The purpose of the present invention is to propose a method and system for obtaining sub-pixel edges of light strips in a light strip image of a large high-temperature forging. The method and system are suitable for obtaining sub-pixel edges of light strips with large curvature due to indentations on the surface of the forging, and have the advantages of high precision and stable calculation process.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for obtaining a sub-pixel edge of a light strip in a light strip image of a large high-temperature forging is provided, comprising the following steps:
[0006] The pixels in the range of N1×N2 are obtained with the pixel-level edge of the light strip in the forging image as the center, and the coordinate system oxy is established with the center of the pixel as the coordinate origin o, where x is the horizontal axis of the coordinate system and y is the vertical axis of the coordinate system;
[0007] In the coordinate system oxy, the curve δ is obtained according to the grayscale of the pixels in the range N1×N2;
[0008] After the curve δ intersects with the edge line of the pixel where the pixel-level edge is located, two intersection points are obtained, and a straight line perpendicular to the line connecting the center of the pixel-level edge and the two intersection points is obtained. The intersection of the straight line and the curve δ is the sub-pixel edge corresponding to the obtained pixel-level edge.
[0009] In one embodiment, the pixel level edge P(i,j) of the light strip in the forging image is taken as the center to obtain pixels within a 7×5 range, and the grayscale of the pixel P(i+k1,j+k2) is expressed as w i+k1j+k2 Indicates; where k1 = -3, -2, -1, 0, 1, 2, 3, k2 = -2, -1, 0, 1, 2.
[0010] In one embodiment, the expression of curve δ is:
[0011] y=t1x 4 +t2x 3 +t3x 2 +t4x+t5
[0012] Among them, t1, t2, t3, t4 and t5 are the coefficients of the curve to be calculated. When the light bar is horizontal, the curve δ divides the pixels in the 7×5 range into two upper and lower regions, and the grayscale in the two regions is represented by G u and G d express.
[0013] In one embodiment, the sum of the grayscale of each column of pixels within the 7×5 range is represented by S1, S2, S3, S4 and S5 respectively, and the sum of the grayscale of each column of pixels under the curve δ is represented by A d1 ,A d2 ,A d3 ,A d4 and A d5 Indicates; then S1, S2, S3, S4 and S5 are obtained as follows:
[0014]
[0015] Among them, A d1 ,A d2 ,A d3 ,A d4 and A d5 The way to obtain is:
[0016]
[0017] In one embodiment, the grayscale G in the two regions u and G d They are:
[0018]
[0019] In one embodiment, the coefficients t1, t2, t3, t4 and t5 in the curve δ are solved in the following manner:
[0020]
[0021] After obtaining the values of coefficients t1, t2, t3, t4 and t5, substitute them into the expression of curve δ.
[0022] In one embodiment, the intersection points of the curve δ with the straight lines x=-σ / 2 and x=σ / 2 are denoted by D1 and D2, respectively, and the straight line passing through the point D1 and the point D2 is denoted by l D1D2 Indicates; get the coordinate system origin o perpendicular to the straight line l D1D2 The straight line l C , vertical line l C With straight line l D1D2 The intersection point is P S If P S is the sub-pixel edge corresponding to the pixel-level edge P(i,j).
[0023] According to a second aspect of an embodiment of the present disclosure, a system for acquiring sub-pixel edges of light stripes in a light strip image of a large high-temperature forging is provided, comprising:
[0024] The coordinate system establishment module takes the pixel-level edge of the light strip in the forging image as the center to obtain pixels within the range of N1×N2, and takes the center of the pixel as the coordinate origin o to establish the coordinate system oxy, where x is the horizontal axis of the coordinate system and y is the vertical axis of the coordinate system;
[0025] The curve acquisition module obtains the curve δ according to the grayscale of pixels within the range of N1×N2 in the coordinate system oxy;
[0026] Sub-pixel edge acquisition module, after the curve δ intersects with the edge line of the pixel where the pixel-level edge is located, two intersection points are obtained, and a straight line perpendicular to the line connecting the center of the pixel-level edge and the two intersection points is obtained. The intersection of this straight line and the curve δ is the sub-pixel edge corresponding to the obtained pixel-level edge.
[0027] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored and running on the memory, wherein when the processor executes the program, a method for obtaining sub-pixel edges of light strips in a light strip image of a large high-temperature forging is implemented.
[0028] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, a method for obtaining sub-pixel edges of light strips in a light strip image of a large high-temperature forging is implemented.
[0029] Compared with the prior art, the above technical solution adopted by the present invention has the following advantages: the present invention can effectively obtain the sub-pixel edges of the light strips on the forgings in the images of large high-temperature forgings, and is particularly good at handling the situation where the curvature of the light strips on the forging surface changes significantly due to indentations, showing high-precision computing capabilities and good adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings in the specification, which constitute a part of the present application, are used to provide further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0031] Figure 1 To obtain the sub-pixel edge diagram of the light strip on the forging. DETAILED DESCRIPTION
[0032] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.
[0033] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0034] 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.
[0035] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and systems according to various embodiments of the present disclosure. It should be noted that each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code may include one or more executable instructions for implementing the logical functions specified in each embodiment. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the flowchart and / or block diagram, and the combination of boxes in the flowchart and / or block diagram can be implemented using a dedicated hardware-based system that performs a specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0036] Embodiment 1:
[0037] This embodiment provides a method for obtaining sub-pixel edges of light stripes in a light strip image of a large high-temperature forging, comprising the following steps:
[0038] S1. Take the pixel-level edge of the light strip in the forging image as the center to obtain pixels within the range of N1×N2, and establish a coordinate system oxy with the center of the pixel as the coordinate origin o, where x is the horizontal axis of the coordinate system and y is the vertical axis of the coordinate system;
[0039] Specifically, the forging image is an image of a large high-temperature forging taken by an industrial camera. The temperature of the high-temperature forging is 1000℃~1200℃; the industrial camera is a black and white camera with a short-wave filter installed in front of the camera lens; when shooting, a projection device is used to project a light bar onto the forging.
[0040] Taking the pixel-level edge Q(i,j) as the center, the pixel Q(i+k1,j+k2) within the range of 7×5 can be taken in the large high-temperature forging image. The grayscale of the pixel Q(i+k1,j+k2) is expressed as w i+k1j+k2 Indicates; where k1 = -3, -2, -1, 0, 1, 2, 3, k2 = -2, -1, 0, 1, 2.
[0041] S2. Obtain the curve δ according to the grayscale of pixels within the range of N1×N2 in the coordinate system oxy;
[0042] Specifically, suppose there is a curve in the coordinate system Oxy, and the expression of the curve δ is: y = t1x 4 +t2x 3 +t3x 2 +t4x+t5; where t1, t2, t3, t4 and t5 are the coefficients of the curve to be determined. The length and width of a pixel are equal, both represented by σ and σ=1. It can be considered that the curve δ divides the pixels in the 7×5 range into two regions, and the grayscale values in the regions are the same. When the light bar is horizontal, the curve δ divides the pixels in the 7×5 range into two regions, the upper and lower regions, and the grayscale values in the two regions are represented by G u and G d express.
[0043] The sum of the grayscale of each column of pixels within the 7×5 range is represented by S1, S2, S3, S4 and S5 respectively, and the sum of the grayscale of each column of pixels under the curve δ is represented by A d1 ,A d2 ,A d3 ,A d4 and A d5 Indicates; then S1, S2, S3, S4 and S5 are obtained as follows:
[0044]
[0045] Among them, A d1 ,A d2 ,A d3 ,A d4 and A d5 The way to obtain is:
[0046]
[0047] As a preference, the grayscale G in the two regions u and G d They are:
[0048]
[0049] Therefore, the coefficients t1, t2, t3, t4 and t5 in the curve δ can be solved in the following way:
[0050]
[0051] After obtaining the values of coefficients t1, t2, t3, t4 and t5, the expression of curve δ can be obtained.
[0052] S3. After the curve δ intersects with the edge line of the pixel where the pixel-level edge is located, two intersection points are obtained, and a straight line perpendicular to the line connecting the center of the pixel-level edge and the two intersection points is obtained. The intersection of the straight line and the curve δ is the sub-pixel edge corresponding to the obtained pixel-level edge.
[0053] Specifically, the intersection points of the curve δ and the straight lines x = -σ / 2 and x = σ / 2 are denoted by D1 and D2 respectively, and the straight line passing through the points D1 and D2 is denoted by l D1D2 Indicates; get the coordinate system origin o perpendicular to the straight line l D1D2 The straight line l C , vertical line l C With straight line l D1D2 The intersection point is P S If P S is the sub-pixel edge corresponding to the pixel-level edge P(i,j).
[0054] The proposed method can solve the problem that the indentation on the surface of high-temperature forgings during free forging causes the curvature of the light strips in the image to increase, thereby affecting the accuracy of sub-pixel edge extraction. It is particularly suitable for obtaining sub-pixel edges of light strips at the indentation position in the image of large high-temperature forgings.
[0055] Embodiment 2:
[0056] This embodiment provides a system for obtaining sub-pixel edges of light stripes in a light strip image of a large high-temperature forging, including:
[0057] The coordinate system establishment module takes the pixel-level edge of the light strip in the forging image as the center to obtain pixels within the range of N1×N2, and takes the center of the pixel as the coordinate origin o to establish the coordinate system oxy, where x is the horizontal axis of the coordinate system and y is the vertical axis of the coordinate system;
[0058] The curve acquisition module obtains the curve δ according to the grayscale of pixels within the range of N1×N2 in the coordinate system oxy;
[0059] Sub-pixel edge acquisition module, after the curve δ intersects with the edge line of the pixel where the pixel-level edge is located, two intersection points are obtained, and a straight line perpendicular to the line connecting the center of the pixel-level edge and the two intersection points is obtained. The intersection of this straight line and the curve δ is the sub-pixel edge corresponding to the obtained pixel-level edge.
[0060] Embodiment three:
[0061] An electronic device includes a memory, a processor, and a computer program stored and running on the memory, wherein the processor implements the above-mentioned method for obtaining the sub-pixel edge of a light strip in a light strip image of a large high-temperature forging when executing the program, including:
[0062] The pixels in the range of N1×N2 are obtained with the pixel-level edge of the light strip in the forging image as the center, and the coordinate system oxy is established with the center of the pixel as the coordinate origin o, where x is the horizontal axis of the coordinate system and y is the vertical axis of the coordinate system;
[0063] In the coordinate system oxy, the curve δ is obtained according to the grayscale of the pixels in the range N1×N2;
[0064] After the curve δ intersects with the edge line of the pixel where the pixel-level edge is located, two intersection points are obtained, and a straight line perpendicular to the line connecting the center of the pixel-level edge and the two intersection points is obtained. The intersection of the straight line and the curve δ is the sub-pixel edge corresponding to the obtained pixel-level edge.
[0065] Embodiment 4:
[0066] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for obtaining the sub-pixel edge of a light strip in a light strip image of a large high-temperature forging, comprising:
[0067] The pixels in the range of N1×N2 are obtained with the pixel-level edge of the light strip in the forging image as the center, and the coordinate system oxy is established with the center of the pixel as the coordinate origin o, where x is the horizontal axis of the coordinate system and y is the vertical axis of the coordinate system;
[0068] In the coordinate system oxy, the curve δ is obtained according to the grayscale of the pixels in the range N1×N2;
[0069] After the curve δ intersects with the edge line of the pixel where the pixel-level edge is located, two intersection points are obtained, and a straight line perpendicular to the line connecting the center of the pixel-level edge and the two intersection points is obtained. The intersection of the straight line and the curve δ is the sub-pixel edge corresponding to the obtained pixel-level edge.
[0070] Those skilled in the art should understand that the modules or steps of the present disclosure can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present disclosure is not limited to any specific combination of hardware and software.
[0071] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0072] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Technical personnel in the relevant field should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.
Claims
1. A method for obtaining the sub-pixel edge of a light strip in a light strip image of a large high-temperature forging, characterized in that: The following steps are involved: The pixels in the range of N1×N2 are obtained with the pixel-level edge of the light strip in the forging image as the center, and the coordinate system oxy is established with the center of the pixel as the coordinate origin o, where x is the horizontal axis of the coordinate system and y is the vertical axis of the coordinate system; In the coordinate system oxy, the curve δ is obtained according to the grayscale of the pixels in the range N1×N2; After the curve δ intersects with the edge line of the pixel where the pixel-level edge is located, two intersection points are obtained, and a straight line perpendicular to the line connecting the center of the pixel-level edge and the two intersection points is obtained. The intersection of the straight line and the curve δ is the sub-pixel edge corresponding to the obtained pixel-level edge.
2. According to claim 1, a method for obtaining the sub-pixel edge of a light strip in a light strip image of a large high-temperature forging is characterized in that: The pixels in the 7×5 range are obtained with the pixel-level edge P(i,j) of the light strip in the forging image as the center. The grayscale of the pixel P(i+k1,j+k2) is expressed as w i+k1j+k2 Indicates; where k1 = -3, -2, -1, 0, 1, 2, 3, k2 = -2, -1, 0, 1, 2.
3. According to claim 1, a method for obtaining the sub-pixel edge of a light strip in a light strip image of a large high-temperature forging is characterized in that: The expression of curve δ is: <h2 style=";text-align:left;direction:ltr">y = t1x<h2 style=";text-align:left;direction:ltr"> 4 <h2 style=";text-align:left;direction:ltr"> +t2x<h2 style=";text-align:left;direction:ltr"> 3 <h2 style=";text-align:left;direction:ltr"> +t3x<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +t4x+t5 Among them, t1, t2, t3, t4 and t5 are the coefficients of the curve to be calculated. When the light bar is horizontal, the curve δ divides the pixels in the 7×5 range into two upper and lower regions, and the grayscale in the two regions is represented by G u and G d express.
4. According to claim 3, a method for obtaining the sub-pixel edge of a light strip in a light strip image of a large high-temperature forging is characterized in that: The sum of the grayscale of each column of pixels within the 7×5 range is represented by S1, S2, S3, S4 and S5 respectively, and the sum of the grayscale of each column of pixels under the curve δ is represented by A d1 ,A d2 ,A d3 ,A d4 and A d5 Indicates; then S1, S2, S3, S4 and S5 are obtained as follows: Among them, A d1 ,A d2 ,A d3 ,A d4 and A d5 The way to obtain is:
5. A method for obtaining sub-pixel edges of light stripes in a light strip image of a large high-temperature forging according to claim 3 or 4, characterized in that: Grayscale G in the two regions u and G d They are:
6. A method for obtaining sub-pixel edges of light stripes in a light strip image of a large high-temperature forging according to claim 5, characterized in that: The coefficients t1, t2, t3, t4 and t5 in the curve δ are solved in the following way: After obtaining the values of coefficients t1, t2, t3, t4 and t5, substitute them into the expression of curve δ.
7. According to claim 1, a method for obtaining the sub-pixel edge of a light strip in a light strip image of a large high-temperature forging is characterized in that: The intersection points of the curve δ and the straight lines x = -σ / 2 and x = σ / 2 are denoted by D1 and D2 respectively, and the straight line passing through points D1 and D2 is denoted by Indicates; get the coordinate system origin o perpendicular to the straight line The straight line l C , vertical line l C With straight line The intersection point is P S If P S is the sub-pixel edge corresponding to the pixel-level edge P(i,j).
8. A system for obtaining sub-pixel edges of light stripes in a light strip image of a large high-temperature forging, characterized in that: include: The coordinate system establishment module takes the pixel-level edge of the light strip in the forging image as the center to obtain pixels within the range of N1×N2, and takes the center of the pixel as the coordinate origin o to establish the coordinate system oxy, where x is the horizontal axis of the coordinate system and y is the vertical axis of the coordinate system; The curve acquisition module obtains the curve δ according to the grayscale of pixels within the range of N1×N2 in the coordinate system oxy; Sub-pixel edge acquisition module, after the curve δ intersects with the edge line of the pixel where the pixel-level edge is located, two intersection points are obtained, and a straight line perpendicular to the line connecting the center of the pixel-level edge and the two intersection points is obtained. The intersection of this straight line and the curve δ is the sub-pixel edge corresponding to the obtained pixel-level edge.
9. An electronic device comprising a memory, a processor and a computer program stored and running on the memory, wherein when the processor executes the program, the method for obtaining the sub-pixel edge of a light strip in a light strip image of a large high-temperature forging as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for obtaining sub-pixel edges of light stripes in a light strip image of a large high-temperature forging as described in any one of claims 1 to 7.