Spring bearing seat quality detection method and device based on image detection, terminal equipment and storage medium
Through the image detection method, the top view of the spring bearing seat is binarized and edge detection is performed, the image area is divided and the welding slag and marking are detected, which solves the problems of low detection efficiency and low accuracy in the prior art. Efficient and accurate quality inspection is achieved.
Patent Information
- Application Number
- CN202411634805.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art has low efficiency and low accuracy when performing mass testing of the spring bearing seat of a vehicle shock absorber, especially in terms of welding slag detection and circular marking detection.
By using an image detection method, the top view of the spring bearing seat is obtained, binarization and inner hole circle edge detection are performed, the image is divided into inner hole circle area and non-inner hole circle area, and welding slag detection and identification are performed respectively. Test.
The quality detection efficiency of the spring bearing seat is improved, and the welding slag detection and circular marking detection can be carried out simultaneously, which significantly improves the detection accuracy and efficiency.
Smart Images

Figure CN119399180A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine vision detection, and in particular to a spring bearing seat quality detection method, device, terminal equipment and storage medium based on image detection. Background Art
[0002] With the development of industry, image detection technology is often used to replace manual work in some dangerous working environments that are not suitable for manual work or where artificial vision cannot meet the requirements. At the same time, in the process of mass industrial production, the efficiency and accuracy of product quality inspection by artificial vision are low. The use of image detection technology can greatly improve production efficiency and the degree of automation of production. Moreover, image detection technology is easy to realize information integration and is the basic technology for realizing computer integrated manufacturing.
[0003] Image detection technology is widely used in the field of quality inspection of vehicle parts. When inspecting the spring bearing seat of the vehicle shock absorber, two parts of the part need to be inspected, namely the welding slag inspection in the inner hole circle and the circular mark inspection on the outer circle. Therefore, when the image detection technology is used to inspect the spring bearing seat, it is necessary to take an image of the inside of the inner hole circle and a top view for quality inspection, which results in very low quality inspection efficiency of the spring bearing seat. Summary of the invention
[0004] The embodiments of the present invention provide a spring bearing seat quality inspection method, device, terminal equipment and storage medium based on image detection, and simultaneously perform welding slag inspection and circular mark inspection on the spring bearing seat, thereby effectively improving the quality inspection efficiency of the spring bearing seat.
[0005] An embodiment of the present invention provides a spring bearing seat quality detection method based on image detection, comprising:
[0006] Obtaining a top view of the spring bearing seat to be inspected;
[0007] Binarizing the top view to generate an image to be detected;
[0008] Detecting an inner hole circle edge from the image to be detected, and dividing the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge;
[0009] Performing a welding slag detection operation on the inner hole circle area, and generating a first detection result for indicating whether welding slag exists in the inner hole circle area;
[0010] Performing a mark detection operation on the non-inner hole circle area, and generating a second detection result for indicating whether a plurality of circular marks in the non-inner hole circle area are complete;
[0011] A quality inspection result of the spring bearing seat is generated according to the first inspection result and the second inspection result.
[0012] Furthermore, the binarization processing of the top view to generate the image to be detected includes:
[0013] Obtaining a pixel value of each pixel in the top view;
[0014] Traversing a number of the pixel points in the top view, and determining whether a pixel value of a currently traversed pixel point is greater than a preset pixel threshold;
[0015] If yes, change the pixel value of the currently traversed pixel to 1;
[0016] If not, the pixel value of the currently traversed pixel is changed to 0;
[0017] At the end of the traversal, the image to be detected is generated.
[0018] Further, the detecting the inner hole circle edge from the image to be detected, and dividing the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge, comprises:
[0019] The Smallest_circle function is used to process the image to be detected, and an initial inner hole circle area in the image to be detected is extracted;
[0020] Using the Spoke operator, the center and radius of the initial inner hole circle area are calculated;
[0021] Determine a ring-shaped detection area according to a preset detection radius, the center of the circle, and the radius;
[0022] Calculate the grayscale change values from a number of pixel points in the annular detection area to the center of the circle, and take the pixel points whose grayscale change values are greater than a preset change threshold as edge pixel points;
[0023] Determine the inner hole circle area according to the plurality of edge pixel points;
[0024] A non-inner hole circle area is determined according to the image to be detected and the inner hole circle area.
[0025] Further, the performing of welding slag detection operation on the inner hole circle area and generating a first detection result for characterizing whether welding slag exists in the inner hole circle area includes:
[0026] According to the inner hole circle area, segmenting an inner hole circle image from the top view;
[0027] According to a preset pixel distance, a target pixel point between a plurality of edge pixel points and the center of the inner hole circle image is obtained;
[0028] According to the target pixel points, determine the area to be detected in the inner hole circle image, and perform mask analysis on the area to be detected to generate a mask image;
[0029] The mask image is compared with the inner hole circle image, and the comparison result is used as the first detection result.
[0030] Furthermore, the performing of a mark detection operation on the non-inner hole circle area and generating a second detection result for indicating whether a plurality of circular marks in the non-inner hole circle area are complete includes:
[0031] Extracting the contour line of each circular mark in the non-inner hole circle area;
[0032] Segment the contour of each circular mark into a plurality of feature segments, and generate a feature set of the corresponding circular mark according to the feature segments;
[0033] Calculating the similarity between each feature segment in the feature set and each template feature segment in the template feature set, and determining the matching degree between each circular mark and a preset template circular mark according to the similarity;
[0034] When the matching degrees are all greater than a preset matching threshold, a second detection result is generated for characterizing that a plurality of circular marks in the non-inner hole circle area are complete;
[0035] When there is a matching degree that is not greater than a preset matching threshold, a second detection result is generated for characterizing that a plurality of circular marks in the non-inner hole circle area are incomplete.
[0036] Another embodiment of the present invention provides a spring bearing seat quality detection device based on image detection, comprising:
[0037] An image acquisition module, used for acquiring a top view of the spring bearing seat to be inspected;
[0038] An image processing module, used for performing binarization processing on the top view to generate an image to be detected;
[0039] An image segmentation module, used for detecting the inner hole circle edge from the image to be detected, and dividing the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge;
[0040] A first quality inspection module, used for performing a welding slag detection operation on the inner hole circle area, and generating a first detection result for indicating whether there is welding slag in the inner hole circle area;
[0041] A second quality inspection module is used to perform a mark detection operation on the non-inner hole circle area and generate a second detection result for indicating whether a plurality of circular marks in the non-inner hole circle area are complete;
[0042] The result generating module is used to generate the quality detection result of the spring bearing seat according to the first detection result and the second detection result.
[0043] Furthermore, the image processing module performs binarization processing on the top view to generate an image to be detected, including:
[0044] Obtaining a pixel value of each pixel in the top view;
[0045] Traversing a number of the pixel points in the top view, and determining whether a pixel value of a currently traversed pixel point is greater than a preset pixel threshold;
[0046] If yes, change the pixel value of the currently traversed pixel to 1;
[0047] If not, the pixel value of the currently traversed pixel is changed to 0;
[0048] At the end of the traversal, the image to be detected is generated.
[0049] Furthermore, the image segmentation module detects the inner hole circle edge from the image to be detected, and divides the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge, including:
[0050] The Smallest_circle function is used to process the image to be detected, and an initial inner hole circle area in the image to be detected is extracted;
[0051] Using the Spoke operator, the center and radius of the initial inner hole circle area are calculated;
[0052] Determine a ring-shaped detection area according to a preset detection radius, the center of the circle, and the radius;
[0053] Calculate the grayscale change values from a number of pixel points in the annular detection area to the center of the circle, and take the pixel points whose grayscale change values are greater than a preset change threshold as edge pixel points;
[0054] Determine the inner hole circle area according to the plurality of edge pixel points;
[0055] A non-inner hole circle area is determined according to the image to be detected and the inner hole circle area.
[0056] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, a spring bearing seat quality detection method based on image detection as described in any one of the embodiments is implemented.
[0057] Another embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute a spring bearing seat quality detection method based on image detection as described in any one of the above embodiments.
[0058] The following beneficial effects are achieved by implementing the present invention:
[0059] The present invention discloses a spring bearing seat quality inspection method, device, terminal equipment and storage medium based on image detection. The method generates an image to be inspected by binarizing a top view of the spring bearing seat; detecting the inner hole circle edge from the image to be inspected, and dividing the image to be inspected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge; performing a welding slag detection operation on the inner hole circle area, and generating a first inspection result for characterizing whether welding slag exists in the inner hole circle area; performing a mark detection operation on the non-inner hole circle area, and generating a second inspection result for characterizing whether several circular marks in the non-inner hole circle area are complete; and generating a quality inspection result of the spring bearing seat according to the first inspection result and the second inspection result. Therefore, the present invention only needs to use a top view of the spring bearing seat to simultaneously perform welding slag detection and circular mark detection on the spring bearing seat, which effectively improves the quality inspection efficiency of the spring bearing seat. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a flow chart of a spring bearing seat quality detection method based on image detection provided by one embodiment of the present invention.
[0061] Figure 2 It is a structural schematic diagram of a spring bearing seat quality detection device based on image detection provided by one embodiment of the present invention.
[0062] Figure 3 It is a structural schematic diagram of a spring bearing seat provided in one embodiment of the present invention.
[0063] Figure 4 It is a top view schematic diagram of a spring bearing seat provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0066] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0067] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0068] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0069] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0070] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0071] See also Figure 1 , is a flow chart of a spring bearing seat quality detection method based on image detection provided by an embodiment of the present invention, comprising:
[0072] S1. Obtain a top view of the spring bearing seat to be tested;
[0073] In a preferred embodiment of the present invention, obtaining Figure 4 Specifically, by simultaneously irradiating multiple light sources onto Figure 3 By taking a bird's-eye view of the inner hole circle of the spring bearing seat shown in the figure, the inner hole circle area and the outer circle of the spring bearing seat can be clearly photographed. Secondly, after obtaining the bird's-eye view after shooting, the image can also be denoised by filtering to improve the clarity of the image and highlight the part to be inspected;
[0074] S2, performing binarization processing on the top view to generate an image to be detected;
[0075] Preferably, the binarization processing of the top view to generate the image to be detected includes:
[0076] S21, obtaining a pixel value of each pixel in the top view;
[0077] S22, traversing a plurality of pixel points in the top view, and determining whether a pixel value of a currently traversed pixel point is greater than a preset pixel threshold;
[0078] S23, if yes, modify the pixel value of the currently traversed pixel to 1;
[0079] S24, if not, modify the pixel value of the currently traversed pixel to 0;
[0080] S25. When the traversal is finished, the image to be detected is generated.
[0081] In a preferred embodiment of the present invention, the pixel points of the top view are represented by a two-dimensional function f(x, y), where x and y represent plane coordinates, and the pixel value f at any pixel point (x, y) is called the grayscale value of the pixel point, and the grayscale value ranges from 0 to 255. The top view is processed by an image binarization method, and the processing process is shown in the following formula.
[0082]
[0083] Among them, g(x,y) is the pixel value of the pixel point (x,y) after modification, f(x,y) is the pixel value of the pixel point (x,y) before modification, and TH is the pixel threshold.
[0084] S3, detecting an inner hole circle edge from the image to be detected, and dividing the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge;
[0085] Preferably, detecting the inner hole circle edge from the image to be detected, and dividing the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge, comprises:
[0086] S31, using the Smallest_circle function to process the image to be detected, and extracting the initial inner hole circle area in the image to be detected;
[0087] S32, using the Spoke operator to calculate the center and radius of the initial inner hole circle area;
[0088] S33, determining a ring-shaped detection area according to a preset detection radius, the center of the circle, and the radius;
[0089] S34, calculating the grayscale change values from a number of pixel points in the annular detection area to the center of the circle, and taking the pixel points whose grayscale change values are greater than a preset change threshold as edge pixel points;
[0090] S35, determining an inner hole circle area according to a number of edge pixel points;
[0091] S36, determining a non-inner hole circle area according to the image to be detected and the inner hole circle area.
[0092] In a preferred embodiment of the present invention, an automatic two-step accurate circle finding method is used to accurately fit the edge of the inner hole circle: the first step is to use the Smallest_circle function in the Halcon method library to fit the minimum circumscribed circle of the inner hole area extracted by the binarization method above. Since the inner hole area extracted by the binarization method is quite different from the real inner hole, the fitted circle has an error with the real inner hole circle. The second step is to use the Spoke operator of the encapsulated detection circle to fit the precise inner hole circle according to the center (x0, y0) and radius R of the inner hole circle roughly obtained in the first step. The process is as follows: based on the inner hole circumference obtained in the first step, the annular area with an inner diameter of R-R0 and an outer diameter of R+R0 is set as the detection area, and the detection direction is set to "outer", that is, to find the points within the detection range where the gray value changes from the center of the circle to the edge point in the direction exceeding the set range, and then the circle fitted by these points is the edge line of the inner hole circle of the spring bearing seat.
[0093] S4, performing a welding slag detection operation on the inner hole circle area, and generating a first detection result for indicating whether welding slag exists in the inner hole circle area;
[0094] Preferably, the performing of welding slag detection operation on the inner hole circle area and generating a first detection result for characterizing whether welding slag exists in the inner hole circle area includes:
[0095] S41, segmenting an inner hole circle image from the top view according to the inner hole circle area;
[0096] S42, acquiring target pixel points between a plurality of edge pixel points and the center of the inner hole circle image according to a preset pixel distance;
[0097] S43, determining a region to be detected in the inner hole circle image according to the plurality of target pixel points, and performing mask analysis on the region to be detected to generate a mask image;
[0098] S44, comparing the mask image with the inner hole circle image, and using the comparison result as the first detection result.
[0099] In a preferred embodiment of the present invention, a mathematical morphological operation is performed on the edge of the inner hole circle obtained by S3, so that the inner hole circle is shrunk by 3-5 pixels toward the center of the circle to form a closed connected area, and then a mask analysis is performed on the connected area, that is, after the mask image and the original image are subjected to an "XOR" operation, the difference value between the original image and the mask image is output, and the display of this difference value is the welding slag.
[0100] Secondly, the actual length represented by each pixel is calculated by pixel size calibration. The actual size can also be calculated based on the inner hole circle edge size fitted in step S4 and compared with the allowed range value to determine whether the inner hole size is qualified.
[0101] S5, performing a mark detection operation on the non-inner hole circle area, and generating a second detection result for indicating whether a plurality of circular marks in the non-inner hole circle area are complete;
[0102] Preferably, the performing of a mark detection operation on the non-inner hole circle area and generating a second detection result for indicating whether a plurality of circular marks in the non-inner hole circle area are complete includes:
[0103] S51, extracting the contour line of each circular mark in the non-inner hole circle area;
[0104] S52, dividing the contour of each circular mark into a plurality of feature segments, and generating a feature set of the corresponding circular mark according to the feature segments;
[0105] S53, calculating the similarity between each feature segment in the feature set and each template feature segment in the template feature set, and determining the matching degree between each circular mark and a preset template circular mark according to the similarity;
[0106] S54, when the matching degrees are all greater than a preset matching threshold, generating a second detection result for characterizing that a plurality of circular marks in the non-inner hole circle area are complete;
[0107] S55. When there is a matching degree that is not greater than a preset matching threshold, generate a second detection result for characterizing that a plurality of circular marks in the non-inner hole circle area are incomplete.
[0108] In a preferred embodiment of the present invention, the integrity detection of the circular mark adopts a feature-based template matching algorithm, that is, by extracting the contour line of the circular mark, describing the contour line with parameters and then matching the described parameters.
[0109] The template used for feature matching is composed of the edge point set of the detection target, and the matching is performed by calculating the Hausdorff distance between the two point sets. The Hausdorff distance is a maximum-minimum distance defined on two point sets, which is mainly used to measure the matching degree of two point sets. The template feature set is recorded as A = {a1, a2…a p}, and record the feature set as B = {b1, b2…b q}, then the Hausdorff distance between A and B is defined as follows:
[0110] H(A,B)=max{h(A,B),h(B,A)};
[0111] Where h(A,B) is the directed Hausdorff distance from point set A to point set B, and h(B,A) is the directed Hausdorff distance from point set B to point set A.
[0112] The contour line is divided into several segments, and the Hausdorff distance between the feature segments is calculated to characterize their similarity. Ideally, the Hausdorff distance between two matching contour lines is 0, but due to the influence of noise when collecting pictures, the Hausdorff distance between matching contour lines will not be 0, but within a certain tolerance ε.
[0113] S6. Generate a quality inspection result of the spring bearing seat according to the first inspection result and the second inspection result.
[0114] The present embodiment provides a spring bearing seat quality inspection method based on image detection, which generates an image to be inspected by binarizing the top view of the spring bearing seat; detecting the inner hole circle edge from the image to be inspected, and dividing the image to be inspected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge; performing a welding slag detection operation on the inner hole circle area, and generating a first inspection result for characterizing whether welding slag exists in the inner hole circle area; performing a mark detection operation on the non-inner hole circle area, and generating a second inspection result for characterizing whether several circular marks in the non-inner hole circle area are complete; and generating a quality inspection result of the spring bearing seat according to the first inspection result and the second inspection result. Therefore, the present invention only needs to use the top view of the spring bearing seat to simultaneously perform welding slag detection and circular mark detection on the spring bearing seat, which effectively improves the quality inspection efficiency of the spring bearing seat.
[0115] See also Figure 2 , is a schematic structural diagram of a spring bearing seat quality detection device based on image detection provided by an embodiment of the present invention, comprising:
[0116] An image acquisition module, used for acquiring a top view of the spring bearing seat to be inspected;
[0117] An image processing module, used for performing binarization processing on the top view to generate an image to be detected;
[0118] An image segmentation module, used for detecting the inner hole circle edge from the image to be detected, and dividing the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge;
[0119] A first quality inspection module, used for performing a welding slag detection operation on the inner hole circle area, and generating a first detection result for indicating whether there is welding slag in the inner hole circle area;
[0120] A second quality inspection module is used to perform a mark detection operation on the non-inner hole circle area and generate a second detection result for indicating whether a plurality of circular marks in the non-inner hole circle area are complete;
[0121] The result generating module is used to generate the quality detection result of the spring bearing seat according to the first detection result and the second detection result.
[0122] Preferably, the image processing module performs binarization processing on the top view to generate the image to be detected, including:
[0123] Obtaining a pixel value of each pixel in the top view;
[0124] Traversing a number of the pixel points in the top view, and determining whether a pixel value of a currently traversed pixel point is greater than a preset pixel threshold;
[0125] If yes, change the pixel value of the currently traversed pixel to 1;
[0126] If not, the pixel value of the currently traversed pixel is changed to 0;
[0127] At the end of the traversal, the image to be detected is generated.
[0128] Preferably, the image segmentation module detects the inner hole circle edge from the image to be detected, and divides the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge, including:
[0129] The Smallest_circle function is used to process the image to be detected, and an initial inner hole circle area in the image to be detected is extracted;
[0130] Using the Spoke operator, the center and radius of the initial inner hole circle area are calculated;
[0131] Determine a ring-shaped detection area according to a preset detection radius, the center of the circle, and the radius;
[0132] Calculate the grayscale change values from a number of pixel points in the annular detection area to the center of the circle, and take the pixel points whose grayscale change values are greater than a preset change threshold as edge pixel points;
[0133] Determine the inner hole circle area according to the plurality of edge pixel points;
[0134] A non-inner hole circle area is determined according to the image to be detected and the inner hole circle area.
[0135] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0136] Those skilled in the art can clearly understand that for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0137] Another preferred embodiment of the present invention provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements a spring bearing seat quality detection method based on image detection as described in any one of the above embodiments.
[0138] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0139] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.
[0140] The memory can be used to store the computer program, and the processor realizes various functions of the terminal device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0141] Another preferred embodiment of the present invention provides a storage medium, the storage medium is a computer-readable storage medium, the computer program is stored in the computer-readable storage medium, and the computer program, when executed by the processor, can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0142] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A spring bearing seat quality detection method based on image detection, characterized in that: include: Obtaining a top view of the spring bearing seat to be inspected; Binarizing the top view to generate an image to be detected; Detecting an inner hole circle edge from the image to be detected, and dividing the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge; Performing a welding slag detection operation on the inner hole circle area, and generating a first detection result for indicating whether welding slag exists in the inner hole circle area; Performing a mark detection operation on the non-inner hole circle area, and generating a second detection result for indicating whether a plurality of circular marks in the non-inner hole circle area are complete; A quality inspection result of the spring bearing seat is generated according to the first inspection result and the second inspection result.
2. A spring bearing seat quality detection method based on image detection as claimed in claim 1, characterized in that: The binarization process of the top view to generate the image to be detected includes: Obtaining a pixel value of each pixel in the top view; Traversing a number of the pixel points in the top view, and determining whether a pixel value of a currently traversed pixel point is greater than a preset pixel threshold; If yes, change the pixel value of the currently traversed pixel to 1; If not, the pixel value of the currently traversed pixel is changed to 0; At the end of the traversal, the image to be detected is generated.
3. A spring bearing seat quality detection method based on image detection as claimed in claim 2, characterized in that: The step of detecting the inner hole circle edge from the image to be detected and dividing the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge includes: The Smallest_circle function is used to process the image to be detected, and an initial inner hole circle area in the image to be detected is extracted; Using the Spoke operator, the center and radius of the initial inner hole circle area are calculated; Determine a ring-shaped detection area according to a preset detection radius, the center of the circle, and the radius; Calculate the grayscale change values from a number of pixel points in the annular detection area to the center of the circle, and take the pixel points whose grayscale change values are greater than a preset change threshold as edge pixel points; Determine the inner hole circle area according to the plurality of edge pixel points; A non-inner hole circle area is determined according to the image to be detected and the inner hole circle area.
4. A spring bearing seat quality detection method based on image detection as claimed in claim 3, characterized in that: The performing of a welding slag detection operation on the inner hole circle area and generating a first detection result for characterizing whether welding slag exists in the inner hole circle area includes: According to the inner hole circle area, segmenting an inner hole circle image from the top view; According to a preset pixel distance, a target pixel point between a plurality of edge pixel points and the center of the inner hole circle image is obtained; According to the target pixel points, determine the area to be detected in the inner hole circle image, and perform mask analysis on the area to be detected to generate a mask image; The mask image is compared with the inner hole circle image, and the comparison result is used as the first detection result.
5. A spring bearing seat quality detection method based on image detection as claimed in claim 4, characterized in that: The performing of the mark detection operation on the non-inner hole circle area and generating a second detection result for indicating whether a plurality of circular marks in the non-inner hole circle area are complete includes: Extracting the contour line of each circular mark in the non-inner hole circle area; Segment the contour of each circular mark into a plurality of feature segments, and generate a feature set of the corresponding circular mark according to the feature segments; Calculating the similarity between each feature segment in the feature set and each template feature segment in the template feature set, and determining the matching degree between each circular mark and a preset template circular mark according to the similarity; When the matching degrees are all greater than a preset matching threshold, a second detection result is generated for characterizing that a plurality of circular marks in the non-inner hole circle area are complete; When there is a matching degree that is not greater than a preset matching threshold, a second detection result is generated for characterizing that a plurality of circular marks in the non-inner hole circle area are incomplete.
6. A spring bearing seat quality detection device based on image detection, characterized in that: include: An image acquisition module, used for acquiring a top view of the spring bearing seat to be inspected; An image processing module, used for performing binarization processing on the top view to generate an image to be detected; An image segmentation module, used for detecting the inner hole circle edge from the image to be detected, and dividing the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge; A first quality inspection module, used for performing a welding slag detection operation on the inner hole circle area, and generating a first detection result for indicating whether there is welding slag in the inner hole circle area; A second quality inspection module is used to perform a mark detection operation on the non-inner hole circle area and generate a second detection result for indicating whether a plurality of circular marks in the non-inner hole circle area are complete; The result generating module is used to generate the quality detection result of the spring bearing seat according to the first detection result and the second detection result.
7. A spring bearing seat quality detection device based on image detection as claimed in claim 6, characterized in that: The image processing module performs binarization processing on the top view to generate an image to be detected, including: Obtaining a pixel value of each pixel in the top view; Traversing a number of the pixel points in the top view, and determining whether a pixel value of a currently traversed pixel point is greater than a preset pixel threshold; If yes, change the pixel value of the currently traversed pixel to 1; If not, the pixel value of the currently traversed pixel is changed to 0; At the end of the traversal, the image to be detected is generated.
8. The spring bearing seat quality detection device based on image detection as claimed in claim 7, characterized in that: The image segmentation module detects the inner hole circle edge from the image to be detected, and divides the image to be detected into an inner hole circle area and a non-inner hole circle area according to the inner hole circle edge, including: The Smallest_circle function is used to process the image to be detected, and an initial inner hole circle area in the image to be detected is extracted; Using the Spoke operator, the center and radius of the initial inner hole circle area are calculated; Determine a ring-shaped detection area according to a preset detection radius, the center of the circle, and the radius; Calculate the grayscale change values from a number of pixel points in the annular detection area to the center of the circle, and take the pixel points whose grayscale change values are greater than a preset change threshold as edge pixel points; Determine the inner hole circle area according to the plurality of edge pixel points; A non-inner hole circle area is determined according to the image to be detected and the inner hole circle area.
9. A terminal device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, a spring bearing seat quality detection method based on image detection as claimed in any one of claims 1 to 5 is implemented.
10. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute a spring bearing seat quality detection method based on image detection as claimed in any one of claims 1 to 5.
Citation Information
Patent Citations
Automatic transmission reset spring assembly detection device
CN109931886A
CAMERA DEVICE FOR A VEHICLE AND VEHICLE
DE102021118716A1