Engine machining surface detection method and computer readable storage medium
By identifying continuous edge search line segments and areas of interest in the engine processing surface image, edge detection and contour update are performed, the problem of inaccurate edge detection of the engine processing surface is solved, and high-precision edge positioning and background noise suppression are achieved.
Patent Information
- Application Number
- CN202411350493.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-09-26
AI Technical Summary
In the prior art, the edge detection of the engine processing surface is inaccurate, especially when the contour shape is complex and the background interference is large, resulting in low detection accuracy.
By determining multiple continuous edge search segments in the engine machining surface image, determining the region of interest based on these line segments for edge detection, obtaining the initial contour, and updating the contour through the preset edge distance, achieving high-precision segmentation of the edge of the machining surface and Positioning to avoid background noise interference.
The accuracy of edge detection of the engine machining surface is improved, the accuracy of the final profile is ensured, and the problem of inaccurate edge detection in the prior art is solved.
Smart Images

Figure CN118864475B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of engine detection, and in particular, to a method for detecting an engine machining surface, a computer-readable storage medium, and an electronic device. Background Art
[0002] During the production of engine bodies, a large amount of manpower is required to inspect defects on the engine machining surfaces. Some projects use 2D visual automatic inspection, but the results are not ideal, especially for the inspection of the edges of the engine machining surfaces, where the contours are complex and changeable, and there is a lot of background interference, resulting in low detection accuracy. Summary of the invention
[0003] The main purpose of the present application is to provide a method for detecting an engine processing surface, a computer-readable storage medium and an electronic device, so as to at least solve the problem of inaccurate edge detection of the engine processing surface in the prior art.
[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for detecting a machining surface of an engine is provided, comprising: determining a plurality of continuous edge search line segments of an image of a machining surface of an engine, wherein each of the edge search line segments satisfies: a pixel value difference between two endpoints of a first line segment corresponding to the edge search line segment is not less than a first pixel value, and the first line segment is a line segment passing through the midpoint of the corresponding edge search line segment, being perpendicular to the edge search line segment, and having the same distance from the two endpoints to the edge search line segment; determining a plurality of regions of interest of the machining surface image according to the plurality of edge search line segments, and performing edge detection on the plurality of regions of interest to obtain the machining surface of the engine; The initial contour of the surface, the region of interest corresponds to the edge search line segment one-to-one, the edge search line segment is located in the region of interest, and the initial contour includes a plurality of initial coordinate points adjacent to each other in sequence; according to a preset edge distance, the initial contour is updated to obtain a final contour, the final contour includes a plurality of final coordinate points adjacent to each other in sequence, the final coordinate points correspond to the initial coordinate points one-to-one, the second line segment is perpendicular to the third line segment, the length of the second line segment is the edge distance, the second line segment is a line segment formed by the initial coordinate point and the corresponding final coordinate point, and the third line segment is a line segment formed by the initial coordinate point and another adjacent initial coordinate point.
[0005] Optionally, determining a plurality of continuous edge search line segments of the engine processing surface image comprises: determining the first edge search line segment from the processing surface image; determining the end point of the i+1th initial search line segment according to the line segment parameters of the i-th edge search line segment, wherein the starting point of the i+1th initial search line segment is the end point of the i-th edge search line segment, the i-th edge search line segment and the i+1th initial search line segment have the same line segment parameters, the line segment parameters include line segment length and line segment angle, the line segment angle is the line segment and the predetermined axis of the image coordinate system of the processing surface image. , i≥1 and i is an integer; according to the i+1th initial search line segment, a fourth line segment corresponding to the i+1th initial search line segment is fitted, and the fourth line segment is a line segment passing through the midpoint of the corresponding i+1th initial search line segment, perpendicular to the i+1th initial search line segment, with a length of a preset length and the same distances from two endpoints to the i+1th initial search line segment; at least according to the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, the i+1th edge search line segment is determined to obtain a plurality of edge search line segments.
[0006] Optionally, the i+1th edge search line segment is determined at least according to the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, and a plurality of edge search line segments are obtained, including: a first determination step of determining whether the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is less than the first pixel value; a rotation step of rotating the i+1th initial search line segment with the starting point of the i+1th initial search line segment as the rotation point when the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is less than the first pixel value, until the i+1th initial search line segment after rotation is The pixel value difference between the two endpoints of the fourth line segment corresponding to the search line segment is not less than the first pixel value, and the i+1th edge search line segment is obtained. When the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is not less than the first pixel value, the i+1th edge search line segment is the i+1th initial search line segment; the second determination step is to determine whether the number of the obtained edge search line segments reaches a predetermined number. When the number does not reach the predetermined number, the first determination step and the rotation step are executed repeatedly until the number reaches the predetermined number, so as to obtain the predetermined number of edge search line segments.
[0007] Optionally, before determining the first edge search line segment from the processing surface image, the method also includes: identifying the body information of the engine, and determining the engine model of the engine based on the body information; determining the image template corresponding to the engine model; determining the first edge search line segment from the processing surface image, including: processing the processing surface image using a template matching algorithm based on the image template to determine a starting search position from the processing surface image to obtain the starting point of the first edge search line segment; determining a target search position based on the line segment parameters and the starting search position to obtain the end point of the first edge search line segment, the distance between the target search position and the starting search position being the line segment length, and the angle between the line connecting the target search position and the starting search position and the predetermined axis being the line segment angle.
[0008] Optionally, according to the i+1th initial search line segment, a fourth line segment corresponding to the i+1th initial search line segment is fitted, including: calculating the coordinates of the midpoint of the i+1th initial search line segment according to the coordinates of the two endpoints of the i+1th initial search line segment; rotating the i+1th initial search line segment 90° along a predetermined direction with the midpoint of the i+1th initial search line segment as the rotation point, and determining the coordinates of the two endpoints of the fourth line segment on the straight line where the i+1th initial search line segment is located after the rotation according to the preset length, and the predetermined direction is clockwise or counterclockwise.
[0009] Optionally, after updating the initial contour according to a preset edge distance to obtain a final contour, the method further includes: dividing the area enclosed by the final contour along the final contour to obtain multiple sub-regions; and performing defect detection on the multiple sub-regions to determine whether the processed surface is qualified.
[0010] Optionally, defect detection is performed on multiple sub-regions to determine whether the processed surface is qualified, including: determining the grayscale difference of the multiple sub-regions, the grayscale difference characterizing the change in the pixel value of the sub-region; determining whether there is an abnormal sub-region among the multiple sub-regions based on the multiple grayscale differences, wherein the sub-region where the grayscale difference is greater than the second pixel value is the abnormal sub-region; in the case where there is an abnormal sub-region among the multiple sub-regions, detecting the position of a spot in the abnormal sub-region, and calculating the aspect ratio of the spot based on the spot position; determining the type of the spot and the corresponding number of each type of spots based on the aspect ratio, the type including at least one of the following: cracks, sand holes; determining whether the processed surface of the engine is qualified based on the type and the corresponding number of each type.
[0011] Optionally, updating the initial contour according to a preset edge distance to obtain a final contour includes: extracting two adjacent initial coordinate points from the initial contour along a predetermined direction to obtain the jth initial coordinate point and the j+1th initial coordinate point, where the predetermined direction is a clockwise direction or a counterclockwise direction, and j≥1 is an integer; fitting the jth initial coordinate point and the j+1th initial coordinate point to obtain the third line segment with a starting point being the jth initial coordinate point and an end point being the j+1th initial coordinate point; and obtaining the angle of the third line segment. And according to the angle of the third line segment, determine the target angle as the sum of the angle of the third line segment and 90°, and the angle of the third line segment is the angle between the third line segment and the predetermined axis of the image coordinate system of the processing surface image; according to the target angle, the jth initial coordinate point and the edge distance, determine the end point coordinates of the line segment with the jth initial coordinate point as the starting point, the length as the edge distance, the angle with the predetermined axis as the target angle, and the direction from the starting point to the end point pointing to the inside of the initial contour, and obtain the final coordinate point corresponding to the jth initial coordinate point.
[0012] Optionally, determining multiple regions of interest of the processing surface image based on the multiple edge search line segments includes: determining, based on the edge search line segments, that the corresponding regions of interest are rectangular regions with the edge search line segments as central axis segments and a preset width.
[0013] Optionally, before determining multiple continuous edge search segments of the engine's processing surface image, the method also includes: when the engine reaches a shooting position, acquiring an initial image of the processing surface; updating the pixel value of each pixel in the initial image to obtain an updated pixel value, wherein the updated pixel value is the product of the pixel value and a predetermined coefficient; adjusting the updated pixel value greater than 255 to 255 to obtain the processing surface image.
[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0015] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the described methods.
[0016] By applying the technical solution of the present application, a plurality of edge search line segments satisfying a condition in an image of a machining surface of an engine are first determined, wherein the condition is that a pixel value difference between two endpoints of a first line segment passing through the midpoint of the edge search line segment, being perpendicular to the edge search line segment and having the same distance from both endpoints to the edge search line segment is not less than a first pixel value; then, based on the plurality of edge search line segments, a plurality of corresponding regions of interest are determined and edge detection is performed on the plurality of regions of interest to obtain an initial contour including a plurality of initial coordinate points; finally, based on a preset edge distance, the position of the initial coordinate point is updated to obtain a final contour including a plurality of final coordinates. The present application first identifies multiple continuous edge search segments in the engine's processing surface image, where the edge search segments are pixel gradient boundary segments of the processing surface image, and then determines the regions of interest corresponding to the multiple edge search segments one by one, and then performs edge detection on the multiple regions of interest to obtain an initial contour, thereby achieving high-precision segmentation and precise positioning of the processing surface edge area; and then, according to a preset edge distance, the initial contour is expanded or shrunk to avoid the influence of complex background noise at the edge of the processing surface on the contour detection, thereby ensuring that the final contour is relatively accurate, and solving the problem of inaccurate edge detection of the engine processing surface in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A hardware structure block diagram of a mobile terminal for executing a method for detecting a machining surface of an engine provided in an embodiment of the present application is shown;
[0019] Figure 2 A schematic flow chart of a method for detecting a machining surface of an engine provided according to an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram of a detection process of an engine machining surface provided according to an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram of a specific process of edge detection provided according to an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram of a process for extracting a target edge contour coordinate array according to an embodiment of the present application is shown;
[0023] Figure 6 A schematic diagram of the position structure of two consecutive adjacent edge search line segments provided according to an embodiment of the present application is shown;
[0024] Figure 7 A schematic diagram of a process for extracting a new scanning curve coordinate array according to an embodiment of the present application is shown;
[0025] Figure 8 A schematic diagram of determining a final coordinate point from an initial coordinate point according to an embodiment of the present application is shown;
[0026] Fig. 9 A schematic diagram of a defect detection process provided according to an embodiment of the present application is shown;
[0027] Fig.10 A schematic diagram of the structure of a spot provided according to an embodiment of the present application is shown;
[0028] Fig.11 A structural block diagram of a detection device for an engine processing surface provided according to an embodiment of the present application is shown.
[0029] The drawings include the following reference numerals:
[0030] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0031] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the accompanying drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] As introduced in the background technology, the edge detection of the engine processing surface in the prior art is inaccurate. To solve the above technical problems, the embodiments of the present application provide a method for detecting the engine processing surface, a computer-readable storage medium and an electronic device.
[0035] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0036] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal for detecting a method for machining a surface of an engine according to an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0037] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the detection method of the engine processing surface in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the method described is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0038] In this embodiment, a method for detecting an engine machining surface that runs on a mobile terminal, a computer terminal, or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0039] Figure 2 FIG. 1 is a flow chart of a method for detecting an engine machining surface according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0040] Step S201, determining a plurality of continuous edge search line segments of the image of the machining surface of the engine, each of the edge search line segments satisfying: a pixel value difference between two endpoints of a first line segment corresponding to the edge search line segment is not less than a first pixel value, the first line segment is a line segment passing through the midpoint of the corresponding edge search line segment, being perpendicular to the edge search line segment, and having the same distance from the two endpoints to the edge search line segment;
[0041] Specifically, the processing surface can be the processing surface of the cylinder block of the engine, the processing surface of the engine housing, or the processing surface of other processing parts of the engine. Since the pixel values inside and outside the processing surface contour are relatively different, when the pixel value difference between the two end points of the first line segment is not less than the first pixel value, it means that the two end points of the first line segment are respectively located inside and outside the contour, and the edge search line segment corresponding to the first line segment is relatively close to the actual contour of the processing surface.
[0042] Step S202, determining a plurality of regions of interest of the processing surface image according to the plurality of edge search line segments, and performing edge detection on the plurality of regions of interest to obtain an initial contour of the processing surface of the engine, wherein the regions of interest correspond to the edge search line segments one by one, the edge search line segments are located in the regions of interest, and the initial contour includes a plurality of initial coordinate points that are sequentially adjacent;
[0043] Specifically, the plurality of edge search line segments are adjacent to each other in sequence, the plurality of regions of interest determined according to the plurality of edge search line segments are also adjacent to each other in sequence, and two adjacent regions of interest may partially overlap.
[0044] Step S203: Update the initial contour according to the preset edge distance to obtain a final contour, wherein the final contour includes a plurality of final coordinate points adjacent to each other in sequence, wherein the final coordinate points correspond to the initial coordinate points one by one, the second line segment is perpendicular to the third line segment, the length of the second line segment is the edge distance, the second line segment is a line segment formed by the initial coordinate point and the corresponding final coordinate point, and the third line segment is a line segment formed by the initial coordinate point and another adjacent initial coordinate point.
[0045] Specifically, the second line segment and the third line segment form a right triangle. After obtaining the initial coordinate point, the initial coordinate point is moved along a direction perpendicular to the line segment formed by the initial coordinate point and the adjacent initial coordinate point (ie, the direction where the third line segment is located) to obtain the final coordinate point.
[0046] Through the embodiment, first determine multiple edge search segments that meet the conditions in the image of the processing surface of the engine, and the condition is: the pixel value difference between the two endpoints of the first segment that passes through the midpoint of the edge search segment, is perpendicular to the edge search segment, and has the same distance from the two endpoints to the edge search segment is not less than the first pixel value; then determine the corresponding multiple regions of interest according to the multiple edge search segments and perform edge detection on the multiple regions of interest to obtain an initial contour including multiple initial coordinate points; finally, update the position of the initial coordinate point according to the preset edge distance to obtain a final contour including multiple final coordinates. The present application first identifies multiple continuous edge search segments in the image of the processing surface of the engine, the edge search segment is a pixel gradient boundary segment of the processing surface image, then determines the regions of interest corresponding to the multiple edge search segments, and then performs edge detection on the multiple regions of interest to obtain an initial contour, thereby achieving high-precision segmentation and precise positioning of the edge area of the processing surface; then, according to the preset edge distance, the initial contour is expanded or contracted, which can avoid the influence of complex background noise at the edge of the processing surface on the contour detection, ensure that the final contour is more accurate, and solve the problem of inaccurate edge detection of the engine processing surface in the prior art.
[0047] In an optional solution, step S201: determining a plurality of continuous edge search line segments of the engine processing surface image includes:
[0048] Step S2011: determining the first edge search line segment from the processing surface image;
[0049] Step S2012: determining the end point of the i+1th initial search line segment according to the line segment parameters of the i-th edge search line segment, wherein the starting point of the i+1th initial search line segment is the end point of the i-th edge search line segment, the i-th edge search line segment and the i+1th initial search line segment have the same line segment parameters, the line segment parameters include line segment length and line segment angle, the line segment angle is the angle between the line segment and a predetermined axis of the image coordinate system of the processing surface image, i≥1 and i is an integer;
[0050] Specifically, the predetermined axis may be an X axis, a Y axis or a Z axis of the image coordinate system. The i-th edge search line segment and the i+1-th initial search line segment are located on the same straight line.
[0051] Step S2013: fitting a fourth line segment corresponding to the i+1th initial search line segment according to the i+1th initial search line segment, wherein the fourth line segment is a line segment passing through the midpoint of the corresponding i+1th initial search line segment, being perpendicular to the i+1th initial search line segment, having a preset length, and having the same distances between the two endpoints and the i+1th initial search line segment;
[0052] Step S2014: determining the i+1th edge search line segment at least according to the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, and obtaining a plurality of edge search line segments.
[0053] Specifically, the second edge search line segment, the third edge search line segment, ... are determined in sequence by cyclically executing step S2012, step S2013 and step S2014 until a set number of edge search line segments are obtained.
[0054] In the embodiment, the first edge search line segment is first determined from the processing surface image, and then the i+1th initial search line segment is determined based on the i-th edge search line segment and fitted to obtain a fourth line segment that passes through the midpoint of the i+1th initial search line segment, is perpendicular to the i+1th initial search line segment, and has the same distance from both endpoints to the i+1th initial search line segment. The i+1th edge search line segment is determined based on the pixel value difference between the two endpoints of the fourth line segment, thereby obtaining multiple edge search line segments, and subsequently obtaining multiple regions of interest based on these edge search line segments, thereby achieving segmentation and positioning of the region where the contour of the processing surface is located, facilitating the subsequent extraction of accurate processing surface contours from these regions of interest, and further achieving recognition of complex curve contours of the engine.
[0055] In order to further ensure that the obtained edge search line segment is more accurate, further, step S2014: determining the i+1th edge search line segment according to at least the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, and obtaining multiple edge search line segments, including:
[0056] A first determination step is to determine whether a pixel value difference between two endpoints of the fourth line segment corresponding to the (i+1)th initial search line segment is less than the first pixel value;
[0057] A rotation step, when the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is less than the first pixel value, the starting point of the i+1th initial search line segment is used as the rotation point, and the i+1th initial search line segment is rotated until the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment after rotation is not less than the first pixel value, thereby obtaining the i+1th edge search line segment, and when the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is not less than the first pixel value, the i+1th edge search line segment is obtained as the i+1th initial search line segment;
[0058] Specifically, when the pixel value difference between the two endpoints of the fourth line segment is less than the first pixel value, it means that the two endpoints of the fourth line segment are not on both sides of the machining surface contour line. At this time, the distance between the i+1th initial search line segment and the machining surface contour line is far, and the end point of the i+1th initial search line segment needs to be re-determined. The i+1th initial search line segment can be rotated in a direction with equal steps according to a predetermined rotation step length, or the i+1th initial search line segment can be rotated in a non-equal step length manner. When the pixel value difference between the two endpoints of the fourth line segment is not less than the first pixel value, the i+1th initial search line segment corresponding to the fourth line segment is determined to be the i+1th edge search line segment, and the fourth line segment is also the first line segment.
[0059] The second determination step determines whether the number of the edge search line segments obtained reaches a predetermined number. If the number does not reach the predetermined number, the first determination step and the rotation step are executed in a loop until the number reaches the predetermined number, thereby obtaining the predetermined number of edge search line segments.
[0060] In the embodiment, it is first determined whether the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is less than the first pixel value. If not, the i+1th initial search line segment is rotated with the starting point of the i+1th initial search line segment as the rotation point until the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment after rotation is not less than the first pixel value, and the i+1th initial search line segment after rotation is determined to be the i+1th edge search line segment. By repeatedly executing the process, a predetermined number of edge search line segments are obtained, which further ensures that each edge search line segment is close to the actual contour line of the processing surface.
[0061] In addition, before step S2011: determining the first edge search line segment from the processing surface image, the method further includes: identifying the body information of the engine, and determining the engine model of the engine according to the body information; and determining the image template corresponding to the engine model. The body information may be the QR code information on the engine body, the serial number information, or other information representing the engine model.
[0062] On this basis, step S2011: determining the first edge search line segment from the processing surface image, including: according to the image template, using the template matching algorithm to process the processing surface image to determine the starting search position from the processing surface image, and obtain the starting point of the first edge search line segment; according to the line segment parameters and the starting search position, determining the target search position, and obtaining the end point of the first edge search line segment, the distance between the target search position and the starting search position is the line segment length, and the angle between the line connecting the target search position and the starting search position and the predetermined axis is the line segment angle.
[0063] In the embodiment of the present application, the image template corresponding to the processing surface image is automatically switched according to the identified engine model, and the processing surface image is processed by the template matching algorithm of the corresponding image template to obtain the starting search position, and then according to the preset line segment length and line segment angle, line segment fitting is started from the starting search position to obtain the end point of the first edge search line segment, thereby obtaining the first edge search line segment, and the first edge search line segment can be accurately obtained from the current processing surface image.
[0064] Among them, this application is mainly a 2D black and white industrial camera, which is used in conjunction with an ordinary FA lens to take pictures, and collects the processed surface image into an industrial computer. The industrial computer automatically switches to the corresponding detection program based on the acquired engine QR code, and autonomously calls the image template of this application for detection.
[0065] A person skilled in the art may select any suitable method to fit the corresponding fourth line segment according to the i+1th initial search line segment. In order to obtain the fourth line segment simply, quickly and accurately, in an exemplary embodiment, step S2013: fitting the fourth line segment corresponding to the i+1th initial search line segment according to the i+1th initial search line segment, including: calculating the midpoint coordinates of the i+1th initial search line segment according to the coordinates of the two endpoints of the i+1th initial search line segment; rotating the i+1th initial search line segment by 90° along a predetermined direction with the midpoint of the i+1th initial search line segment as the rotation point, and determining the coordinates of the two endpoints of the fourth line segment on the straight line where the i+1th initial search line segment is located after the rotation according to the preset length, and the predetermined direction is clockwise or counterclockwise. In this embodiment, the midpoint coordinates of the i+1th initial search line segment are first determined, and then the i+1th initial search line segment is rotated 90° along the midpoint coordinates, and then two endpoints are determined from the straight line where the rotated i+1th initial search line segment is located according to a preset length, to obtain a fourth line segment that passes through the corresponding midpoint of the i+1th initial search line segment, is perpendicular to the i+1th initial search line segment, has a preset length, and has the same distance from both endpoints to the i+1th initial search line segment.
[0066] Optionally, after the initial contour is updated according to a preset edge distance to obtain a final contour, the method further includes: segmenting the area enclosed by the final contour along the final contour to obtain a plurality of sub-regions; and performing defect detection on the plurality of sub-regions to determine whether the processed surface is qualified. After obtaining the contour line of the processed surface, the present application performs defect detection on the area enclosed by the contour line, thereby realizing automatic detection of the engine processing surface and freeing up manpower.
[0067] Specifically, defect detection is performed on multiple sub-regions to determine whether the machining surface is qualified, including: determining the grayscale difference of multiple sub-regions, wherein the grayscale difference represents the change of the pixel value of the sub-region; determining whether there are abnormal sub-regions in the multiple sub-regions according to the multiple grayscale differences, wherein the sub-region whose grayscale difference is greater than the second pixel value is the abnormal sub-region; in the case that there are abnormal sub-regions in the multiple sub-regions, detecting the spot position in the abnormal sub-region, and calculating the aspect ratio of the spot according to the spot position; determining the type of the spot and the corresponding number of spots of each type according to the aspect ratio, wherein the type includes at least one of the following: cracks, sand holes; determining whether the machining surface of the engine is qualified according to the type and the corresponding number of each type. In this embodiment, the spot position and number are first determined from each sub-region, and then the type and corresponding number of spots are determined according to the spot aspect ratio, so as to determine whether the machining surface of the engine is qualified, thereby realizing efficient, accurate and flexible detection of machining surface defects.
[0068] Those skilled in the art may select any appropriate method to detect the spot position in the abnormal sub-region, such as using a neural network model to analyze the image of each abnormal sub-region, etc. This application will not be elaborated in detail here.
[0069] According to some further optional embodiments of the present application, step S203: updating the initial contour according to a preset edge distance to obtain a final contour includes:
[0070] Step S2031: extracting two adjacent initial coordinate points from the initial contour along a predetermined direction to obtain the jth initial coordinate point and the j+1th initial coordinate point, wherein the predetermined direction is a clockwise direction or a counterclockwise direction, and j≥1 is an integer;
[0071] Step S2032: fitting the jth initial coordinate point and the j+1th initial coordinate point to obtain the third line segment with the starting point being the jth initial coordinate point and the end point being the j+1th initial coordinate point;
[0072] Step S2033: acquiring the angle of the third line segment, and determining the target angle as the sum of the angle of the third line segment and 90° according to the angle of the third line segment, wherein the angle of the third line segment is the angle between the third line segment and a predetermined axis of the image coordinate system of the processing surface image;
[0073] Step S2034: According to the target angle, the jth initial coordinate point and the edge distance, determine the end point coordinates of the line segment with the jth initial coordinate point as the starting point, the length of the edge distance, the angle with the predetermined axis as the target angle, and the direction from the starting point to the end point pointing to the inside of the initial contour, and obtain the final coordinate point corresponding to the jth initial coordinate point.
[0074] In the described embodiment, taking into account the complex background noise at the edge of the target, the present application has developed an algorithm for secondary generation of the scanning curve. According to the preset edge distance, the initial contour of the determined processing surface is shrunk to obtain the final contour, thereby further eliminating the interference of background noise on contour detection, and further ensuring that the contour line of the processing surface can be obtained more accurately.
[0075] Specifically, according to the plurality of edge search segments, a plurality of regions of interest of the processing surface image are determined, including: according to the edge search segment, the corresponding region of interest is determined to be a rectangular region with the edge search segment as the central axis segment and a preset width. Since the edge search segment is relatively close to the actual contour line, the edge search segment is used as the central axis segment of the region of interest, and a plurality of regions of interest are obtained from the entire processing surface image, which not only further narrows the scope of edge detection, but also further ensures that the plurality of regions of interest can frame the actual contour line, so that a more accurate contour line can be obtained from a smaller area.
[0076] In order to further improve the contrast and clarity of the processed surface image and facilitate the subsequent accurate determination of the contour of the processed surface, in some other embodiments, before determining multiple continuous edge search segments of the processed surface image of the engine, the method also includes: when the engine reaches the shooting position, obtaining the initial image of the processed surface; updating the pixel value of each pixel in the initial image to obtain an updated pixel value, wherein the updated pixel value is the product of the pixel value and a predetermined coefficient; adjusting the updated pixel value greater than 255 to 255 to obtain the processed surface image.
[0077] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the engine processing surface detection method of the present application will be described in detail below in combination with specific embodiments.
[0078] This embodiment relates to a specific method for detecting an engine machining surface, such as Figure 3 As shown, the following steps are included:
[0079] Step S1: Obtain the engine body number of the engine to be tested;
[0080] Step S2: Switch to the graphics processing program corresponding to the machine body number;
[0081] Step S3: The camera enters the photo taking position to take a photo, and the image is preprocessed. The grayscale stretching formula of the image is as follows: the grayscale value of the new pixel G (the grayscale value after image processing) = G1 (the grayscale value of the original single pixel) × constant A (the constant coefficient set artificially). When the grayscale value G>255, G is set to 255 to improve the image contrast;
[0082] Step S4: locate the detection target, set the ROI search box, lock its position, perform image cutting, and reduce background interference;
[0083] Step S5: Perform size measurement, edge detection, AI (Artificial Intelligence) classification and other algorithm detection on the target in the image, and upload the detection results to MES (Manufacturing Execution System) and send them to PLC (Programmable Logic Controller).
[0084] Specifically, the specific process of edge detection in step S5 is as follows: Figure 4 As shown, the following steps are included:
[0085] Step S51: extracting the detection target edge contour coordinate array []X[]Y;
[0086] Step S52: Since there are many interferences on the target edge, in order to avoid these interferences, the distance H1 from the new curve to the edge is set, and the edge contour coordinate array []X[]Y is processed according to H1 to recalculate the new scanning curve coordinate array []X2[]Y2;
[0087] Step S53: According to the new scanning curve coordinate array []X2[]Y2, set the ROI (Region of Interest) square detection area, cut out the ROI square detection area along the new scanning curve to obtain the detection area, analyze the image defects in the detection area, and output the defect type and quantity.
[0088] Specifically, the specific process of step S51 is as follows: Figure 5 As shown, the following steps are included:
[0089] Use template matching to lock the detection target, set the edge search starting position, set the ROI search area and edge pixel gradient value, and perform line segment search fitting, such as Figure 6 As shown, the edge search segment AB is fitted, the starting coordinates A(x1,y1) and the end coordinates B(x2,y2) of the segment are obtained, the angle of the edge search segment AB is obtained, and the length of the edge search segment AB is calculated:
[0090] ;
[0091] Set the end point B as the starting point of the next edge search line segment, and calculate the coordinates C(x3, y3) using the length d and angle a1 of the edge search line segment AB. , calculate the midpoint E(x4, y4) of the line segment BC, rotate it 90º clockwise with point E as the intersection point, and fit the line segment ED using the set length of the line segment ED to obtain the point D(x5, y5). Similarly, calculate the symmetric point F of the point D(x5, y5), calculate the gray values of the regions centered at point D and point F, Gd (gray value of the region centered at point D) and Gf (gray value of the region centered at point F), calculate the gray value difference G1 (gray value difference) = Gd - Gf. When G1 < 15 (15 is the edge pixel gradient value mentioned above), it indicates that this is a corner (i.e., Figure 6 as shown, D is located in the light area and F is located in the dark area), at this time, recalculate the line segment angle a2 = a2 + 5 in sequence and re-search and calculate the new edge search line segment. If a2 > 360, stop scanning and extract the contour coordinate data. When G1 ≥ 15, fit a new edge search line segment, and extract the line segment coordinate arrays []X[]Y according to the edge search line segment. Calculate the line segment fitting times n = n + 1. When n < N (the upper limit value of the set fitting times), enter the next loop. When n > N (the upper limit value of the set fitting times),汇总各线段数组生成边缘轮廓数组[]X[]Y。
[0092] Specifically, the specific process of step S52 is as Figure 7 shown, including the following steps:
[0093] Extract two consecutive adjacent points in the contour coordinate arrays []X[]Y in sequence, as Figure 8 shown, calculate and fit the line segment A'B' (the line segment formed by two adjacent initial coordinate points), obtain the angle a1' of the line segment A'B', rotate the line segment A'B' 90 degrees clockwise to get the angle a2' of the line segment A'D' (angle of the line segment A'D') = a1' + 90. Use the set distance H1 from the curve to the edge (the distance from the newly set scanning curve to the edge of the detection target), calculate and fit the line segment A'D', and obtain the new coordinate D'(x1, y1), that is, the final coordinate point corresponding to the initial coordinate point A'. Calculate the contour coordinate arrays []X[]Y in this way in sequence, and the new scanning curve coordinate arrays []X2[]Y2 can be obtained.
[0094] Specifically, the specific process of step S53 is as Fig. 9 shown, including the following steps:
[0095] It should be noted that there is an unclear expression "汇总各线段数组生成边缘轮廓数组[]X[]Y" in the original text, and the translation is tentatively processed as "汇总各线段数组生成边缘轮廓数组[]X[]Y". You may need to check and correct it according to the actual situation.Scan and analyze all pixel areas in the image with a grayscale difference of more than 15 as abnormal areas, and extract the position coordinates of this abnormal area. Use this coordinate to locate and use the spot counting tool to calculate and analyze the number of spots in this area, and then analyze and calculate the aspect ratio of all spots k (the aspect ratio of the spots) = h / l (such as Fig.10 As shown in the figure), the aspect ratio k is used to analyze whether there are cracks and sand holes. Since the sand hole feature has weak anti-interference ability, if sand holes exist, more accurate template matching is required to further confirm the number of sand holes.
[0096] The embodiment described in the present application develops a defect detection method suitable for complex curve contours of engines. This algorithm can freely set the density, number, and scanning range of the segmented scans, improve the accuracy of contour coordinate extraction, make the curve smoother, and flexibly control the number and length of scans, improve the flexibility of use, and can be used in various complex scenes; the present application has the function of secondary generation of new scan curves, which can effectively avoid the interference of complex target edges and improve the anti-interference ability of detection; by locating the target to be detected and taking into account the characteristics of the target feature as a special-shaped curve, an edge coordinate extraction algorithm is developed, which can be applied to the contour extraction of complex curves, and the search density, search number, search area and other parameters are opened for flexible use of this algorithm tool; considering that there are more complex background noises at the edge of the target, an algorithm for secondary generation of scan curves is developed, and the distance from the curve to the edge is opened, and the relative position of the new curve to the edge can be flexibly set; in order to cooperate with the defect detection of small-range images, a special defect detection method is developed, which uses a gradient detection method from rough to precise using tools such as straight line search, spot calculation, template matching, etc., to efficiently, accurately and flexibly realize the defect detection of cracks and sand holes.
[0097] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0098] The embodiment of the present application also provides a detection device for an engine processing surface. It should be noted that the detection device for an engine processing surface of the embodiment of the present application can be used to execute the detection method for an engine processing surface provided in the embodiment of the present application. The device is used to implement the embodiments and preferred implementations, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0099] The following is an introduction to the engine processing surface detection device provided in the embodiment of the present application.
[0100] Fig.11 Schematic diagram of a detection device for an engine processing surface according to an embodiment of the present application. Fig.11 As shown, the device comprises:
[0101] A first determining unit 10 is used to determine a plurality of continuous edge search line segments of the image of the machining surface of the engine, each of which satisfies: a pixel value difference between two endpoints of a first line segment corresponding to the edge search line segment is not less than a first pixel value, and the first line segment is a line segment passing through the midpoint of the corresponding edge search line segment, being perpendicular to the edge search line segment, and having the same distance from the two endpoints to the edge search line segment;
[0102] Specifically, the processing surface can be the processing surface of the cylinder block of the engine, the processing surface of the engine housing, or the processing surface of other processing parts of the engine. Since the pixel values inside and outside the processing surface contour are relatively different, when the pixel value difference between the two end points of the first line segment is not less than the first pixel value, it means that the two end points of the first line segment are respectively located inside and outside the contour, and the edge search line segment corresponding to the first line segment is relatively close to the actual contour of the processing surface.
[0103] A second determining unit 20 is used to determine a plurality of regions of interest of the processing surface image according to the plurality of edge search line segments, and perform edge detection on the plurality of regions of interest to obtain an initial contour of the processing surface of the engine, wherein the regions of interest correspond to the edge search line segments one by one, the edge search line segments are located in the regions of interest, and the initial contour includes a plurality of initial coordinate points that are sequentially adjacent;
[0104] Specifically, the plurality of edge search line segments are adjacent to each other in sequence, the plurality of regions of interest determined according to the plurality of edge search line segments are also adjacent to each other in sequence, and two adjacent regions of interest may partially overlap.
[0105] The updating unit 30 is used to update the initial contour according to a preset edge distance to obtain a final contour, wherein the final contour includes a plurality of final coordinate points adjacent to each other in sequence, the final coordinate points correspond to the initial coordinate points one by one, the second line segment is perpendicular to the third line segment, the length of the second line segment is the edge distance, the second line segment is a line segment formed by the initial coordinate point and the corresponding final coordinate point, and the third line segment is a line segment formed by the initial coordinate point and another adjacent initial coordinate point.
[0106] Specifically, the second line segment and the third line segment form a right triangle. After obtaining the initial coordinate point, the initial coordinate point is moved along a direction perpendicular to the line segment formed by the initial coordinate point and the adjacent initial coordinate point (ie, the direction where the third line segment is located) to obtain the final coordinate point.
[0107] Through the embodiment, a first determination unit is used to determine a plurality of edge search line segments that meet a condition in an image of a machining surface of an engine, wherein the condition is that a pixel value difference between two endpoints of a first line segment that passes through a midpoint of the edge search line segment, is perpendicular to the edge search line segment, and has the same distance from both endpoints to the edge search line segment is not less than a first pixel value; a second determination unit is used to determine a plurality of corresponding regions of interest based on the plurality of edge search line segments and to perform edge detection on the plurality of regions of interest to obtain an initial contour including a plurality of initial coordinate points; and an updating unit is used to update the position of the initial coordinate point based on a preset edge distance to obtain a final contour including a plurality of final coordinates. The present application first identifies multiple continuous edge search segments in the engine's processing surface image, where the edge search segments are pixel gradient boundary segments of the processing surface image, and then determines the regions of interest corresponding to the multiple edge search segments one by one, and then performs edge detection on the multiple regions of interest to obtain an initial contour, thereby achieving high-precision segmentation and precise positioning of the processing surface edge area; and then, according to a preset edge distance, the initial contour is expanded or shrunk to avoid the influence of complex background noise at the edge of the processing surface on the contour detection, thereby ensuring that the final contour is relatively accurate, and solving the problem of inaccurate edge detection of the engine processing surface in the prior art.
[0108] The engine processing surface detection device includes a processor and a memory, the first determination unit, the second determination unit, and the update unit are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or the modules are located in different processors in any combination.
[0109] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be provided, and the problem of inaccurate edge detection of the engine processing surface in the prior art can be at least solved by adjusting kernel parameters.
[0110] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0111] An embodiment of the present application provides a computer-readable storage medium, which includes a stored program, wherein when the program is executed, a device where the computer-readable storage medium is located is controlled to execute the method for detecting the engine machining surface.
[0112] Specifically, the detection method of the engine processing surface includes:
[0113] Step S201, determining a plurality of continuous edge search line segments of the image of the machining surface of the engine, each of the edge search line segments satisfying: a pixel value difference between two endpoints of a first line segment corresponding to the edge search line segment is not less than a first pixel value, the first line segment is a line segment passing through the midpoint of the corresponding edge search line segment, being perpendicular to the edge search line segment, and having the same distance from the two endpoints to the edge search line segment;
[0114] Specifically, the processing surface can be the processing surface of the cylinder block of the engine, the processing surface of the engine housing, or the processing surface of other processing parts of the engine. Since the pixel values inside and outside the processing surface contour are relatively different, when the pixel value difference between the two end points of the first line segment is not less than the first pixel value, it means that the two end points of the first line segment are respectively located inside and outside the contour, and the edge search line segment corresponding to the first line segment is relatively close to the actual contour of the processing surface.
[0115] Step S202, determining a plurality of regions of interest of the processing surface image according to the plurality of edge search line segments, and performing edge detection on the plurality of regions of interest to obtain an initial contour of the processing surface of the engine, wherein the regions of interest correspond to the edge search line segments one by one, the edge search line segments are located in the regions of interest, and the initial contour includes a plurality of initial coordinate points that are sequentially adjacent;
[0116] Specifically, the plurality of edge search line segments are adjacent to each other in sequence, the plurality of regions of interest determined according to the plurality of edge search line segments are also adjacent to each other in sequence, and two adjacent regions of interest may partially overlap.
[0117] Step S203: Update the initial contour according to the preset edge distance to obtain a final contour, wherein the final contour includes a plurality of final coordinate points adjacent to each other in sequence, wherein the final coordinate points correspond to the initial coordinate points one by one, the second line segment is perpendicular to the third line segment, the length of the second line segment is the edge distance, the second line segment is a line segment formed by the initial coordinate point and the corresponding final coordinate point, and the third line segment is a line segment formed by the initial coordinate point and another adjacent initial coordinate point.
[0118] Specifically, the second line segment and the third line segment form a right triangle. After obtaining the initial coordinate point, the initial coordinate point is moved along a direction perpendicular to the line segment formed by the initial coordinate point and the adjacent initial coordinate point (ie, the direction where the third line segment is located) to obtain the final coordinate point.
[0119] An embodiment of the present application provides a processor, which is used to run a program, wherein the method for detecting the engine processing surface is executed when the program is run.
[0120] Specifically, the detection method of the engine processing surface includes:
[0121] Step S201, determining a plurality of continuous edge search line segments of the image of the machining surface of the engine, each of the edge search line segments satisfying: a pixel value difference between two endpoints of a first line segment corresponding to the edge search line segment is not less than a first pixel value, the first line segment is a line segment passing through the midpoint of the corresponding edge search line segment, being perpendicular to the edge search line segment, and having the same distance from the two endpoints to the edge search line segment;
[0122] Specifically, the processing surface can be the processing surface of the cylinder block of the engine, the processing surface of the engine housing, or the processing surface of other processing parts of the engine. Since the pixel values inside and outside the processing surface contour are relatively different, when the pixel value difference between the two end points of the first line segment is not less than the first pixel value, it means that the two end points of the first line segment are respectively located inside and outside the contour, and the edge search line segment corresponding to the first line segment is relatively close to the actual contour of the processing surface.
[0123] Step S202, determining a plurality of regions of interest of the processing surface image according to the plurality of edge search line segments, and performing edge detection on the plurality of regions of interest to obtain an initial contour of the processing surface of the engine, wherein the regions of interest correspond to the edge search line segments one by one, the edge search line segments are located in the regions of interest, and the initial contour includes a plurality of initial coordinate points that are sequentially adjacent;
[0124] Specifically, the plurality of edge search line segments are adjacent to each other in sequence, the plurality of regions of interest determined according to the plurality of edge search line segments are also adjacent to each other in sequence, and two adjacent regions of interest may partially overlap.
[0125] Step S203: Update the initial contour according to the preset edge distance to obtain a final contour, wherein the final contour includes a plurality of final coordinate points adjacent to each other in sequence, wherein the final coordinate points correspond to the initial coordinate points one by one, the second line segment is perpendicular to the third line segment, the length of the second line segment is the edge distance, the second line segment is a line segment formed by the initial coordinate point and the corresponding final coordinate point, and the third line segment is a line segment formed by the initial coordinate point and another adjacent initial coordinate point.
[0126] Specifically, the second line segment and the third line segment form a right triangle. After obtaining the initial coordinate point, the initial coordinate point is moved along a direction perpendicular to the line segment formed by the initial coordinate point and the adjacent initial coordinate point (ie, the direction where the third line segment is located) to obtain the final coordinate point.
[0127] An embodiment of the present application provides a device, the device including a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0128] Step S201, determining a plurality of continuous edge search line segments of the image of the machining surface of the engine, each of the edge search line segments satisfying: a pixel value difference between two endpoints of a first line segment corresponding to the edge search line segment is not less than a first pixel value, the first line segment is a line segment passing through the midpoint of the corresponding edge search line segment, being perpendicular to the edge search line segment, and having the same distance from the two endpoints to the edge search line segment;
[0129] Step S202, determining a plurality of regions of interest of the processing surface image according to the plurality of edge search line segments, and performing edge detection on the plurality of regions of interest to obtain an initial contour of the processing surface of the engine, wherein the regions of interest correspond to the edge search line segments one by one, the edge search line segments are located in the regions of interest, and the initial contour includes a plurality of initial coordinate points that are sequentially adjacent;
[0130] Step S203: Update the initial contour according to the preset edge distance to obtain a final contour, wherein the final contour includes a plurality of final coordinate points adjacent to each other in sequence, wherein the final coordinate points correspond to the initial coordinate points one by one, the second line segment is perpendicular to the third line segment, the length of the second line segment is the edge distance, the second line segment is a line segment formed by the initial coordinate point and the corresponding final coordinate point, and the third line segment is a line segment formed by the initial coordinate point and another adjacent initial coordinate point.
[0131] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0132] Optionally, determining a plurality of continuous edge search line segments of the engine processing surface image comprises: determining the first edge search line segment from the processing surface image; determining the end point of the i+1th initial search line segment according to the line segment parameters of the i-th edge search line segment, wherein the starting point of the i+1th initial search line segment is the end point of the i-th edge search line segment, the i-th edge search line segment and the i+1th initial search line segment have the same line segment parameters, the line segment parameters include line segment length and line segment angle, the line segment angle is the line segment and the predetermined axis of the image coordinate system of the processing surface image. , i≥1 and i is an integer; according to the i+1th initial search line segment, a fourth line segment corresponding to the i+1th initial search line segment is fitted, and the fourth line segment is a line segment passing through the midpoint of the corresponding i+1th initial search line segment, perpendicular to the i+1th initial search line segment, with a length of a preset length and the same distances from two endpoints to the i+1th initial search line segment; at least according to the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, the i+1th edge search line segment is determined to obtain a plurality of edge search line segments.
[0133] Optionally, the i+1th edge search line segment is determined at least according to the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, and a plurality of edge search line segments are obtained, including: a first determination step of determining whether the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is less than the first pixel value; a rotation step of rotating the i+1th initial search line segment with the starting point of the i+1th initial search line segment as the rotation point when the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is less than the first pixel value, until the i+1th initial search line segment after rotation is The pixel value difference between the two endpoints of the fourth line segment corresponding to the search line segment is not less than the first pixel value, and the i+1th edge search line segment is obtained. When the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is not less than the first pixel value, the i+1th edge search line segment is the i+1th initial search line segment; the second determination step is to determine whether the number of the obtained edge search line segments reaches a predetermined number. When the number does not reach the predetermined number, the first determination step and the rotation step are executed repeatedly until the number reaches the predetermined number, so as to obtain the predetermined number of edge search line segments.
[0134] Optionally, before determining the first edge search line segment from the processing surface image, the method also includes: identifying the body information of the engine, and determining the engine model of the engine based on the body information; determining the image template corresponding to the engine model; determining the first edge search line segment from the processing surface image, including: processing the processing surface image using a template matching algorithm based on the image template to determine a starting search position from the processing surface image to obtain the starting point of the first edge search line segment; determining a target search position based on the line segment parameters and the starting search position to obtain the end point of the first edge search line segment, the distance between the target search position and the starting search position being the line segment length, and the angle between the line connecting the target search position and the starting search position and the predetermined axis being the line segment angle.
[0135] Optionally, according to the i+1th initial search line segment, a fourth line segment corresponding to the i+1th initial search line segment is fitted, including: calculating the coordinates of the midpoint of the i+1th initial search line segment according to the coordinates of the two endpoints of the i+1th initial search line segment; rotating the i+1th initial search line segment 90° along a predetermined direction with the midpoint of the i+1th initial search line segment as the rotation point, and determining the coordinates of the two endpoints of the fourth line segment on the straight line where the i+1th initial search line segment is located after the rotation according to the preset length, and the predetermined direction is clockwise or counterclockwise.
[0136] Optionally, after updating the initial contour according to a preset edge distance to obtain a final contour, the method further includes: dividing the area enclosed by the final contour along the final contour to obtain multiple sub-regions; and performing defect detection on the multiple sub-regions to determine whether the processed surface is qualified.
[0137] Optionally, defect detection is performed on multiple sub-regions to determine whether the processed surface is qualified, including: determining the grayscale difference of the multiple sub-regions, the grayscale difference characterizing the change in the pixel value of the sub-region; determining whether there is an abnormal sub-region among the multiple sub-regions based on the multiple grayscale differences, wherein the sub-region where the grayscale difference is greater than the second pixel value is the abnormal sub-region; in the case where there is an abnormal sub-region among the multiple sub-regions, detecting the position of a spot in the abnormal sub-region, and calculating the aspect ratio of the spot based on the spot position; determining the type of the spot and the corresponding number of each type of spots based on the aspect ratio, the type including at least one of the following: cracks, sand holes; determining whether the processed surface of the engine is qualified based on the type and the corresponding number of each type.
[0138] Optionally, updating the initial contour according to a preset edge distance to obtain a final contour includes: extracting two adjacent initial coordinate points from the initial contour along a predetermined direction to obtain the jth initial coordinate point and the j+1th initial coordinate point, where the predetermined direction is a clockwise direction or a counterclockwise direction, and j≥1 is an integer; fitting the jth initial coordinate point and the j+1th initial coordinate point to obtain the third line segment with a starting point being the jth initial coordinate point and an end point being the j+1th initial coordinate point; and obtaining the angle of the third line segment. And according to the angle of the third line segment, determine the target angle as the sum of the angle of the third line segment and 90°, and the angle of the third line segment is the angle between the third line segment and the predetermined axis of the image coordinate system of the processing surface image; according to the target angle, the jth initial coordinate point and the edge distance, determine the end point coordinates of the line segment with the jth initial coordinate point as the starting point, the length as the edge distance, the angle with the predetermined axis as the target angle, and the direction from the starting point to the end point pointing to the inside of the initial contour, and obtain the final coordinate point corresponding to the jth initial coordinate point.
[0139] Optionally, determining multiple regions of interest of the processing surface image based on the multiple edge search line segments includes: determining, based on the edge search line segments, that the corresponding regions of interest are rectangular regions with the edge search line segments as central axis segments and a preset width.
[0140] Optionally, before determining multiple continuous edge search segments of the engine's processing surface image, the method also includes: when the engine reaches a shooting position, acquiring an initial image of the processing surface; updating the pixel value of each pixel in the initial image to obtain an updated pixel value, wherein the updated pixel value is the product of the pixel value and a predetermined coefficient; adjusting the updated pixel value greater than 255 to 255 to obtain the processing surface image.
[0141] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement at least the following method steps:
[0142] Step S201, determining a plurality of continuous edge search line segments of the image of the machining surface of the engine, each of the edge search line segments satisfying: a pixel value difference between two endpoints of a first line segment corresponding to the edge search line segment is not less than a first pixel value, the first line segment is a line segment passing through the midpoint of the corresponding edge search line segment, being perpendicular to the edge search line segment, and having the same distance from the two endpoints to the edge search line segment;
[0143] Step S202, determining a plurality of regions of interest of the processing surface image according to the plurality of edge search line segments, and performing edge detection on the plurality of regions of interest to obtain an initial contour of the processing surface of the engine, wherein the regions of interest correspond to the edge search line segments one by one, the edge search line segments are located in the regions of interest, and the initial contour includes a plurality of initial coordinate points that are sequentially adjacent;
[0144] Step S203: Update the initial contour according to the preset edge distance to obtain a final contour, wherein the final contour includes a plurality of final coordinate points adjacent to each other in sequence, wherein the final coordinate points correspond to the initial coordinate points one by one, the second line segment is perpendicular to the third line segment, the length of the second line segment is the edge distance, the second line segment is a line segment formed by the initial coordinate point and the corresponding final coordinate point, and the third line segment is a line segment formed by the initial coordinate point and another adjacent initial coordinate point.
[0145] Optionally, determining a plurality of continuous edge search line segments of the engine processing surface image comprises: determining the first edge search line segment from the processing surface image; determining the end point of the i+1th initial search line segment according to the line segment parameters of the i-th edge search line segment, wherein the starting point of the i+1th initial search line segment is the end point of the i-th edge search line segment, the i-th edge search line segment and the i+1th initial search line segment have the same line segment parameters, the line segment parameters include line segment length and line segment angle, the line segment angle is the line segment and the predetermined axis of the image coordinate system of the processing surface image. , i≥1 and i is an integer; according to the i+1th initial search line segment, a fourth line segment corresponding to the i+1th initial search line segment is fitted, and the fourth line segment is a line segment passing through the midpoint of the corresponding i+1th initial search line segment, perpendicular to the i+1th initial search line segment, with a length of a preset length and the same distances from two endpoints to the i+1th initial search line segment; at least according to the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, the i+1th edge search line segment is determined to obtain a plurality of edge search line segments.
[0146] Optionally, the i+1th edge search line segment is determined at least according to the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, and a plurality of edge search line segments are obtained, including: a first determination step of determining whether the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is less than the first pixel value; a rotation step of rotating the i+1th initial search line segment with the starting point of the i+1th initial search line segment as the rotation point when the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is less than the first pixel value, until the i+1th initial search line segment after rotation is The pixel value difference between the two endpoints of the fourth line segment corresponding to the search line segment is not less than the first pixel value, and the i+1th edge search line segment is obtained. When the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is not less than the first pixel value, the i+1th edge search line segment is the i+1th initial search line segment; the second determination step is to determine whether the number of the obtained edge search line segments reaches a predetermined number. When the number does not reach the predetermined number, the first determination step and the rotation step are executed repeatedly until the number reaches the predetermined number, so as to obtain the predetermined number of edge search line segments.
[0147] Optionally, before determining the first edge search line segment from the processing surface image, the method also includes: identifying the body information of the engine, and determining the engine model of the engine based on the body information; determining the image template corresponding to the engine model; determining the first edge search line segment from the processing surface image, including: processing the processing surface image using a template matching algorithm based on the image template to determine a starting search position from the processing surface image to obtain the starting point of the first edge search line segment; determining a target search position based on the line segment parameters and the starting search position to obtain the end point of the first edge search line segment, the distance between the target search position and the starting search position being the line segment length, and the angle between the line connecting the target search position and the starting search position and the predetermined axis being the line segment angle.
[0148] Optionally, according to the i+1th initial search line segment, a fourth line segment corresponding to the i+1th initial search line segment is fitted, including: calculating the coordinates of the midpoint of the i+1th initial search line segment according to the coordinates of the two endpoints of the i+1th initial search line segment; rotating the i+1th initial search line segment 90° along a predetermined direction with the midpoint of the i+1th initial search line segment as the rotation point, and determining the coordinates of the two endpoints of the fourth line segment on the straight line where the i+1th initial search line segment is located after the rotation according to the preset length, and the predetermined direction is clockwise or counterclockwise.
[0149] Optionally, after updating the initial contour according to a preset edge distance to obtain a final contour, the method further includes: dividing the area enclosed by the final contour along the final contour to obtain multiple sub-regions; and performing defect detection on the multiple sub-regions to determine whether the processed surface is qualified.
[0150] Optionally, defect detection is performed on multiple sub-regions to determine whether the processed surface is qualified, including: determining the grayscale difference of the multiple sub-regions, the grayscale difference characterizing the change in the pixel value of the sub-region; determining whether there is an abnormal sub-region among the multiple sub-regions based on the multiple grayscale differences, wherein the sub-region where the grayscale difference is greater than the second pixel value is the abnormal sub-region; in the case where there is an abnormal sub-region among the multiple sub-regions, detecting the position of a spot in the abnormal sub-region, and calculating the aspect ratio of the spot based on the spot position; determining the type of the spot and the corresponding number of each type of spots based on the aspect ratio, the type including at least one of the following: cracks, sand holes; determining whether the processed surface of the engine is qualified based on the type and the corresponding number of each type.
[0151] Optionally, updating the initial contour according to a preset edge distance to obtain a final contour includes: extracting two adjacent initial coordinate points from the initial contour along a predetermined direction to obtain the jth initial coordinate point and the j+1th initial coordinate point, where the predetermined direction is a clockwise direction or a counterclockwise direction, and j≥1 is an integer; fitting the jth initial coordinate point and the j+1th initial coordinate point to obtain the third line segment with a starting point being the jth initial coordinate point and an end point being the j+1th initial coordinate point; and obtaining the angle of the third line segment. And according to the angle of the third line segment, determine the target angle as the sum of the angle of the third line segment and 90°, and the angle of the third line segment is the angle between the third line segment and the predetermined axis of the image coordinate system of the processing surface image; according to the target angle, the jth initial coordinate point and the edge distance, determine the end point coordinates of the line segment with the jth initial coordinate point as the starting point, the length as the edge distance, the angle with the predetermined axis as the target angle, and the direction from the starting point to the end point pointing to the inside of the initial contour, and obtain the final coordinate point corresponding to the jth initial coordinate point.
[0152] Optionally, determining multiple regions of interest of the processing surface image based on the multiple edge search line segments includes: determining, based on the edge search line segments, that the corresponding regions of interest are rectangular regions with the edge search line segments as central axis segments and a preset width.
[0153] Optionally, before determining multiple continuous edge search segments of the engine's processing surface image, the method also includes: when the engine reaches a shooting position, acquiring an initial image of the processing surface; updating the pixel value of each pixel in the initial image to obtain an updated pixel value, wherein the updated pixel value is the product of the pixel value and a predetermined coefficient; adjusting the updated pixel value greater than 255 to 255 to obtain the processing surface image.
[0154] Obviously, those skilled in the art should understand that the modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, 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, and in some cases, the steps shown or described can be executed in a different order than here, 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. Thus, the present application is not limited to any specific combination of hardware and software.
[0155] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0156] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0157] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0158] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0159] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0160] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0161] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0162] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0163] 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.
Claims
1. A method for detecting an engine machining surface, characterized in that: include: Determine a plurality of continuous edge search line segments of the image of the machining surface of the engine, each of the edge search line segments satisfying: a pixel value difference between two endpoints of a first line segment corresponding to the edge search line segment is not less than a first pixel value, the first line segment is a line segment passing through the midpoint of the corresponding edge search line segment, being perpendicular to the edge search line segment, and having the same distance from the two endpoints to the edge search line segment; According to the plurality of edge search line segments, a plurality of regions of interest of the processing surface image are determined, and edge detection is performed on the plurality of regions of interest to obtain an initial contour of the processing surface of the engine, wherein the regions of interest correspond to the edge search line segments one by one, the edge search line segments are located in the regions of interest, and the initial contour includes a plurality of initial coordinate points that are sequentially adjacent to each other; According to the preset edge distance, the initial contour is updated to obtain a final contour, wherein the final contour includes a plurality of final coordinate points that are adjacent in sequence, the final coordinate points correspond to the initial coordinate points one by one, the second line segment is perpendicular to the third line segment, the length of the second line segment is the edge distance, the second line segment is a line segment formed by the initial coordinate point and the corresponding final coordinate point, and the third line segment is a line segment formed by the initial coordinate point and another adjacent initial coordinate point. Determine a plurality of continuous edge search line segments of the engine machining surface image, including: Determining the first edge search line segment from the processing surface image; Determine the end point of the i+1th initial search line segment according to the line segment parameters of the i-th edge search line segment, wherein the starting point of the i+1th initial search line segment is the end point of the i-th edge search line segment, the i-th edge search line segment and the i+1th initial search line segment have the same line segment parameters, the line segment parameters include line segment length and line segment angle, the line segment angle is the angle between the line segment and a predetermined axis of the image coordinate system of the processing surface image, i≥1 and i is an integer; According to the i+1th initial search line segment, a fourth line segment corresponding to the i+1th initial search line segment is fitted, wherein the fourth line segment is a line segment passing through the midpoint of the corresponding i+1th initial search line segment, being perpendicular to the i+1th initial search line segment, having a preset length, and having the same distances from two endpoints to the i+1th initial search line segment; Determine the i+1th edge search line segment at least according to the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, to obtain a plurality of edge search line segments, Determining the i+1th edge search line segment at least according to the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment, and obtaining a plurality of edge search line segments, including: A first determination step is to determine whether a pixel value difference between two endpoints of the fourth line segment corresponding to the (i+1)th initial search line segment is less than the first pixel value; A rotation step, when the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is less than the first pixel value, the starting point of the i+1th initial search line segment is used as the rotation point, and the i+1th initial search line segment is rotated until the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment after rotation is not less than the first pixel value, thereby obtaining the i+1th edge search line segment, and when the pixel value difference between the two endpoints of the fourth line segment corresponding to the i+1th initial search line segment is not less than the first pixel value, the i+1th edge search line segment is obtained as the i+1th initial search line segment; The second determination step determines whether the number of the edge search line segments obtained reaches a predetermined number. If the number does not reach the predetermined number, the first determination step and the rotation step are executed in a loop until the number reaches the predetermined number, thereby obtaining the predetermined number of edge search line segments.
2. The method according to claim 1, characterized in that Before determining the first edge search line segment from the processing surface image, the method further includes: Identifying the engine body information of the engine, and determining the engine model of the engine according to the engine body information; Determine the image template corresponding to the engine model; Determining the first edge search line segment from the processing surface image includes: According to the image template, the processing surface image is processed using a template matching algorithm to determine a starting search position from the processing surface image to obtain a starting point of the first edge search line segment; According to the line segment parameters and the starting search position, the target search position is determined to obtain the end point of the first edge search line segment, the distance between the target search position and the starting search position is the line segment length, and the angle between the line connecting the target search position and the starting search position and the predetermined axis is the line segment angle.
3. The method according to claim 1, characterized in that According to the i+1th initial search line segment, fitting a fourth line segment corresponding to the i+1th initial search line segment comprises: Calculate the coordinates of the midpoint of the i+1th initial search line segment according to the coordinates of the two endpoints of the i+1th initial search line segment; Taking the midpoint of the i+1th initial search line segment as the rotation point, rotate the i+1th initial search line segment 90° along a predetermined direction, and determine the coordinates of the two endpoints of the fourth line segment on the straight line where the i+1th initial search line segment is located after the rotation according to the preset length, and the predetermined direction is clockwise or counterclockwise.
4. The method according to any one of claims 1 to 3, characterized in that After updating the initial contour according to the preset edge distance to obtain the final contour, the method further includes: Segmenting the area surrounded by the final outline along the final outline to obtain a plurality of sub-areas; Defect detection is performed on the plurality of sub-areas to determine whether the processed surface is qualified.
5. The method according to claim 4, characterized in that Performing defect detection on the plurality of sub-areas to determine whether the processed surface is qualified includes: Determine a grayscale difference of the plurality of sub-regions, wherein the grayscale difference represents a change in a pixel value of the sub-region; Determine whether there is an abnormal sub-region among the multiple sub-regions according to the multiple grayscale differences, wherein the sub-region whose grayscale difference is greater than the second pixel value is the abnormal sub-region; In the case that there is an abnormal sub-region among the plurality of sub-regions, detecting a spot position in the abnormal sub-region, and calculating the aspect ratio of the spot according to the spot position; Determine the type of the spot and the number of the spots of each type according to the aspect ratio, wherein the type includes at least one of the following: cracks and sand holes; Whether the machined surface of the engine is qualified is determined based on the types and the corresponding quantities of each type.
6. The method according to any one of claims 1 to 3, characterized in that According to the preset edge distance, the initial contour is updated to obtain the final contour, including: Extracting two adjacent initial coordinate points from the initial contour along a predetermined direction to obtain the jth initial coordinate point and the j+1th initial coordinate point, wherein the predetermined direction is a clockwise direction or a counterclockwise direction, and j≥1 is an integer; Fitting the jth initial coordinate point and the j+1th initial coordinate point to obtain the third line segment with the starting point being the jth initial coordinate point and the end point being the j+1th initial coordinate point; Acquire the angle of the third line segment, and determine the target angle as the sum of the angle of the third line segment and 90° according to the angle of the third line segment, wherein the angle of the third line segment is the angle between the third line segment and a predetermined axis of the image coordinate system of the processing surface image; According to the target angle, the jth initial coordinate point and the edge distance, determine the end point coordinates of the line segment with the jth initial coordinate point as the starting point, the length of the edge distance, the angle with the predetermined axis as the target angle, and the direction from the starting point to the end point pointing to the inside of the initial contour, and obtain the final coordinate point corresponding to the jth initial coordinate point.
7. The method according to any one of claims 1 to 3, characterized in that Determining a plurality of regions of interest of the processing surface image according to the plurality of edge search line segments includes: According to the edge search line segment, the corresponding region of interest is determined to be a rectangular region with the edge search line segment as a central axis segment and a width of a preset width.
8. The method according to any one of claims 1 to 3, characterized in that Before determining a plurality of continuous edge search line segments of the engine processing surface image, the method further includes: When the engine reaches the shooting position, acquiring an initial image of the processing surface; Updating the pixel value of each pixel in the initial image to obtain an updated pixel value, wherein the updated pixel value is the product of the pixel value and a predetermined coefficient; The updated pixel values greater than 255 are adjusted to 255 to obtain the processed surface image.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 8.
10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of claims 1 to 8.
Citation Information
Patent Citations
Machine vision detection method for workpiece contour flange protrusion based on G-code guidance
CN108765378A
Aero-engine fan-shaped section blade defect detection and identification method
CN115330731A
