Surface flatness recognition method of curved blade of grader based on machine vision
Using machine vision technology to perform edge detection and repair on the image of the grader's curved blade solves the problem of low accuracy in edge identification of scratch defects in the existing technology, improves the flatness detection of the blade surface, and enhances production quality.
Patent Information
- Application Number
- CN202410815182.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-06-24
AI Technical Summary
In the production process of grader arc blades, it is difficult to accurately identify scratched defective edges with existing technology, and it is easy to misjudge illumination and shadow edges as defective edges, resulting in low accuracy in determining the defect location and affecting the flatness and use efficiency of the blade.
Using a method based on machine vision, preprocessing and edge detection are performed by obtaining the curved blade image, using the grayscale difference and morphological characteristics around the edge to screen out the scratch defect edges, and repair them based on the positional relationship between the defect edges to determine the blade Surface smoothness.
It improves the identification accuracy of scratch defect locations, enhances the flatness detection of the blade surface, reduces misjudgments under the influence of light, and improves the production quality of the blade.
Smart Images

Figure CN118379290B
Abstract
Description
Technical Field
[0001] The invention relates to the field of image data processing, and in particular to a method for identifying the surface flatness of a curved blade of a grader based on machine vision. Background Art
[0002] A motor grader is a piece of mechanical equipment used in civil engineering and construction projects. It has a wide curved blade at the front, which is used to push the earth and level the ground. The blade is designed to be curved to be more suitable for cutting and moving soil on the land. During the production process of the blade, it is necessary to ensure the flatness of the blade. If the blade is not flat or has defects, it may lead to inefficient bulldozing operations and increase the risk of accidents.
[0003] In the production process of blades, edge detection can be used to determine the defective position of the blade. However, due to lighting factors, when edge detection is used, the edge of the lighting shadow will be mistakenly determined as the defective edge. Summary of the invention
[0004] In view of the above problems, the present application provides a method for identifying the surface flatness of a grader curved blade based on machine vision, which can screen the edges of scratch defects and repair the complete scratch defect edges, thereby improving the accuracy of determining the location of scratch defects, and thus accurately improving the flatness of the identified blade surface.
[0005] In a first aspect, an embodiment of the present application provides a method for identifying the surface flatness of a curved blade of a grader based on machine vision, comprising:
[0006] Acquire an image of the curved blade;
[0007] Preprocessing the image of the curved blade to obtain a grayscale image corresponding to the image;
[0008] Perform edge detection processing on the grayscale image to obtain an edge image of the arc blade;
[0009] According to the grayscale difference and edge morphology around the edge in the edge image, the scratch defect edge of the arc blade in the edge image is screened out;
[0010] Repairing the scratch defect edges of the arc-shaped blade according to the positional relationship between the scratch defect edges to obtain repaired scratch defect edges;
[0011] The edge length of each repaired scratch defect is compared with the minimum allowable length to determine the flatness of the curved blade surface.
[0012] In a possible implementation, preprocessing the image of the curved blade to obtain a grayscale image corresponding to the image includes:
[0013] The image of the arc blade is subjected to grayscale processing and filtering and smoothing processing to obtain a grayscale image after filtering and smoothing processing.
[0014] In a possible implementation, performing edge detection processing on the grayscale image to obtain an edge image of the arc-shaped blade includes:
[0015] The Canny edge detection algorithm is used to perform edge detection on the grayscale image corresponding to the arc-shaped blade.
[0016] In a possible implementation, the scratch defect edge of the arc blade in the edge image is screened out according to the grayscale difference and edge morphology around the edge in the edge image, including:
[0017] According to the grayscale features on both sides of each edge and the grayscale features on the edge of each edge in the edge image, the blade structure edge possibility corresponding to each edge is calculated;
[0018] According to the corresponding grayscale transformation degree in each pixel window on each edge, the surrounding grayscale transformation feature value of each edge is calculated;
[0019] According to the surrounding grayscale transformation eigenvalues of each edge and the morphological change degree of each edge, the edge eigenvalue corresponding to each edge is calculated;
[0020] Based on the blade structure edge possibility of each edge and the edge feature value corresponding to each edge, the scratch defect edge of the arc blade in the edge image is screened out.
[0021] In a possible implementation, the blade structure edge possibility corresponding to each edge is calculated based on the grayscale features on both sides of each edge and the grayscale features on the edge in the edge image, wherein the calculation formula for the blade structure edge possibility corresponding to each edge is:
[0022]
[0023] in, Indicates The blade structure edge possibility of each edge, Respectively represent The grayscale eigenvalues on both sides of the edge, Indicates The difference between the edge grayscale feature value and the edge grayscale mean of each edge is large. Represents the normalization function.
[0024] In a possible implementation, the surrounding grayscale transformation feature value of each edge is calculated according to the corresponding grayscale transformation degree in each pixel point window on each edge, wherein the calculation formula of the surrounding grayscale transformation feature value of each edge is:
[0025]
[0026] in, Indicates The grayscale transformation eigenvalues around the edges, represents the number of pixels on the vth edge, Indicates the grayscale transformation degree of the kth pixel in the i-th pixel window in the v-th edge. It represents the mean value of the grayscale transformation degree within the i-th pixel window in the v-th edge. Indicates the size of the i-th pixel window on the v-th edge, The value is 5.
[0027] In a possible implementation, the edge eigenvalue corresponding to each edge is calculated according to the surrounding grayscale transformation eigenvalue of each edge and the morphological change degree of each edge, wherein the calculation formula of the edge eigenvalue of each edge is:
[0028]
[0029] in, No. The edge eigenvalues of the edges, represents the number of pixels on the vth edge, Represents the chain code of the i-th pixel on the v-th edge, represents the vth edge The chain code of pixels, is the grayscale transformation eigenvalue of the surrounding v-th edge.
[0030] In a possible implementation, based on the blade structure edge possibility of each edge and the edge feature value corresponding to each edge, the scratch defect edge of the arc blade in the edge image is screened out, including:
[0031] The blade structure edge possibility of each edge is compared with a first preset threshold to obtain a first comparison result, the edge feature value of each edge is normalized and compared with a second preset threshold to obtain a second comparison result, and the blade structure edge and the blade reflective edge in the edge image are respectively screened out according to the first comparison result and the second comparison result to obtain the scratch defect edge of the arc blade in the edge image.
[0032] In a possible implementation, the scratch defect edge of the arc-shaped blade is repaired according to the positional relationship between the scratch defect edges to obtain the repaired scratch defect edge, including:
[0033] According to the positional relationship between the scratch defect edges of the arc blade, the necessity of connecting any two scratch defect edges is calculated;
[0034] The connection necessity is compared with a third preset threshold to obtain a third comparison result, and the scratch defect edge is repaired according to the third comparison result to obtain a repaired scratch defect edge.
[0035] In a possible implementation, the necessity of connection between any two scratch defect edges is calculated according to the positional relationship between the scratch defect edges of the arc-shaped blade, wherein the calculation formula for the necessity of connection between two scratch defect edges is:
[0036]
[0037] Among them, L represents the shortest distance between the endpoints of two edges, and Respectively represent the average tangent direction of the pixels in the two edges, Indicates the vector direction connecting the two edge endpoints, The function is an exponential normalization function.
[0038] In a second aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, various possible embodiments of the first aspect are implemented.
[0039] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute various possible implementation embodiments of the first aspect.
[0040] The beneficial effect of the present application is that when there is a defective part on the blade, edge detection is performed on the blade image to determine the defective position of the blade. Interference edges such as the edge of the blade structure itself and the blade shadow edge under the influence of light will reduce the accuracy of determining the defective position. After the present application obtains the edge detection result through edge detection, the edge of the blade structure itself is determined according to the grayscale difference characteristics existing in the blade position, and then the defective edge is further screened according to the grayscale fluctuation difference around the scratch and the light shadow edge, and the scratch edge is connected according to the trend of the scratch or scratch, and the complete scratch edge is repaired, which improves the accuracy of determining the defective position, and then accurately improves the determination of the flatness of the blade surface. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flowchart of the steps of a method for identifying the surface flatness of a curved blade of a grader based on machine vision provided in an embodiment of the present application;
[0042] Figure 2 is a schematic diagram of a curved blade provided in an embodiment of the present application;
[0043] Figure 3 is a schematic diagram of a complete edge image of a curved blade provided in an embodiment of the present application;
[0044] Figure 4 is a schematic diagram of an edge image for screening out the edge of a blade structure provided by an embodiment of the present application;
[0045] Figure 5 is a schematic diagram of an edge image provided by an embodiment of the present application, in which the edge of the blade structure and the reflective edge of the blade are removed;
[0046] Figure 6 is a structural block diagram of an electronic device provided in an embodiment of the present application;
[0047] Figure 7 It is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.
[0049] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0050] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0051] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0052] See also Figure 1 As shown, the embodiment of the present application discloses a method for identifying the surface flatness of a curved blade of a grader based on machine vision, comprising:
[0053] Step S11, acquiring an image of a curved blade;
[0054] Step S12, preprocessing the image of the curved blade to obtain a grayscale image corresponding to the image;
[0055] Step S13, performing edge detection processing on the grayscale image to obtain an edge image of the arc-shaped blade;
[0056] Step S14, screening out the scratch defect edge of the arc-shaped blade in the edge image according to the grayscale difference and edge morphology around the edge in the edge image;
[0057] Step S15, repairing the scratch defect edges of the arc-shaped blade according to the positional relationship between the scratch defect edges to obtain repaired scratch defect edges;
[0058] Step S16, comparing the edge length of each repaired scratch defect with the minimum allowable length to determine the flatness of the curved blade surface.
[0059] The image of the curved blade is acquired by an image acquisition device. For example, the image acquisition device may be a high-definition digital camera or a camera installed in the curved blade production system, which is not specifically limited here. Figure 2 As shown, an image of a curved blade captured by a camera or the like is shown.
[0060] In the steps of the above-mentioned embodiment, an image acquisition device is used to obtain an image of a curved blade, and then the image of the curved blade is subjected to grayscale processing, Gaussian filtering processing, and edge detection processing, and then the defective edge is screened in the edge image according to the grayscale difference and edge morphology around the edge in the edge image, and then the scratch defective edge is repaired according to the positional relationship between the scratch defective edges of the curved blade to obtain the repaired scratch defective edge, and finally the length of each repaired scratch defective edge is compared with the minimum allowable length to determine the flatness of the curved blade surface. After preprocessing and edge detection, the embodiment of the present application determines the edge of the blade structure itself according to the grayscale difference characteristics existing in the blade position, and then further screens the defective edge through the grayscale fluctuation difference around the scratch and the light shadow edge, and connects the scratch edge according to the trend of the scratch, repairs the complete scratch edge, improves the accuracy of determining the defective position, and then accurately improves the flatness of the blade surface.
[0061] In an optional embodiment of the present application, the image of the curved blade is preprocessed to obtain a grayscale image corresponding to the image, including:
[0062] The image of the arc blade is subjected to grayscale processing and filtering and smoothing processing to obtain a grayscale image after filtering and smoothing processing.
[0063] It should be noted that after the surface image of the arc-shaped blade is grayed, filtering and smoothing are performed, so that more high-frequency noise in the image can be filtered out, the influence of high-frequency noise on the image can be avoided, and the accuracy of subsequent image processing can be further improved. Specifically, in the embodiment of the present application, the filtering algorithm adopts a linear filtering algorithm or a nonlinear filtering algorithm, wherein the linear filtering algorithm adopts a Gaussian filtering algorithm, a box filtering algorithm or a mean filtering algorithm; the nonlinear filtering algorithm adopts a median filtering algorithm or a bilateral filtering algorithm, which is not specifically limited here.
[0064] In an optional embodiment of the present application, edge detection processing is performed on the grayscale image corresponding to the arc-shaped blade using a Canny edge detection algorithm.
[0065] It should be noted that the Canny edge detection algorithm is a particularly commonly used edge detection algorithm with excellent performance. Compared with ordinary edge detection algorithms, the Canny algorithm has the advantages of not being easily disturbed by image noise, being able to detect real weak edges and having higher detection accuracy. Its steps are not specifically limited here. The edge image of the complete curved blade obtained by the Canny edge detection algorithm is as follows: Figure 3 shown.
[0066] In an optional embodiment of the present application, the scratch defect edge of the arc blade in the edge image is screened out according to the grayscale difference and edge morphology around the edge in the edge image, including:
[0067] According to the grayscale features on both sides of each edge and the grayscale features on the edge of each edge in the edge image, the blade structure edge possibility corresponding to each edge is calculated;
[0068] According to the corresponding grayscale transformation degree in each pixel window on each edge, the surrounding grayscale transformation feature value of each edge is calculated;
[0069] According to the surrounding grayscale transformation eigenvalues of each edge and the morphological change degree of each edge, the edge eigenvalue corresponding to each edge is calculated;
[0070] Based on the blade structure edge possibility of each edge and the edge feature value corresponding to each edge, the scratch defect edge of the arc blade in the edge image is screened out.
[0071] It should be noted that in the edge image of the curved blade, due to its own structure, there are edges related to the blade structure. These edges related to the blade structure are first excluded. Then, the edge of the scratch can be determined by analyzing the grayscale difference between the scratch and the blade shadow edge. Since the scratch edge usually presents continuous linear features in a local area, the obtained edge may be discontinuous. Therefore, it is necessary to connect the blade scratches based on the position information between the edges to ensure that the complete scratch edge of the blade is finally obtained.
[0072] It should be further explained that the background of the location where the blade is placed is black, and the color of the blade is gray. Although the blade part will appear dark gray due to the influence of light, the background is still black. There are multiple small square holes on the surface of the blade. Due to the difference between the background color and the blade color, two different colors are distributed around the small holes, and the edge image appears as an approximately square edge. In addition, the edge of the entire blade is also distributed in gray and black, and the outer edge of the blade will also appear in the edge image. Since the structural edge of the blade itself is located at the intersection of the background color and the blade body color, there is a large difference between the grayscale values of the pixels around one side of the edge and the grayscale of the pixels on the edge. The greater the difference between the grayscale values around one side of the edge and the pixels on the edge, the greater the difference in grayscale values between the two sides of the edge, indicating that the edge is more likely to be a blade structural edge.
[0073] Specifically, for any edge, the grayscale mean of the three adjacent pixels (which can be any value greater than 1, 3 is taken in this application) on both sides of the normal direction of the edge pixel is obtained as the grayscale feature on both sides of the edge pixel, and the grayscale feature mean of all the edge pixels on both sides is obtained as the grayscale feature value on both sides of the edge.
[0074] In an optional embodiment of the present application, the blade structure edge possibility corresponding to each edge is calculated based on the grayscale features on both sides of each edge and the grayscale features on the edge in the edge image, wherein the calculation formula for the blade structure edge possibility corresponding to each edge is:
[0075]
[0076] in, Indicates The blade structure edge possibility of each edge, Respectively represent The grayscale eigenvalues on both sides of the edge, Indicates The difference between the edge grayscale feature value and the edge grayscale mean of each edge is large. It means that the value interval after normalization is [0,1].
[0077] It should be noted that in the above formula, , The larger the value, the more likely the edge is a blade structure edge. and Represents the difference between the grayscale eigenvalues on both sides of the edge and the edge grayscale mean. It means that the grayscale difference between the two edges is large, indicating that the edge is more likely to be a blade structure edge.
[0078] Through edge detection, scratches and reflective areas of the blade will produce edges. In the scratch area, since the scratch is sharp, the grayscale changes around the scratch edge fluctuate greatly. In the area affected by light, although edges are also produced, the grayscale value around the edge also gradually changes with the direction of light, and the grayscale value fluctuations are relatively uniform and the degree of change is relatively small.
[0079] In an optional embodiment of the present application, the surrounding grayscale transformation feature value of each edge is calculated according to the corresponding grayscale transformation degree in each pixel point window on each edge, wherein the calculation formula of the surrounding grayscale transformation feature value of each edge is:
[0080]
[0081] in, Indicates The grayscale transformation eigenvalues around the edges, represents the number of pixels on the vth edge, Indicates the grayscale transformation degree of the kth pixel in the i-th pixel window in the v-th edge. It represents the mean value of the grayscale transformation degree within the i-th pixel window in the v-th edge. Indicates the size of the i-th pixel window on the v-th edge, The value is 5.
[0082] It should be noted that, for any point on the edge, a window of size M*M (can take any value greater than 2, M=5 in this application) is taken with the pixel as the center to determine the grayscale transformation degree of each pixel in the window. Among them, for each pixel in the window, the 8-neighborhood of the pixel is obtained (the 8-neighborhood of the outermost pixel belongs partly to the inside of the window and partly to the outside of the window), and the maximum grayscale difference in the 8-neighborhood of the pixel is the grayscale transformation degree of the pixel in the window. Specifically, the maximum grayscale difference refers to the value with the largest difference in grayscale values in the 8-neighborhood of the pixel, that is, the grayscale value difference of any two neighboring pixel points in the 8 neighborhoods corresponding to the 8-neighborhood of the pixel is calculated, and the maximum value of the grayscale value difference is found therefrom, and the maximum value is the grayscale transformation degree of the pixel. Among them, in the 8-neighborhood, the distance between each pixel and its adjacent pixel can be set to 1 or 2, and the value is 1 in this application. Then the surrounding grayscale transformation eigenvalue of each edge is calculated, wherein in the above-mentioned surrounding grayscale transformation eigenvalue calculation formula of the edge, It is used to indicate the grayscale change around the pixel. Indicates the uniformity of grayscale fluctuation around the edge. It represents the product of the grayscale fluctuation uniformity and the grayscale fluctuation degree of the edge. The larger the value is, the more uneven the grayscale fluctuation around the edge is and the greater the fluctuation degree is.
[0083] Furthermore, since the scratches on the surface of the blade are generally in the form of straight lines, the edges generated by the blade reflection may be curved or in the form of curves due to different grayscale transformation areas mapped on the blade due to different directions of light.
[0084] In an optional embodiment of the present application, the edge eigenvalue corresponding to each edge is calculated according to the surrounding grayscale transformation eigenvalue of each edge and the morphological change degree of each edge, wherein the calculation formula of the edge eigenvalue of each edge is:
[0085]
[0086] in, No. The edge eigenvalues of the edges, represents the number of pixels on the vth edge, Represents the chain code of the i-th pixel on the v-th edge, represents the vth edge The chain code of pixels, is the grayscale transformation eigenvalue of the surrounding v-th edge.
[0087] It should be noted that in the above formula, Represents the chain code difference of adjacent pixels, Indicates the fluctuation of the chain code on the edge. The larger the value, the more disordered the edge is, and the greater the possibility that it is not a scratch edge. The smaller the grayscale change feature around the edge and the greater the morphological change, the more likely it is that the edge is a reflective edge of the blade.
[0088] It should be further explained that the chain code is a coding representation method for boundary points. The basic idea is to use a series of connected straight line segments with specific lengths and directions to represent the boundaries of the target. There are Freeman chain codes, normalized chain codes, etc. The specific coding method is the existing technology and is not specifically limited here. Freeman chain code coding is used in this application.
[0089] In an optional embodiment of the present application, based on the blade structure edge possibility of each edge and the edge feature value corresponding to each edge, the scratch defect edge of the arc blade in the edge image is screened out, including:
[0090] The blade structure edge possibility of each edge is compared with a first preset threshold to obtain a first comparison result, the edge feature value of each edge is normalized and compared with a second preset threshold to obtain a second comparison result, and the blade structure edge and the blade reflective edge in the edge image are respectively screened out according to the first comparison result and the second comparison result to obtain the scratch defect edge of the arc blade in the edge image.
[0091] It should be noted that the possibility of setting the edge as the edge of the blade structure The threshold is 0.8. If the current edge computing If the value is higher than (greater than or equal to) this value, it can be determined that the edge is the edge of the blade structure. The blade structure edge is screened out in the edge image, and the edge image of the blade structure edge is deleted. Figure 4 shown.
[0092] It should be further explained that Normalization is performed, and the normalized value interval is [0,1]. In this application, an exponential normalization function is used for processing. Set the edge feature value The threshold is 0.8. If the edge feature value of the current edge is greater than this value, it means that the current edge is the reflective edge of the blade. The reflective edge of the blade is filtered out in the edge image. The edge image of the reflective edge of the blade is deleted. Figure 5 shown.
[0093] Scratches on the surface of a blade are usually continuous straight lines, but due to the influence of light, the grayscale value of the entire blade will sometimes increase, resulting in some scratches that cannot be clearly identified. In this case, the information between adjacent scratches can be used to repair these unrecognized scratches. Since scratches are straight lines, the trends between the edges of the same scratch are usually similar, and their positional relationship is also relatively close. This means that known scratch information can be used to fill in some unrecognizable scratches, and the repaired scratches will also meet the characteristics similar to the trend of the known scratch edge.
[0094] When using known scratch information to fill the unrecognizable middle scratch edge, the two endpoints with the shortest distance between the edge endpoints can be used as the end point and starting point of the filled edge. Since the scratch is a straight line, the two endpoints can be directly connected as the repaired scratch.
[0095] In an optional embodiment of the present application, the scratch defect edge is repaired according to the positional relationship between the scratch defect edges of the arc-shaped blade to obtain the repaired scratch defect edge, including:
[0096] According to the positional relationship between the scratch defect edges of the arc blade, the necessity of connecting any two scratch defect edges is calculated;
[0097] The connection necessity is compared with a third preset threshold to obtain a third comparison result, and the scratch defect edge is repaired according to the third comparison result to obtain a repaired scratch defect edge.
[0098] Furthermore, according to the positional relationship between the scratch defect edges of the arc-shaped blade, the connection necessity between any two scratch defect edges is calculated, wherein the calculation formula for the connection necessity between two scratch defect edges is:
[0099]
[0100] Among them, L represents the shortest distance between the endpoints of two edges, and Respectively represent the average tangent direction of the pixels in the two edges, Indicates the direction of the vector connecting the endpoints with the shortest distance between two edges. The function is an exponential normalization function.
[0101] It should be noted that in the above formula, It indicates the difference in the trend direction of the two edges. The smaller the value, the more likely it is that the two edges are one scratch, and the necessity of repairing and filling the edge between the two edges is stronger. and They represent the repaired scratch obtained through the two edges and the gradient change direction of the two edges. The smaller the value is, the more consistent the repaired scratch is with the gradient change direction of the two edges, indicating that the scratch has a higher necessity to be repaired. The function is an exponential normalization function, and the normalized value range is [0,1].
[0102] Furthermore, the connection between the two edges is necessary The threshold value is 0.8. If the connection necessity between two edges is higher than this value, the current edge and the surrounding edges can be used to repair the middle scratch edge. Specifically, when the connection necessity between two edges is higher than the preset threshold, the two endpoints of the two edges with the shortest distance between them can be directly connected in a straight line to achieve scratch edge repair, so that the two edges and each pixel point on the connecting straight line are combined into an overall scratch defect edge, and the combined scratch defect edge is the repaired scratch defect edge.
[0103] In an optional embodiment of the present application, the length of each repaired scratch defect edge is compared with the minimum allowable length to determine the flatness of the curved blade surface, specifically: the minimum allowable length of the defect edge is determined by the prior blade quality requirements, the number of pixels of all defect edges in the image is converted into the actual scratch length on the blade surface through the camera internal and external parameters, and it is compared with the minimum allowable length, and the scratches greater than the minimum allowable length are regarded as defective scratches. If it is determined that there are no defective scratches on the blade surface, it means that the blade surface is flat, otherwise, it means that the blade surface flatness is poor.
[0104] See also Figure 6 As shown, an embodiment of the present application discloses an electronic device 20, including a processor 21 and a memory 22; wherein the memory 22 is used to store a computer program; the processor 21 is used to implement the machine vision-based surface flatness recognition method of a grader curved blade provided in the aforementioned method embodiment by executing the computer program.
[0105] The specific process of the above-mentioned method for identifying the surface flatness of the curved blade of a grader based on machine vision can be referred to the corresponding content disclosed in the aforementioned embodiment, and will not be repeated here.
[0106] Furthermore, the memory 22, as a carrier for storing resources, may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.
[0107] In addition, the electronic device 20 also includes a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26; wherein the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input / output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0108] Furthermore, the present application also discloses a computer-readable storage medium. Figure 7 As shown, it is used to store a computer program 31, wherein when the computer program is executed by the processor, the surface flatness identification method of the curved blade of a grader based on machine vision provided by the aforementioned method embodiment is implemented.
[0109] The specific process of the above-mentioned method for identifying the surface flatness of the curved blade of a grader based on machine vision can be referred to the corresponding content disclosed in the aforementioned embodiment, and will not be repeated here.
[0110] The embodiment of the present application also provides a computer program product containing instructions. When the computer program product is run on a computer, it enables the computer to execute the method for identifying the surface flatness of a grader curved blade based on machine vision as shown in the method embodiment of the present application.
[0111] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0112] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0113] The above is a detailed introduction to the surface flatness identification method of the curved blade of a grader based on machine vision provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for identifying the surface flatness of a curved blade of a grader based on machine vision, characterized in that: include: Acquire an image of the curved blade; Preprocessing the image of the curved blade to obtain a grayscale image corresponding to the image; Performing edge detection processing on the grayscale image to obtain an edge image of the arc-shaped blade; Screening out the scratch defect edge of the arc-shaped blade in the edge image according to the grayscale difference around the edge and the edge morphology in the edge image; Repairing the scratch defect edges of the arc-shaped blade according to the positional relationship between the scratch defect edges to obtain repaired scratch defect edges; Comparing the edge length of each repaired scratch defect with the minimum allowable length to determine the flatness of the curved blade surface; Repairing the scratch defect edges of the arc-shaped blade according to the positional relationship between the scratch defect edges to obtain the repaired scratch defect edges, including: Calculating the necessity of connection between any two scratch defect edges according to the positional relationship between the scratch defect edges of the arc-shaped blade; Comparing the connection necessity with a third preset threshold to obtain a third comparison result, and repairing the scratch defect edge according to the third comparison result to obtain a repaired scratch defect edge; According to the positional relationship between the scratch defect edges of the arc-shaped blade, the connection necessity between any two scratch defect edges is calculated, wherein the calculation formula for the connection necessity between two scratch defect edges is: Among them, L represents the shortest distance between the endpoints of two edges, and Respectively represent the average tangent direction of the pixels in the two edges, Indicates the vector direction connecting the two edge endpoints, The function is an exponential normalization function.
2. The method for identifying the surface flatness of a curved blade of a motor grader based on machine vision according to claim 1, characterized in that: Preprocessing the image of the curved blade to obtain a grayscale image corresponding to the image includes: The image of the arc-shaped blade is subjected to grayscale processing and filtering and smoothing processing to obtain a grayscale image after filtering and smoothing processing.
3. The method for identifying the surface flatness of a curved blade of a motor grader based on machine vision according to claim 1, characterized in that: Performing edge detection processing on the grayscale image to obtain the edge image of the arc-shaped blade includes: The Canny edge detection algorithm is used to perform edge detection processing on the grayscale image corresponding to the arc-shaped blade.
4. The method for identifying the surface flatness of a curved blade of a motor grader based on machine vision according to claim 1, characterized in that: Screening out the scratch defect edge of the arc-shaped blade in the edge image according to the grayscale difference and edge morphology around the edge in the edge image, including: Calculating the blade structure edge possibility corresponding to each edge according to the grayscale features on both sides of each edge and the grayscale features on the edge in the edge image; According to the corresponding grayscale transformation degree in each pixel window on each edge, the surrounding grayscale transformation feature value of each edge is calculated; According to the surrounding grayscale transformation eigenvalues of each edge and the morphological change degree of each edge, the edge eigenvalue corresponding to each edge is calculated; Based on the blade structure edge possibility of each edge and the edge feature value corresponding to each edge, the scratch defect edge of the arc blade in the edge image is screened out.
5. The method for identifying the surface flatness of a curved blade of a motor grader based on machine vision according to claim 4, characterized in that: According to the grayscale features on both sides of each edge and the grayscale features on the edge of each edge in the edge image, the blade structure edge possibility corresponding to each edge is calculated, wherein the calculation formula of the blade structure edge possibility corresponding to each edge is: in, Indicates The blade structure edge possibility of each edge, Respectively represent The grayscale eigenvalues on both sides of the edge, Indicates The difference between the edge grayscale feature value and the edge grayscale mean of each edge is large. Represents the normalization function.
6. The method for identifying the surface flatness of a curved blade of a motor grader based on machine vision according to claim 4, characterized in that: According to the corresponding grayscale transformation degree in each pixel window on each edge, the surrounding grayscale transformation eigenvalue of each edge is calculated, where the calculation formula of the surrounding grayscale transformation eigenvalue of each edge is: in, Indicates The grayscale transformation eigenvalues around the edges, represents the number of pixels on the vth edge, Indicates the grayscale transformation degree of the k-th pixel in the i-th pixel window in the v-th edge. It represents the mean value of the grayscale transformation degree within the i-th pixel window in the v-th edge. Indicates the size of the i-th pixel window on the v-th edge, The value is 5.
7. The method for identifying the surface flatness of a curved blade of a motor grader based on machine vision according to claim 4, characterized in that: According to the surrounding grayscale transformation eigenvalue of each edge and the morphological change degree of each edge, the edge eigenvalue corresponding to each edge is calculated, where the calculation formula of the edge eigenvalue of each edge is: in, No. The edge eigenvalues of the edges, represents the number of pixels on the vth edge, Represents the chain code of the i-th pixel on the v-th edge, represents the vth edge The chain code of pixels, is the grayscale transformation eigenvalue of the surrounding v-th edge.
8. The method for identifying the surface flatness of a curved blade of a motor grader based on machine vision according to claim 4, characterized in that: Based on the blade structure edge possibility of each edge and the edge feature value corresponding to each edge, the scratch defect edge of the arc blade in the edge image is screened out, including: The blade structure edge possibility of each edge is compared with a first preset threshold to obtain a first comparison result, the edge feature value of each edge is normalized and then compared with a second preset threshold to obtain a second comparison result, and the blade structure edge and the blade reflective edge in the edge image are respectively screened out according to the first comparison result and the second comparison result to obtain the scratch defect edge of the arc blade in the edge image.
