Military wire test pre-judgment method combining software technology and camera module
Through the combination of software technology and camera modules, image processing and spot detection technology are used to solve the problem of cumbersome military electronic wire detection process, and fast and accurate judgment of copper core arrangement is achieved.
Patent Information
- Application Number
- CN202410949281.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2025-08-05
AI Technical Summary
The prior art cannot efficiently detect the positional arrangement and quantity of copper cores in military electronic wires, resulting in cumbersome and complex detection process.
Using a combination of software technology and camera modules, through steps such as image graying, preprocessing, SVM classification and spot detection, circle-like spots on the cross-section of the wire and their European-style distance from the contour center, to determine whether the copper core arrangement is compliant.
It realizes a quick and simple judgment of whether there is a core shortage of the wire or the uneven distribution of the wire core, and improves detection efficiency and accuracy.
Smart Images

Figure CN120431360A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wire material detection, and in particular to a military wire material testing and prediction method that combines software technology with a camera module. Background Art
[0002] Conventional electronic wires are generally used in weak current engineering, such as internal connections of electronic and electrical equipment, while military electronic wires are generally used in specific laboratories and research departments. Compared with conventional electronic wires, military electronic wires have higher requirements for various technical indicators.
[0003] At present, the quality inspection of military electronic wires relies more on traditional metrology and measurement methods. The wires need to be sent to the laboratory and go through cutting, core-pressing, slicing, cooling, standing, and measurement to obtain the inspection data of the wires. The inspection process is relatively cumbersome and the inspection steps are also relatively complicated.
[0004] With the rise of visual recognition and artificial intelligence, some military electronic wires are now using intelligent recognition for quality inspection. For example, Chinese patent CN202210133969.0 discloses a computer vision-based cable quality inspection method. This method uses a computer vision algorithm to automatically locate the center of the cable cross section. It also uses computer vision and edge detection algorithms to automatically locate the pixel point J where the radius intersects the inner side of the insulation layer and the pixel point P where the radius intersects the outer side of the shielding layer. Finally, a coordinate transformation algorithm is used to automatically calculate the pixel distance between points J and P. This electronic wire inspection method can only detect data such as the thickness of the insulation and shielding layers, but cannot detect the position, arrangement, and number of copper cores. Therefore, based on this background, the present invention proposes a military wire testing and pre-judgment method that combines software technology with a camera module. This method uses captured images and processes them through grayscale processing, preprocessing, SVM classification, and spot detection to determine the number of circular spots and the Euclidean distance between the circular spots and the center of the contour circle. This information is then used to determine whether there are missing cores or uneven core distribution. Summary of the Invention
[0005] The purpose of the present invention is to provide a military wire material testing and prediction method that combines software technology and a camera module to solve the problems raised in the above background technology.
[0006] To achieve the above-mentioned purpose, the present invention provides the following technical solution: a military wire material testing and prediction method combining software technology and a camera module, comprising the following steps:
[0007] S1: Target wire image acquisition: acquire the target wire, cut the target wire using a tool, and acquire a two-dimensional target image of the target wire cross section using a camera under a specified environment;
[0008] S2: Processing the two-dimensional target image into a two-dimensional target cross-sectional grayscale image using an image grayscale conversion method;
[0009] S3: Image preprocessing, including image correction of two-dimensional target images, as well as contour edge recognition and contour center recognition;
[0010] S4: Use the SVM algorithm to classify the target sub-region and non-target sub-region in the two-dimensional target cross-sectional grayscale image in S3, and then use the statistical method to perform threshold statistics on the roundness feature parameters and area feature parameters of the target sub-region;
[0011] S5: Consider the cross section of each target wire as a circular spot in the image, and use a spot detection algorithm to identify the circular spots in the two-dimensional target cross-sectional grayscale image;
[0012] S6: extracting the same local area of the circular spots and the contour edge, performing contour background subtraction, and verifying and obtaining valid circular spots;
[0013] S7: Identify the center coordinates and radius of the valid circular-like spot, and calculate the Euclidean distance between the valid circular-like spot and the center of the contour circle using a preset logic. If the Euclidean distance is within a preset range, it is determined that the arrangement of the copper core of the wire cross section is compliant. If the Euclidean distance is within the preset range, it is determined that the arrangement of the copper core of the wire cross section is not compliant.
[0014] Preferably, the image grayscale method in step S2 is to first perform downsampling processing to obtain the energy of each color channel of the scaled image after the downsampling processing, and then obtain the optimal coefficient of each color channel based on the iterative algorithm of the transformation coefficient, so as to perform grayscale transformation on the original color image according to these optimal coefficients to obtain a two-dimensional target cross-sectional grayscale image.
[0015] Preferably, the image correction in step S3 is to find the key feature points of the target image using a contour approximation fitting method, and perform preliminary coordinate correction on the original image using perspective transformation.
[0016] Preferably, the specific process of identifying the contour edge and the contour center of the target image in step S3 includes:
[0017] A circular filter with a custom circular convolution kernel is used to identify the center of the two-dimensional target cross-sectional grayscale image. After adaptive binarization and morphological processing, the initial center is obtained.
[0018] The Canny algorithm is used for edge detection and contour extraction, and the characteristic contour area is obtained by screening according to the candidate circle center position;
[0019] Extract the contour points and use the gradient descent method to fit the circle to get the fitting center. The objective function is set in the fitting process. The objective function is:
[0020]
[0021] Where, x i is the horizontal coordinate of the contour point, y i is the ordinate of the contour point, r is the radius of the circle, a is the abscissa of the center of the circle, b is the ordinate of the center of the circle, and n is the number of contour points;
[0022] If the distance between the fitting circle center and the candidate circle center is not within the preset threshold range, the circle fitting is performed iteratively. If it is within the range, the fitting circle center is used as the identification circle center.
[0023] Preferably, in step S5, the spot detection algorithm performs circular spot detection according to roundness. Roundness detection is to measure the distance between the spot and the circle. Roundness is defined as (). The roundness of a circle is 1, the roundness of a square is PI / 4, and so on. The formula is as follows:
[0024]
[0025] Preferably, the distance formula in step S7 is:
[0026]
[0027] Where (Px, Py) is the coordinate of the center of the circular spot, and (Cx, Cy) is the coordinate of the center of the two-dimensional target image.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] The present invention can utilize the acquired image and subject the image to grayscale processing, preprocessing, SVM classification, spot detection and other steps to obtain the number of circular spots and the Euclidean distance between the circular spots and the center of the contour circle, based on which it is judged whether there is a core missing or uneven distribution of the wire cores. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the process of the present invention;
[0031] Figure 2 Schematic diagram of the image preprocessing process in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0033] See also Figure 1-2 The present invention provides a technical solution: a military wire material test prediction method combining software technology and camera module, comprising the steps of:
[0034] S1: Target wire image acquisition: acquire the target wire, cut the target wire using a tool, and acquire a two-dimensional target image of the target wire cross section using a camera under a specified environment;
[0035] S2: Processing the two-dimensional target image into a two-dimensional target cross-sectional grayscale image using an image grayscale conversion method;
[0036] S3: Image preprocessing, including image correction of two-dimensional target images, as well as contour edge recognition and contour center recognition;
[0037] S4: Use the SVM algorithm to classify the target sub-region and non-target sub-region in the two-dimensional target cross-sectional grayscale image in S3, and then use the statistical method to perform threshold statistics on the roundness feature parameters and area feature parameters of the target sub-region;
[0038] S5: Consider the cross section of each target wire as a circular spot in the image, and use a spot detection algorithm to identify the circular spots in the two-dimensional target cross-sectional grayscale image;
[0039] S6: extracting the same local area of the circular spots and the contour edge, performing contour background subtraction, and verifying and obtaining valid circular spots;
[0040] S7: Identify the center coordinates and radius of the valid circular-like spot, and calculate the Euclidean distance between the valid circular-like spot and the center of the contour circle using a preset logic. If the Euclidean distance is within a preset range, it is determined that the arrangement of the copper core of the wire cross section is compliant. If the Euclidean distance is within the preset range, it is determined that the arrangement of the copper core of the wire cross section is not compliant.
[0041] In this embodiment, the image grayscale method in step S2 is to first perform downsampling processing to obtain the energy of each color channel of the scaled image after the downsampling processing, and then obtain the optimal coefficient of each color channel based on the iterative algorithm of the transformation coefficient, so as to perform grayscale transformation on the original color image according to these optimal coefficients to obtain a two-dimensional target cross-sectional grayscale image.
[0042] In this embodiment, the image correction in step S3 is to find the key feature points of the target image using a contour approximation fitting method, and perform preliminary coordinate correction on the original image using perspective transformation.
[0043] In this embodiment, the specific process of identifying the contour edge and the contour center of the target image in step S3 includes:
[0044] A circular filter with a custom circular convolution kernel is used to identify the center of the two-dimensional target cross-sectional grayscale image. After adaptive binarization and morphological processing, the initial center is obtained.
[0045] The Canny algorithm is used for edge detection and contour extraction, and the characteristic contour area is obtained by screening according to the candidate circle center position;
[0046] Extract the contour points and use the gradient descent method to fit the circle to get the fitting center. The objective function is set in the fitting process. The objective function is:
[0047]
[0048] Where, x i is the horizontal coordinate of the contour point, y i is the ordinate of the contour point, r is the radius of the circle, a is the abscissa of the center of the circle, b is the ordinate of the center of the circle, and n is the number of contour points;
[0049] If the distance between the fitting circle center and the candidate circle center is not within the preset threshold range, the circle fitting is performed iteratively. If it is within the range, the fitting circle center is used as the identification circle center.
[0050] In this embodiment, the spot detection algorithm in step S5 performs circular spot detection based on roundness. Roundness detection measures the distance between a spot and a circle. Roundness is defined as (). The roundness of a circle is 1, the roundness of a square is PI / 4, and so on. The formula is as follows:
[0051]
[0052] In this embodiment, the distance formula in step S7 is:
[0053]
[0054] Where (Px, Py) is the coordinate of the center of the circular spot, and (Cx, Cy) is the coordinate of the center of the two-dimensional target image.
[0055] Working principle: The above embodiment uses the acquired image and subjects the image to grayscale processing, preprocessing, SVM classification, spot detection and other steps to obtain the number of circular spots and the Euclidean distance between the circular spots and the center of the contour circle, based on which it is judged whether there is a missing core or uneven distribution of wire cores.
[0056] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.
[0057] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0058] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0059] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is only one type. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0060] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0061] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0062] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0063] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0064] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
[0065] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A military wire material testing and prediction method combining software technology and camera module, characterized in that: Including steps: S1: Target wire image acquisition: acquire the target wire, cut the target wire using a tool, and acquire a two-dimensional target image of the target wire cross section using a camera under a specified environment; S2: Processing the two-dimensional target image into a two-dimensional target cross-sectional grayscale image using an image grayscale conversion method; S3: Image preprocessing, including image correction of two-dimensional target images, as well as contour edge recognition and contour center recognition; S4: Use the SVM algorithm to classify the target sub-region and non-target sub-region in the two-dimensional target cross-sectional grayscale image in S3, and then use the statistical method to perform threshold statistics on the roundness feature parameters and area feature parameters of the target sub-region; S5: Consider the cross section of each target wire as a circular spot in the image, and use a spot detection algorithm to identify the circular spots in the two-dimensional target cross-sectional grayscale image; S6: extracting the same local area of the circular spots and the contour edge, performing contour background subtraction, and verifying and obtaining valid circular spots; S7: Identify the center coordinates and radius of the valid circular-like spot, and calculate the Euclidean distance between the valid circular-like spot and the center of the contour circle using a preset logic. If the Euclidean distance is within a preset range, it is determined that the arrangement of the copper core of the wire cross section is compliant. If the Euclidean distance is within the preset range, it is determined that the arrangement of the copper core of the wire cross section is not compliant.
2. The military wire material testing and prediction method combining software technology and a camera module according to claim 1 is characterized in that: The image grayscale method in step S2 is to first perform downsampling processing to obtain the energy of each color channel of the scaled image after the downsampling processing, and then obtain the optimal coefficient of each color channel based on the iterative algorithm of the transformation coefficient, so as to perform grayscale transformation on the original color image according to these optimal coefficients to obtain a two-dimensional target cross-sectional grayscale image.
3. The military wire material testing and prediction method combining software technology and a camera module according to claim 1 is characterized in that: The image correction in step S3 is to find the key feature points of the target image using a contour approximation fitting method, and perform preliminary coordinate correction on the original image using perspective transformation.
4. The military wire material testing and prediction method combining software technology and a camera module according to claim 1 is characterized in that: The specific process of identifying the contour edge and the contour center of the target image in step S3 includes: A circular filter with a custom circular convolution kernel is used to identify the center of the two-dimensional target cross-sectional grayscale image. After adaptive binarization and morphological processing, the initial center is obtained. The Canny algorithm is used for edge detection and contour extraction, and the characteristic contour area is obtained by screening according to the candidate circle center position; Extract the contour points and use the gradient descent method to fit the circle to get the fitting center. The objective function is set in the fitting process. The objective function is: Where, x i is the horizontal coordinate of the contour point, y i is the ordinate of the contour point, r is the radius of the circle, a is the abscissa of the center of the circle, b is the ordinate of the center of the circle, and n is the number of contour points; If the distance between the fitting circle center and the candidate circle center is not within the preset threshold range, the circle fitting is performed iteratively. If it is within the range, the fitting circle center is used as the identification circle center.
5. The military wire material testing and prediction method combining software technology and a camera module according to claim 1 is characterized in that: In step S5, the spot detection algorithm performs circular spot detection based on roundness. Roundness detection measures the distance between a spot and a circle. Roundness is defined as (). The roundness of a circle is 1, the roundness of a square is PI / 4, and so on. The formula is as follows:
6. The military wire material testing and prediction method combining software technology and a camera module according to claim 1 is characterized in that: The distance formula in step S7 is: Where (Px, Py) is the coordinate of the center of the circular spot, and (Cx, Cy) is the coordinate of the center of the two-dimensional target image.
Citation Information
Patent Citations
Cable quality inspection method based on computer vision
CN114509013A