Electric connecting device size detection method and device, electronic equipment and storage medium

Automatically detect the size of the electrical connection device through image recognition technology, solving the problem of low manual detection efficiency in the prior art, achieving efficient and accurate detection of the size of the electrical connection device, and improving the production efficiency of electric vehicles.

CN119006404APending Publication Date: 2024-11-22CHINA FAW CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411077100.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The prior art mainly relies on manual methods for the size detection of electrical connection devices, resulting in low detection efficiency and high time cost, which seriously affects the mass production progress of electric vehicles.

Method used

Image recognition technology is used to obtain images of electrically connected devices, divide them into independent images, and perform grayscale calculations, and check whether the actual size is qualified based on standard sizes. Use deviation index to judge the qualification, and issue an alarm if it fails.

Benefits of technology

It significantly improves the efficiency and accuracy of the size detection of electrical connection devices, saving a lot of time and labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006404A_ABST
    Figure CN119006404A_ABST
Patent Text Reader

Abstract

The invention discloses an electric connecting device size detection method and device, electronic equipment and a storage medium, and relates to the technical field of image recognition, and the method comprises the steps: obtaining an image of a current to-be-detected electric connecting device as a current to-be-detected image; segmenting the current to-be-detected image into a plurality of independent images; calculating the actual size of the current to-be-detected electric connecting device according to the gray value of each independent image; and detecting whether the actual size of the current to-be-detected electric connecting device is qualified or not according to the standard size of the current to-be-detected electric connecting device. The actual size of the electric connector is obtained through the detection image, whether the actual size is qualified or not can be detected according to the standard size, the detection efficiency and accuracy can be greatly improved compared with manual detection, and a large amount of time and labor cost are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to a method, device, electronic device and storage medium for detecting the size of an electrical connection device. Background Art

[0002] There are many kinds of electrical connectors for electric vehicles, and whether their quality meets the standards has an important impact on the performance of the entire vehicle. Abnormal dimensions of electrical connectors will cause many problems, affect the loading process, and slow down the progress of the project. Before loading, it is necessary to check whether the dimensions of the electrical connectors are qualified. There are a large number of electrical connectors, and the inspection task is huge. The existing technology mainly uses manual inspection methods for the size inspection of electrical connectors, which consumes a lot of time and cost, and the inspection efficiency is low, which seriously affects the mass production progress of electric vehicles. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for detecting the size of an electrical connection device, so as to improve the efficiency of detecting the size of an electrical connection device.

[0004] To achieve the above object, an embodiment of the present application provides a method for detecting the size of an electrical connection device, the method comprising the following steps:

[0005] Acquire an image of the electrical connection device to be inspected as the current image to be inspected;

[0006] Segmenting the current image to be inspected into multiple independent images;

[0007] Calculating the actual size of the electrical connection device to be inspected according to the grayscale value of each of the independent images;

[0008] Whether the actual size of the electrical connection device to be tested is qualified is detected according to the standard size of the electrical connection device to be tested.

[0009] In some embodiments, the step of dividing the current image to be inspected into multiple independent images comprises the following steps:

[0010] The current image to be inspected is divided into a plurality of independent images according to the position of the electrical connection device to be inspected.

[0011] In some embodiments, the calculating the actual size of the electrical connection device to be inspected according to the grayscale value of each of the independent images comprises the following steps:

[0012] Performing grayscale processing on each of the independent images to obtain an image grayscale matrix;

[0013] The image grayscale matrix is:

[0014]

[0015] Among them, f i (x, y) represents the image grayscale matrix, M×N represents the total number of independent images; i=1, 2, 3...k, k=M×N; f i (x,y) is obtained by sampling pixels at equal intervals;

[0016] Calculate the length and width of the current image to be inspected according to the image grayscale matrix as the image size of the current image to be inspected;

[0017] The length α of the current image to be inspected i for:

[0018]

[0019] The width β of the current image to be inspected i for:

[0020]

[0021] Calculating the actual size of the electrical connection device to be inspected according to the image size;

[0022] The actual size of the length p i for:

[0023] p i =a·α i ;

[0024] The actual size of the width q i for:

[0025] q i = b·β i ;

[0026] Wherein, a is the conversion coefficient between the length of the actual size and the length of the image size, and b is the conversion coefficient between the width of the actual size and the width of the image size.

[0027] In some embodiments, the detecting whether the actual size of the electrical connection device to be inspected is qualified according to the standard size of the electrical connection device to be inspected currently comprises the following steps:

[0028] The length deviation value is calculated based on the length of the standard size and the length of the actual size, and the length deviation value is calculated based on the width of the standard size and the width of the actual size;

[0029] The length deviation value Δp is:

[0030] Δp=δ-|p i -X|;

[0031] The width deviation value Δq is:

[0032] Δq=δ-|q i -Y|;

[0033] Wherein, X and Y are the length and width of the standard size respectively, and δ is the allowable error of the actual size of the electrical connection device to be inspected;

[0034] The deviation index of the electrical connection device to be inspected is calculated according to the length deviation value and the length deviation value; the deviation index Δw is:

[0035] Δw=Δp·Δq;

[0036] If the deviation index is greater than or equal to 0, the actual size detection of the electrical connection device to be inspected is qualified; if the deviation index is less than 0, the actual size detection of the electrical connection device to be inspected is unqualified.

[0037] In some embodiments, the method further comprises the following steps:

[0038] If the actual size is unqualified, an alarm is issued;

[0039] If the actual size is qualified, the image of the next electrical connection device to be inspected is obtained as the current image to be inspected, and the current image to be inspected is divided into a plurality of independent images.

[0040] To achieve the above-mentioned purpose, another aspect of the embodiment of the present application provides a device for detecting the size of an electrical connection device, the device comprising:

[0041] An image acquisition unit, used for acquiring an image of the electrical connection device to be inspected as a current image to be inspected;

[0042] An image segmentation unit, used for segmenting the current image to be inspected into multiple independent images;

[0043] A size calculation unit, used for calculating the actual size of the electrical connection device to be inspected according to the gray value of each of the independent images;

[0044] The size detection unit is used to detect whether the actual size of the electrical connection device to be tested is qualified according to the standard size of the electrical connection device to be tested.

[0045] In some embodiments, the image segmentation unit includes:

[0046] The image segmentation subunit is used to segment the current image to be inspected into a plurality of independent images according to the position of the electrical connection device to be inspected.

[0047] In some embodiments, the size calculation unit includes:

[0048] A grayscale processing unit, used for performing grayscale processing on each of the independent images to obtain an image grayscale matrix;

[0049] The image grayscale matrix is:

[0050]

[0051] Among them, f i (x, y) represents the image grayscale matrix, M×N represents the total number of independent images; i=1, 2, 3...k, k=M×N; f i (x,y) is obtained by sampling pixels at equal intervals;

[0052] An image size calculation unit, used for calculating the length and width of the current image to be inspected according to the image gray matrix as the image size of the current image to be inspected;

[0053] The length α of the current image to be inspected i for:

[0054]

[0055] The width β of the current image to be inspected i for:

[0056]

[0057] An actual size calculation unit, used for calculating the actual size of the electrical connection device to be inspected according to the image size;

[0058] The actual size of the length p i for:

[0059] p i =a·α i ;

[0060] The actual size of the width q i for:

[0061] q i = b·β i ;

[0062] Wherein, a is the conversion coefficient between the length of the actual size and the length of the image size, and b is the conversion coefficient between the width of the actual size and the width of the image size.

[0063] In some embodiments, the size detection unit includes:

[0064] a deviation value calculation unit, configured to calculate a length deviation value according to the length of the standard size and the length of the actual size, and to calculate a length deviation value according to the width of the standard size and the width of the actual size;

[0065] The length deviation value Δp is:

[0066] Δp=δ-p i -X|;

[0067] The width deviation value Δq is:

[0068] Δq=δ-|q i -Y|;

[0069] Wherein, X and Y are the length and width of the standard size respectively, and δ is the allowable error of the actual size of the electrical connection device to be inspected;

[0070] a deviation index calculation unit, configured to calculate a deviation index of the electrical connection device to be inspected according to the length deviation value and the length deviation value;

[0071] The deviation index Δw is:

[0072] Δw=Δp·Δq;

[0073] The size detection subunit is used to detect that the actual size of the electrical connection device to be inspected is qualified if the deviation index is greater than or equal to 0; and that the actual size of the electrical connection device to be inspected is unqualified if the deviation index is less than 0.

[0074] In some embodiments, the apparatus further comprises:

[0075] An alarm unit, used for issuing an alarm if the actual size is unqualified;

[0076] The re-inspection unit is used for obtaining the image of the next electrical connection device to be inspected as the current image to be inspected if the actual size is qualified, and executing the step of dividing the current image to be inspected into multiple independent images.

[0077] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method for detecting the size of an electrical connection device when executing the computer program.

[0078] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for detecting the size of an electrical connection device is implemented.

[0079] The embodiments of the present application include at least the following beneficial effects:

[0080] The present application can obtain an image of the electrical connection device to be inspected as the current image to be inspected; divide the current image to be inspected into multiple independent images; calculate the actual size of the electrical connection device to be inspected according to the grayscale value of each independent image; and detect whether the actual size of the electrical connection device to be inspected is qualified according to the standard size of the electrical connection device to be inspected. The present application obtains the actual size of the electrical connection device by detecting the image, and then detects whether the actual size is qualified according to the standard size. Compared with manual detection, the detection efficiency and accuracy can be greatly improved, and a lot of time and labor costs can be saved. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0082] Figure 1 A schematic diagram of a flow chart of a method for detecting the size of an electrical connection device provided in an embodiment of the present application;

[0083] Figure 2 Provided for the embodiments of this application Figure 1 The step flow chart of S120;

[0084] Figure 3 Provided for the embodiments of this application Figure 1 The step flow chart of S130;

[0085] Figure 4 A schematic diagram of a flow chart of another method for detecting the size of an electrical connection device provided in an embodiment of the present application;

[0086] Figure 5 An example flow chart of a method for detecting the size of an electrical connection device provided in an embodiment of the present application;

[0087] Figure 6 A circuit diagram of an alarm device provided in an embodiment of the present application;

[0088] Figure 7 A schematic diagram of the structure of a device for detecting the size of an electrical connection device provided in an embodiment of the present application;

[0089] Figure 8 A schematic diagram of the structure of a size calculation unit provided in an embodiment of the present application;

[0090] Fig. 9 A schematic diagram of the structure of a size detection unit provided in an embodiment of the present application;

[0091] Fig.10 A schematic diagram of the structure of another device for detecting the size of an electrical connection device provided in an embodiment of the present application;

[0092] Fig.11 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0093] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0094] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0095] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0096] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0097] The embodiment of the present application provides a method for detecting the size of an electrical connection device, which relates to the field of image recognition technology. The method for detecting the size of an electrical connection device provided in the embodiment of the present application can be applied to a terminal, can be applied to a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements the method for detecting the size of an electrical connection device, etc., but is not limited to the above forms.

[0098] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0099] Reference Figure 1 The embodiment of the present application provides a method for detecting the size of an electrical connection device. The method may include but is not limited to S100 to S130, which are as follows:

[0100] S100: Acquire an image of the electrical connection device to be inspected as the current image to be inspected.

[0101] Exemplarily, the electrical connection devices of this embodiment may include a wiring harness, a distribution box, a connector, and other optional electrical connection devices.

[0102] S110: Segment the current image to be inspected into multiple independent images.

[0103] As a further optional implementation, S110 may include:

[0104] The current image to be inspected is divided into a plurality of independent images according to the position of the electrical connection device to be inspected.

[0105] Specifically, the electrical connection device has different structures at different positions. This embodiment can divide the current image to be inspected into multiple independent images according to the positions of each structure.

[0106] S120: Calculating the actual size of the electrical connection component to be inspected according to the grayscale value of each of the independent images.

[0107] Specifically, in this embodiment, each independent image may be smoothed and denoised first, and then converted into a grayscale image, and then the actual size of the electrical connection device may be calculated according to the grayscale value of each grayscale image.

[0108] Reference Figure 2 , further, S120 may include S121 to S123:

[0109] S121: performing grayscale processing on each of the independent images to obtain an image grayscale matrix;

[0110] The image grayscale matrix is:

[0111]

[0112] Among them, f i (x, y) represents the image grayscale matrix, M×N represents the total number of independent images; i=1, 2, 3...k, k=M×N; f i (x,y) is obtained by sampling pixels at equal intervals;

[0113] S122: Calculating the length and width of the current image to be inspected according to the image grayscale matrix as the image size of the current image to be inspected;

[0114] The length α of the current image to be inspected i for:

[0115]

[0116] The width β of the current image to be inspected i for:

[0117]

[0118] S123: Calculating the actual size of the electrical connection device to be inspected according to the image size;

[0119] The actual size of the length p i for:

[0120] p i =a·α i ;

[0121] The actual size of the width q i for:

[0122] q i = b·β i ;

[0123] Wherein, a is the conversion coefficient between the length of the actual size and the length of the image size, and b is the conversion coefficient between the width of the actual size and the width of the image size.

[0124] S130: Detecting whether the actual size of the electrical connection component to be inspected is qualified according to the standard size of the electrical connection component to be inspected.

[0125] Specifically, by comparing the standard size of the electrical connection device to be inspected with the calculated actual size, it is possible to detect whether the actual size of the electrical connection device is qualified.

[0126] Reference Figure 3 , further, S130 may include S131 to S133:

[0127] S131: Calculating a length deviation value according to the length of the standard size and the length of the actual size, and calculating a length deviation value according to the width of the standard size and the width of the actual size;

[0128] The length deviation value Δp is:

[0129] Δp=δ-|p i -X|;

[0130] The width deviation value Δq is:

[0131] Δq=δ-|q i -Y|;

[0132] Wherein, X and Y are the length and width of the standard size respectively, and δ is the allowable error of the actual size of the electrical connection device to be inspected;

[0133] S132: Calculating a deviation index of the electrical connection device to be inspected according to the length deviation value and the length deviation value;

[0134] The deviation index Δw is:

[0135] Δw=Δp·Δq;

[0136] S133: If the deviation index is greater than or equal to 0, the actual size detection of the electrical connection device to be inspected is qualified; if the deviation index is less than 0, the actual size detection of the electrical connection device to be inspected is unqualified.

[0137] As a further implementation, after S130, refer to Figure 4 , the embodiment of the present application may further include S141 and S142:

[0138] S141: If the actual size is unqualified, an alarm is issued.

[0139] Exemplarily, the alarm prompt in this embodiment may be in the form of an audible or visual alarm or a text alarm, as well as other optional forms of alarm prompts.

[0140] S142: If the actual size is qualified, then obtaining an image of the next electrical connection component to be inspected as the current image to be inspected, and performing the step of dividing the current image to be inspected into a plurality of independent images.

[0141] It is understandable that if the current electrical connector to be inspected is qualified, this embodiment can inspect the next electrical connector to be inspected, that is, obtain the image of the next electrical connector to be inspected as the current image to be inspected, and then return to S110, and then continue to execute S120 and S130.

[0142] Next, the solution of the embodiment of the present application will be introduced and explained in conjunction with specific application examples:

[0143] The present embodiment provides a method for detecting the size of electrical connectors, which can realize batch detection of the size of electrical connectors of electric vehicles, and timely detect unqualified electrical connectors, thereby improving the efficiency and accuracy of electrical connector size detection. Specifically, first, an image acquisition system is used to batch acquire image information of electrical connectors as images to be inspected, and then the images to be inspected are divided into multiple independent images according to the positions of the electrical connectors, and each independent image is grayed to obtain multiple grayscale images. The image size and actual size of the electrical connector are calculated according to the grayscale value of the grayscale image, and then the actual size is compared with the standard size, and the size deviation between the actual size and the standard size is calculated to determine whether the actual size of the electrical connector is qualified; if the actual size of the electrical connector is detected to be qualified, the next electrical connector is tested; if the actual size of the electrical connector is detected to be unqualified, an alarm is issued. The step flow chart of this embodiment can be referred to Figure 5 .

[0144] First, in this embodiment, a collection system can be set up to collect images of electrical connection devices. The collection system includes but is not limited to cameras, image sensors, industrial cameras, and clamps for fixing electrical connection devices. Detection points are set. In order to improve the accuracy of detection, the background color of the detection point should have a sufficiently large contrast with the color of the electrical connection device.

[0145] After the acquisition system acquires the image to be inspected, the image to be inspected is sent to the computer for preprocessing. The number of electrical connectors can be set according to the specific situation. For example, the number of electrical connectors to be tested can be M×N. Multiple electrical connectors are photographed to obtain an image to be inspected. The image to be inspected is denoised and smoothed, and then the image to be inspected is segmented according to the position of each electrical connector to obtain M×N independent images corresponding to each electrical connector.

[0146] Grayscale each independent image to obtain the image grayscale matrix f i (x,y):

[0147]

[0148] Among them, i = 1, 2, 3...k, k = M×N; because f i (x,y) samples pixels at equal intervals, so f i (x,y) is an M×N matrix;

[0149] According to the image gray matrix f i (x,y) calculate the length α of the image to be tested i and width β i As image size:

[0150]

[0151]

[0152] Calculate the actual length p of the electrical connection device based on the image size i and the actual width q i As actual size:

[0153] p i =a·α i ;

[0154] q i = b·β i ;

[0155] Wherein, a and b are the conversion coefficients of the actual size of the electrical connection device and the image size.

[0156] Compare the calculated actual length and actual width with the standard dimensions and calculate Δp and Δq:

[0157] Δp=δ-p i -X|;

[0158] Δq=δ-|q i -Y|;

[0159] Among them, X and Y are the length and width of the standard size, δ is the allowable error of the electrical connector size, Δp and Δq are the length deviation and width deviation of the actual size from the standard size, respectively. Δw is the deviation index of the electrical connector:

[0160] Δw=Δp·Δq;

[0161] Check whether the size of the electrical connection device is qualified: if Δw is greater than or equal to 0, the size of the electrical connection device is qualified; if Δw is less than 0, the size of the electrical connection device is unqualified and an alarm is issued. Figure 6 This is the circuit diagram of the alarm device.

[0162] Reference Figure 7 The embodiment of the present application further provides a device for detecting the size of an electrical connection device, which can implement the above-mentioned method for detecting the size of an electrical connection device, and the device includes:

[0163] An image acquisition unit, used for acquiring an image of the electrical connection device to be inspected as a current image to be inspected;

[0164] An image segmentation unit, used for segmenting the current image to be inspected into multiple independent images;

[0165] A size calculation unit, used for calculating the actual size of the electrical connection device to be inspected according to the gray value of each of the independent images;

[0166] The size detection unit is used to detect whether the actual size of the electrical connection device to be tested is qualified according to the standard size of the electrical connection device to be tested.

[0167] In some embodiments, the image segmentation unit includes:

[0168] The image segmentation subunit is used to segment the current image to be inspected into a plurality of independent images according to the position of the electrical connection device to be inspected.

[0169] Reference Figure 8 In some embodiments, the size calculation unit comprises:

[0170] A grayscale processing unit, used for performing grayscale processing on each of the independent images to obtain an image grayscale matrix;

[0171] The image grayscale matrix is:

[0172]

[0173] Among them, f i (x, y) represents the image grayscale matrix, M×N represents the total number of independent images; i=1, 2, 3...k, k=M×N; f i (x,y) is obtained by sampling pixels at equal intervals;

[0174] An image size calculation unit, used for calculating the length and width of the current image to be inspected according to the image gray matrix as the image size of the current image to be inspected;

[0175] The length α of the current image to be inspected i for:

[0176]

[0177] The width β of the current image to be inspected i for:

[0178]

[0179] An actual size calculation unit, used for calculating the actual size of the electrical connection device to be inspected according to the image size;

[0180] The actual size of the length p i for:

[0181] p i =a·α i ;

[0182] The actual size of the width q i for:

[0183] q i = b·β i ;

[0184] Wherein, a is the conversion coefficient between the length of the actual size and the length of the image size, and b is the conversion coefficient between the width of the actual size and the width of the image size.

[0185] Reference Fig. 9 In some embodiments, the size detection unit comprises:

[0186] a deviation value calculation unit, configured to calculate a length deviation value according to the length of the standard size and the length of the actual size, and to calculate a length deviation value according to the width of the standard size and the width of the actual size;

[0187] The length deviation value Δp is:

[0188] Δp=δ-|p i -X|;

[0189] The width deviation value Δq is:

[0190] Δq=δ-|q i -Y|;

[0191] Wherein, X and Y are the length and width of the standard size respectively, and δ is the allowable error of the actual size of the electrical connection device to be inspected;

[0192] a deviation index calculation unit, configured to calculate a deviation index of the electrical connection device to be inspected according to the length deviation value and the length deviation value;

[0193] The deviation index Δw is:

[0194] Δw=Δp·Δq;

[0195] The size detection subunit is used to detect that the actual size of the electrical connection device to be inspected is qualified if the deviation index is greater than or equal to 0; and that the actual size of the electrical connection device to be inspected is unqualified if the deviation index is less than 0.

[0196] Reference Fig.10 In some embodiments, the device further comprises:

[0197] An alarm unit, used for issuing an alarm if the actual size is unqualified;

[0198] The re-inspection unit is used for obtaining the image of the next electrical connection device to be inspected as the current image to be inspected if the actual size is qualified, and executing the step of dividing the current image to be inspected into multiple independent images.

[0199] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0200] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned electrical connection device size detection method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.

[0201] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0202] See also Fig.11 , Fig.11 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0203] The processor 1101 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0204] The memory 1102 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes the electrical connection device size detection method of the embodiment of this application;

[0205] Input / output interface 1103, used to implement information input and output;

[0206] The communication interface 1104 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0207] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);

[0208] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .

[0209] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned electrical connection device size detection method is implemented.

[0210] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0211] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0212] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0213] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0214] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0215] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0216] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. 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.

[0217] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0218] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, 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.

[0219] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0220] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0221] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it 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 all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0222] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for detecting the size of an electrical connection device, It is characterized in that The method comprises the following steps: Acquire an image of the electrical connection device to be inspected as the current image to be inspected; Segmenting the current image to be inspected into multiple independent images; Calculating the actual size of the electrical connection device to be inspected according to the grayscale value of each of the independent images; Whether the actual size of the electrical connection device to be tested is qualified is detected according to the standard size of the electrical connection device to be tested.

2. A method for detecting the size of an electrical connection device according to claim 1, It is characterized in that The step of dividing the current image to be inspected into multiple independent images comprises the following steps: The current image to be inspected is divided into a plurality of independent images according to the position of the electrical connection device to be inspected.

3. A method for detecting the size of an electrical connection device according to claim 1, It is characterized in that The step of calculating the actual size of the electrical connection device to be inspected according to the grayscale value of each of the independent images comprises the following steps: Performing grayscale processing on each of the independent images to obtain an image grayscale matrix; The image grayscale matrix is: Among them, f i (x, y) represents the image grayscale matrix, M×N represents the total number of independent images; i=1, 2, 3...k, k=M×N; f i (x,y) is obtained by sampling pixels at equal intervals; Calculate the length and width of the current image to be inspected according to the image grayscale matrix as the image size of the current image to be inspected; The length α of the current image to be inspected i for: The width β of the current image to be inspected i for: Calculating the actual size of the electrical connection device to be inspected according to the image size; The actual size of the length p i for: p i =a·a i ; The actual size of the width q i for: q i =b·β i ; Wherein, a is the conversion coefficient between the length of the actual size and the length of the image size, and b is the conversion coefficient between the width of the actual size and the width of the image size.

4. A method for detecting the size of an electrical connection device according to claim 3, It is characterized in that The step of detecting whether the actual size of the electrical connection device to be inspected is qualified according to the standard size of the electrical connection device to be inspected comprises the following steps: The length deviation value is calculated based on the length of the standard size and the length of the actual size, and the length deviation value is calculated based on the width of the standard size and the width of the actual size; The length deviation value Δp is: Δp=δ-p i -X|; The width deviation value Δq is: Δq=δ-|q i -Y|; Wherein, X and Y are the length and width of the standard size respectively, and δ is the allowable error of the actual size of the electrical connection device to be inspected; Calculate the deviation index of the electrical connection device to be inspected according to the length deviation value and the length deviation value; The deviation index Δw is: Δw=Δp·Δq; If the deviation index is greater than or equal to 0, the actual size detection of the electrical connection device to be inspected is qualified; if the deviation index is less than 0, the actual size detection of the electrical connection device to be inspected is unqualified.

5. A method for detecting the size of an electrical connection device according to any one of claims 1 to 4, It is characterized in that The method further comprises the following steps: If the actual size is unqualified, an alarm is issued; If the actual size is qualified, the image of the next electrical connection device to be inspected is obtained as the current image to be inspected, and the current image to be inspected is divided into a plurality of independent images.

6. A device for detecting the size of an electrical connection device, It is characterized in that The device comprises: An image acquisition unit, used for acquiring an image of the electrical connection device to be inspected as a current image to be inspected; An image segmentation unit, used for segmenting the current image to be inspected into multiple independent images; A size calculation unit, used for calculating the actual size of the electrical connection device to be inspected according to the gray value of each of the independent images; The size detection unit is used to detect whether the actual size of the electrical connection device to be tested is qualified according to the standard size of the electrical connection device to be tested.

7. The electrical connection device size detection device according to claim 6, It is characterized in that The image segmentation unit comprises: The image segmentation subunit is used to segment the current image to be inspected into a plurality of independent images according to the position of the electrical connection device to be inspected.

8. The electrical connection device size detection device according to claim 6, It is characterized in that The size calculation unit comprises: A grayscale processing unit, used for performing grayscale processing on each of the independent images to obtain an image grayscale matrix; The image grayscale matrix is: Among them, f i (x, y) represents the image grayscale matrix, M×N represents the total number of independent images; i=1, 2, 3...k, k=M×N; f i (x,y) is obtained by sampling pixels at equal intervals; An image size calculation unit, used for calculating the length and width of the current image to be inspected according to the image gray matrix as the image size of the current image to be inspected; The length α of the current image to be inspected i for: The width β of the current image to be inspected i for: An actual size calculation unit, used for calculating the actual size of the electrical connection device to be inspected according to the image size; The actual size of the length p i for: p i =a·a i ; The actual size of the width q i for: q i =b·β i ; Wherein, a is the conversion coefficient between the length of the actual size and the length of the image size, and b is the conversion coefficient between the width of the actual size and the width of the image size.

9. The electrical connection device size detection device according to claim 8, It is characterized in that The size detection unit comprises: a deviation value calculation unit, configured to calculate a length deviation value according to the length of the standard size and the length of the actual size, and to calculate a length deviation value according to the width of the standard size and the width of the actual size; The length deviation value Δp is: Δp=δ-p i -X|; The width deviation value Δq is: Δq=δ-|q i -Y|; Wherein, X and Y are the length and width of the standard size respectively, and δ is the allowable error of the actual size of the electrical connection device to be inspected; a deviation index calculation unit, configured to calculate a deviation index of the electrical connection device to be inspected according to the length deviation value and the length deviation value; The deviation index Δw is: Δw=Δp·Δq; The size detection subunit is used to detect that the actual size of the electrical connection device to be inspected is qualified if the deviation index is greater than or equal to 0; and that the actual size of the electrical connection device to be inspected is unqualified if the deviation index is less than 0.

10. An electrical connection device size detection device according to any one of claims 6 to 9, It is characterized in that The device also includes: An alarm unit, used for issuing an alarm if the actual size is unqualified; The re-inspection unit is used for obtaining the image of the next electrical connection device to be inspected as the current image to be inspected if the actual size is qualified, and executing the step of dividing the current image to be inspected into multiple independent images.

11. An electronic device, It is characterized in that The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method for detecting the size of an electrical connection device according to any one of claims 1 to 5 when executing the computer program.

12. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, a method for detecting the size of an electrical connecting device according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Battery connector quality detecting method based on machine vision

    CN108355981A

  • Hoop part size detection method based on machine vision

    CN115147350A

  • Plate dimension detection method and device, and electronic equipment

    CN116580079A

  • Metal shell optical size detection method and system based on image

    CN117173177A

  • Detection method and device of switch connecting piece, equipment and medium

    CN117876658A