Safety detection method and system for charging gun head
Through the improved OSTU segmentation method, the gray image of the insulating sheath of the charging gun head is obtained, the insulation loss rate is calculated, and the charging gun head is required to be replaced in advance to solve the security problem caused by the reduced insulation performance of the charging gun.
Patent Information
- Application Number
- CN202411929649.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During use, the charging gun may cause abnormal heat, fire or damage to the charging equipment due to its degraded insulation performance during use. The existing detection methods cannot prevent these problems in advance.
The improved Ostu segmentation method is used to obtain the grayscale image of the insulation sheath of the charging gun head, and the insulation loss rate is calculated to determine whether the charging gun head needs to be replaced, so that maintenance and replacement can be carried out in advance.
It can relatively completely retain the information at the edge of the insulating sheath, reflect the degree of wear, and perform maintenance in advance to avoid safety issues caused by reduced insulation performance.
Smart Images

Figure CN119359724A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of safety detection technology, and in particular to a safety detection method and system for a charging gun head. Background Art
[0002] The statements herein merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] During the long-term use of the charging pile, the charging gun on the charging pile needs to be repeatedly plugged and unplugged. At the same time, the charging gun is often placed on the ground. The above processes will cause wear on the insulating sheath at the gun head of the charging gun, thereby affecting the insulation performance of the charging gun, and ultimately cause the charging gun to generate abnormal heat, cause fire or damage the charging equipment due to insufficient insulation strength during use.
[0004] The existing technology usually performs insulation testing on the charging gun at a certain point in time during the charging process. However, when the charging gun is in use, factors such as the temperature of the charging gun at different time periods will affect the insulation performance of the charging gun, resulting in the detection results of this method being unable to ensure that the insulation performance of the charging gun is intact. At the same time, this method can only be used to replace or repair the charging gun after the insulation fails, and cannot provide protection in advance. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a safety detection method and system for charging gun heads. By utilizing the improved Ostu segmentation method to obtain the grayscale image of the insulating sheath of the charging gun head to be detected, the information at the edge of the insulating sheath can be relatively completely retained, reflecting the degree of wear of the charging gun head to be detected, and the charging gun head to be detected can be maintained and replaced in advance.
[0006] A first aspect of the present invention provides a safety detection method for a charging gun head, comprising: Obtain a grayscale image of the charging gun head to be tested and a grayscale sample image of a normal charging gun head; the grayscale image and the grayscale sample image contain information about the connector pins and insulating sheath of the charging gun head; The grayscale image is segmented to obtain a grayscale image of the contour of the charging gun head to be detected, and the grayscale image of the contour is weighted to obtain a weighted grayscale image of the charging gun head to be detected; the weighted grayscale image is segmented by an improved Ostu segmentation method to obtain a grayscale image of the insulating sheath of the charging gun head to be detected; the grayscale image is segmented to obtain the grayscale image of the contour of the charging gun head to be detected, specifically, the local mean and local standard deviation of the grayscale value in the grayscale image are calculated to obtain the Sauvola threshold, and the grayscale image is segmented based on the Sauvola threshold to obtain the grayscale image of the contour of the charging gun head to be detected; The grayscale sample image is processed in the same way to obtain a grayscale sample image of the insulating sheath of a normal charging gun head; The insulation loss rate of the charging gun head to be tested is calculated based on the grayscale image of the insulating sheath and the grayscale sample image of the insulating sheath. According to the preset insulation loss rate, it is determined whether the charging gun head to be tested should be replaced.
[0007] As a further technical solution, the weighted processing of the contour grayscale image to obtain the weighted grayscale image of the charging gun head to be detected is specifically to calculate the local mean of the grayscale values in the contour grayscale image, and binarize the contour grayscale image to obtain a binary image, and calculate the weights of the grayscale values in the contour grayscale image based on the binary image and the local mean, and obtain the weighted grayscale image of the charging gun head to be detected through the contour grayscale image and the weights of the grayscale values in the contour grayscale image.
[0008] As a further technical solution, the improved Ostu segmentation method specifically constructs a two-dimensional histogram of the weighted grayscale image, and constructs two segmentation lines parallel to the diagonal of the two-dimensional histogram and one segmentation line perpendicular to the diagonal of the two-dimensional histogram, and constructs a threshold segmentation line based on the three segmentation lines. The segmentation threshold is obtained by solving the threshold segmentation line and introducing an adjustable shrinkage parameter.
[0009] As a further technical solution, the two segmentation lines parallel to the diagonal line of the two-dimensional histogram are symmetrically distributed on both sides of the diagonal line of the two-dimensional histogram.
[0010] As a further technical solution, the insulation loss rate of the charging gun head to be detected based on the insulating sheath grayscale image and the insulating sheath grayscale sample image is calculated specifically by subtracting the insulating sheath grayscale sample image from the insulating sheath grayscale image to obtain a difference image, and calculating the ratio between the total pixel value of the difference image and the total pixel value of the insulating sheath grayscale sample image to obtain the insulation loss rate of the charging gun head to be detected.
[0011] A second aspect of the present invention provides a safety detection system for a charging gun head, comprising: Image acquisition module: acquires a grayscale image of the charging gun head to be tested and a grayscale sample image of a normal charging gun head; the grayscale image and the grayscale sample image contain information about the connector pins and insulating sheath of the charging gun head; Image processing module: segmenting the grayscale image to obtain the grayscale image of the contour of the charging gun head to be detected, and performing weighted processing on the grayscale image to obtain the weighted grayscale image of the charging gun head to be detected; segmenting the weighted grayscale image by an improved Ostu segmentation method to obtain the grayscale image of the insulating sheath of the charging gun head to be detected; segmenting the grayscale image to obtain the grayscale image of the contour of the charging gun head to be detected is specifically to calculate the local mean and local standard deviation of the grayscale value in the grayscale image to obtain the Sauvola threshold, and segmenting the grayscale image based on the Sauvola threshold to obtain the grayscale image of the contour of the charging gun head to be detected; The grayscale sample image is processed in the same way to obtain a grayscale sample image of the insulating sheath of a normal charging gun head; Replacement determination module: Calculate the insulation loss rate of the charging gun head to be detected based on the grayscale image of the insulating sheath and the grayscale sample image of the insulating sheath, and determine whether the charging gun head to be detected should be replaced based on the preset insulation loss rate.
[0012] As a further technical solution, the insulation loss rate of the charging gun head to be tested is calculated based on the insulating sheath grayscale image and the insulating sheath grayscale sample image, specifically, a difference image is obtained by subtracting the insulating sheath grayscale sample image from the insulating sheath grayscale image.
[0013] As a further technical solution, the ratio between the total pixel value of the difference image and the total pixel value of the insulating sheath grayscale sample image is calculated to obtain the insulation loss rate of the charging gun head to be tested.
[0014] According to a third aspect of the present invention, a computer device is provided, comprising a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the above-mentioned safety detection method for a charging gun head. According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the above-mentioned safety detection method for a charging gun head is implemented.
[0015] Beneficial effects of one or more of the above technical solutions: 1. The present invention uses an improved Ostu segmentation method to obtain a grayscale image of the insulating sheath of the charging gun head to be tested, which can relatively completely retain the detailed information at the edge of the insulating sheath, thereby reflecting the degree of wear of the insulating sheath, and based on the degree of wear to reflect the insulation performance of the charging gun head, thereby determining whether the charging gun head to be tested should be repaired and replaced, thereby ensuring the safety of the charging gun head.
[0016] 2. The present invention does not require testing of the charging gun head when it is in use. At the same time, the charging gun head to be tested can be repaired and replaced in advance according to the degree of wear of the insulating sheath, thereby avoiding abnormal heating, fire or charging equipment damage caused by reduced insulation performance during the use of the charging gun head, and further ensuring the safety of the charging equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings in the specification that constitute a part of this application are used to provide further understanding of the present application. In order to facilitate understanding, the proportions between the structures of each part are adjusted. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute a limitation on the present application.
[0018] Figure 1 The present invention is a flow chart of a safety detection method for a charging gun head.
[0019] Figure 2 This is the principle diagram of the Ostu segmentation method.
[0020] Figure 3 This is a schematic diagram of the threshold segmentation line in the improved Ostu segmentation method of the present invention.
[0021] Figure 4 This is a structural diagram of a photographing device used to obtain a charging gun head to be detected in the present invention.
[0022] Figure 5 It is a side view of the photographing device used to obtain the charging gun head to be inspected in the present invention.
[0023] Among them, 1. Industrial computer, 2. Power module, 3. Visual camera driver module, 4. Spotlight, 5. Fill light spotlight, 6. Visual camera, 7. Fill light. DETAILED DESCRIPTION
[0024] The following is combined with Figure 1-Figure 5 , clearly and completely describe the technical solutions in the embodiments of the present invention.
[0025] Embodiment 1 Reference Figure 1 , a safety detection method for a charging gun head, comprising: S1. Obtain a grayscale image of a charging gun head to be tested and a grayscale sample image of a normal charging gun head.
[0026] Reference Figure 4 The shooting equipment is composed of an industrial computer 1, a power module 2, a visual camera driver module 3, a spotlight 4, and a fill light spotlight 5. Figure 5, and also includes a visual camera 6 and a fill light 7. In this embodiment, the charging gun head is firstly aimed at the fill light condenser 5 of the shooting device, and the digital image of the charging gun head is captured by the visual camera driving module 3 and the visual camera 6, and stored in the industrial computer 1; when in use, the image in the industrial computer 1 is transmitted to the corresponding device for processing.
[0027] When the shooting device is in use, the outline of the charging gun head is roughly the same size as the opening of the fill light spotlight 5, but there is still some background information in the photo after shooting, and the interference of the background information needs to be eliminated in the subsequent processing. At the same time, the spotlight 4 and the fill light 7 increase the brightness of the captured image, making the detailed information of the charging gun head clearer, and at the same time improving the contrast between the charging gun head and the background, so as to facilitate the subsequent image processing.
[0028] Among them, a normal charging gun head refers to a charging gun head that is of the same model as the charging gun head to be tested, is unused and has intact overall performance; and the image of the normal charging gun head can be obtained from an existing charging gun head image database, and can also be obtained through a shooting device.
[0029] After obtaining the images of the charging gun head to be tested and the normal charging gun head, the images are preprocessed. Specifically, the images are first filtered by median filtering to reduce noise interference in the images; then the two images are registered by Fourier-Mellin transform to ensure that the positions of the charging gun heads in the two images are roughly the same; finally, the two images are gray-scaled by Matlab to obtain the gray-scale image of the charging gun head to be tested and the gray-scale sample image of the normal charging gun head.
[0030] At the same time, the images of the charging gun head to be tested and the normal charging gun head are obtained by shooting from the front of the charging gun head, which contain the connector pins and insulating sheath information of the charging gun head; therefore, the grayscale image and grayscale sample image obtained after processing also contain the connector pins and insulating sheath information of the charging gun head.
[0031] S201 , first segment the grayscale image to obtain a grayscale image of the contour of the charging gun head to be detected.
[0032] In this embodiment, the grayscale image of the charging gun head to be detected and the grayscale sample image of a normal charging gun head are processed in the same manner, and the grayscale image of the charging gun head to be detected is taken as an example for description.
[0033] After obtaining the grayscale image, you need to first remove the interference of background information in the image and extract the contour image of the charging gun head. The specific processing method is as follows: First, calculate the local mean of the grayscale value at each pixel in the grayscale image; the calculation formula is as follows: (1) in, is the window size, The coordinates in the grayscale image are The gray value of the pixel, So The local mean centered at .
[0034] The size of the window can be selected as 3×3 or 6×6, and can be adaptively selected according to the proportion of background information in the grayscale image.
[0035] After that, the local standard deviation of the gray value at each pixel in the gray image is calculated; the calculation formula is as follows: (2) in, The same window size is used to calculate the local mean. So The local standard deviation centered at .
[0036] Based on the obtained local mean and local standard deviation, the Sauvola threshold is calculated; the calculation formula is as follows: (3) in, To correct the parameters, is the dynamic range of the local standard deviation, is the Sauvola threshold.
[0037] In this embodiment, Take 0.15, and .
[0038] By setting the above parameters and combining the large pixel difference between the outer edge contour of the insulating sheath in the grayscale image and the background image, it is easy to identify the outer edge contour of the insulating sheath. Then, the grayscale image is segmented by the Sauvola threshold obtained above, so as to separate the background image and the target image, and obtain the grayscale image of the contour of the charging gun head to be detected.
[0039] S202: Perform weighted processing on the contour grayscale image to obtain a weighted grayscale image of the charging gun head to be detected.
[0040] After obtaining the contour grayscale image of the charging gun head to be tested, the image only contains the insulating sheath information and connector pin information of the charging gun head; the purpose of this application is to detect the insulation performance of the insulating sheath of the charging gun head to be tested, but the existence of the connector pin information will affect the judgment of the insulating sheath information, so the interference of the connector pin information needs to be eliminated.
[0041] The connector pins in existing charging gun heads are usually made of copper or copper alloy, and are mainly white in color. However, the materials of the insulating sheath are varied, and there are insulating sheaths in various colors such as brown, black, and gray. This will cause the pixel values between the insulating sheath and the connector pins to be close and difficult to distinguish, thereby affecting the subsequent process of judging the insulation performance of the insulating sheath itself.
[0042] In order to solve this problem, this embodiment adopts the following technical solution: First, the local mean of the grayscale value at each pixel in the contour grayscale image is calculated by the above formula (1), and then To express.
[0043] Then the contour grayscale image is binarized to obtain a binary image. The calculation formula is as follows: (4) in, represents a binary image, Represents the contour in the grayscale image The gray value at Indicates the threshold value.
[0044] The threshold The selection can be adaptively adjusted according to the color of the insulating sheath.
[0045] At the same time, calculate the gray value weight. The calculation formula is as follows: (5) in, For the contour grayscale image The weight of the gray value.
[0046] Based on the obtained gray value weight, a weighted gray image is obtained. The calculation formula is as follows: (6) Since the pixel value of the insulating sheath in the contour grayscale image is greater than the pixel value of the connector pin, the weighted grayscale image obtained , which enhances the contrast between the insulating sheath and the connector pins in the contour grayscale image, thereby highlighting the display of the insulating sheath in the weighted grayscale image, making it easier to subsequently eliminate the influence of the connector pins.
[0047] S203, segmenting the weighted grayscale image by using an improved Ostu segmentation method to obtain a grayscale image of the insulating sheath of the charging gun head to be inspected.
[0048] Reference Figure 2The existing two-dimensional Ostu segmentation method usually constructs a two-dimensional histogram through the image grayscale value and its neighborhood grayscale mean, and divides the two-dimensional histogram into four areas (A, B, C, D) by setting the segmentation threshold. Then, the two areas (A and C) located on the diagonal are analyzed and the segmentation threshold is solved to achieve the segmentation of the original image.
[0049] Taking the insulating sheath (target) and connector pins (background) targeted by this embodiment as an example, a large amount of target information can be retained through the above method; however, this method cannot completely retain the information at the edge of the target, and it is also impossible to completely achieve the segmentation of the target and the background. Background information may still exist in the target image, and target information may still exist in the background image; that is, some target information in areas B, C and D is also not discovered.
[0050] For the scenario of insulating sheath and connector pins, the edge of the insulating sheath on the charging gun head is the area most severely affected by friction loss or damage. Therefore, the information at the edge of the insulating sheath (target) needs to be retained as completely as possible in order to judge the insulation performance of the charging gun head. However, the existing two-dimensional Ostu method cannot achieve this goal.
[0051] In order to segment the insulating sheath information from the weighted grayscale image as much as possible, the existing two-dimensional Ostu segmentation method is improved; the specific scheme is as follows: The total number of pixels in a picture is , gray level is Take the weighted grayscale image of as an example; where Represents a pixel, Pixel The neighborhood mean of and Form a tuple ; Let the binary group The number of occurrences of , then the corresponding probability is .
[0052] in, The calculation formula is as follows: (7) Based on the bigram and the corresponding probability A two-dimensional histogram can be constructed.
[0053] like Figure 3 As shown, assuming that the diagonal of the two-dimensional histogram is , then first construct two parallel to the diagonal of the two-dimensional histogram The dividing line and , and construct a segmentation line perpendicular to the diagonal of the two-dimensional histogram , and based on , and Constructing the threshold segmentation line , and divide the two-dimensional histogram into and Two areas, Areas include The rest of the area is divided into . And the two dividing lines are parallel to the diagonal of the two-dimensional histogram and Symmetrical distribution on the diagonal of a 2D histogram on both sides.
[0054] The threshold dividing line The representation function is as follows: (8) in, For the dividing line and The intercepts on the axes of the two-dimensional histogram, For the dividing line The intercepts on the axes of the 2D histogram.
[0055] Based on the threshold segmentation line shown in formula (8) , you need to first determine The value of , thus determining the dividing line and Because the insulation sheaths of different charging gun heads have different colors and the number of connector pins is also different, The value of can be obtained as follows: Set the threshold and calculate the segmentation line and After division, the dividing line and Areas outside the And diagonal The sum of the pixel values in the two regions is the proportion of the sum of the pixel values in the entire weighted grayscale image. When the proportion is less than the threshold, the division is stopped and the The value of .
[0056] For the selection of threshold, it can be adaptively set according to the color of the insulating sheath and the number of connector pins; at the same time, The value is taken from Towards Incrementally. Through the above method, it is possible to determine the dividing line and The position of the insulating sheath and the connector pins can be further reflected, so as to facilitate the subsequent accurate segmentation of the weighted grayscale image while retaining the edge information, and extract the target information from the background information.
[0057] After confirming The value and dividing line and After the position, you need to determine the dividing line location. , and Constructed threshold segmentation line , divide the two-dimensional histogram into and Two regions; represents the image information of the insulating sheath (target), while the area Image information representing the connector pins (background).
[0058] Among them, the area and Region The probability expression formula is as follows: (9) (10) The region and Region The corresponding mean vector is expressed as follows: (11) (12) The total mean vector of the two-dimensional histogram is expressed as follows: (13) (14) Then the difference matrix between classes is defined as: (15) use The trace of is used as the discreteness measure function, which is expressed as follows: (16) Among them, solving the optimal threshold , so that Take the maximum value.
[0059] The dividing line Then the optimal threshold , and among them , thus determining the dividing line The optimal threshold is determined.
[0060] Since the image after the optimal threshold cutting may still contain a mixture of target information and background information, an adjustable shrinkage parameter is introduced , and obtain the final segmentation threshold , and the representation is as follows: (17) Among them, the adjustable shrinkage parameter The value range is between, when When it is a positive number, it indicates a compact and significant area, corresponding to the boundary between the insulating sheath and the connector pin; When it is negative, it means loose salient areas, representing other areas. By introducing an adjustable shrinkage parameter , so that the weighted grayscale image can be further segmented and the grayscale image of the insulating sheath of the charging gun head to be detected can be obtained.
[0061] The threshold dividing line planned above , so that the doped insulating sheath (target) and the connector pin (background) information can be re-divided and divided into their own areas, and the boundary detail information of the insulating sheath (target) can be retained; at the same time, according to the added adjustable shrinkage parameter ,The weighted grayscale image is further segmented to preserve the integrity of the insulating sheath (target) information.
[0062] S204: Process the grayscale sample image in the same manner to obtain a grayscale sample image of the insulating sheath of a normal charging gun head.
[0063] In order to ensure that the grayscale image of the insulating sheath of the charging gun head to be tested and the grayscale sample image of the insulating sheath of the normal charging gun head will not be interfered by other external factors, the image of the normal charging gun head is processed in the same way, and the grayscale sample image of the insulating sheath of the normal charging gun head is obtained, so as to accurately judge the insulation performance of the charging gun head to be tested later.
[0064] S3. Calculate the insulation loss rate of the charging gun head to be tested based on the insulation sheath grayscale image and the insulation sheath grayscale sample image, and determine whether the charging gun head to be tested should be replaced according to the preset insulation loss rate.
[0065] Based on the acquired insulating sheath grayscale image and the insulating sheath grayscale sample image, a difference image between the two images is obtained by subtracting the insulating sheath grayscale image from the insulating sheath grayscale sample image.
[0066] Among them, the wear of the insulating sheath on the head of the charging gun to be tested will cause the pixel value in the grayscale image of the insulating sheath to decrease. Based on the acquired difference image, the pixel value reduced by the loss of the insulating sheath can be reflected. At the same time, the wear of the insulating sheath on the charging gun to be tested can be reflected through the lost pixel value.
[0067] Afterwards, the sum of the pixel values in the difference image is calculated, and the sum of the pixel values in the grayscale sample image of the insulating sheath is calculated at the same time. By comparing the two pixel value sums, the proportion of the sum of the pixel values in the difference image to the sum of the pixel values in the grayscale sample image of the insulating sheath is obtained; and this also indicates the degree of wear of the insulating sheath, which is equivalent to the loss rate of the insulating sheath in the charging gun head to be tested.
[0068] By comparing the loss rate with a preset threshold, when the loss rate exceeds the threshold, it is determined that the insulation performance of the insulating sheath in the current charging gun head to be tested cannot maintain the continued use of the charging gun head, and the charging gun head to be tested is repaired or replaced.
[0069] The preset threshold value may be set according to different types of charging gun heads; in this embodiment, the preset threshold value is 10%.
[0070] Through the above method, not only the insulation performance of the charging gun head to be tested is completed, but also the problems of heating and fire in the charging gun head can be avoided, thus ensuring the safe operation of the charging pile.
[0071] Embodiment 2 A second aspect of the present invention provides a safety detection system for a charging gun head, comprising: Image acquisition module: acquires a grayscale image of the charging gun head to be tested and a grayscale sample image of a normal charging gun head; the grayscale image and the grayscale sample image contain information about the connector pins and insulating sheath of the charging gun head; Image processing module: segment the grayscale image to obtain the contour grayscale image of the charging gun head to be detected, and perform weighted processing on the contour grayscale image to obtain the weighted grayscale image of the charging gun head to be detected; segment the weighted grayscale image by the improved Otsu segmentation method to obtain the grayscale image of the insulating sheath of the charging gun head to be detected; The grayscale sample image is processed in the same way to obtain a grayscale sample image of the insulating sheath of a normal charging gun head; Replacement determination module: Calculate the insulation loss rate of the charging gun head to be detected based on the grayscale image of the insulating sheath and the grayscale sample image of the insulating sheath, and determine whether the charging gun head to be detected should be replaced based on the preset insulation loss rate.
[0072] Embodiment 3 The purpose of this embodiment is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program. Embodiment 4 The purpose of this embodiment is to provide a computer-readable storage medium.
[0073] A computer-readable storage medium stores a computer program, which executes the steps of the above method when executed by a processor.
[0074] The steps involved in the apparatuses of the above embodiments 2, 3 and 4 correspond to the method embodiment 1, and the specific implementation methods can refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.
[0075] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0076] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A safety detection method for a charging gun head, characterized in that: The steps include: Obtain a grayscale image of the charging gun head to be tested and a grayscale sample image of a normal charging gun head; the grayscale image and the grayscale sample image contain information about the connector pins and insulating sheath of the charging gun head; The grayscale image is segmented to obtain a grayscale image of the contour of the charging gun head to be detected, and the grayscale image of the contour is weighted to obtain a weighted grayscale image of the charging gun head to be detected; the weighted grayscale image is segmented by an improved Ostu segmentation method to obtain a grayscale image of the insulating sheath of the charging gun head to be detected; the grayscale image is segmented to obtain the grayscale image of the contour of the charging gun head to be detected, specifically, the local mean and local standard deviation of the grayscale value in the grayscale image are calculated to obtain the Sauvola threshold, and the grayscale image is segmented based on the Sauvola threshold to obtain the grayscale image of the contour of the charging gun head to be detected; The grayscale sample image is processed in the same way to obtain a grayscale sample image of the insulating sheath of a normal charging gun head; The insulation loss rate of the charging gun head to be tested is calculated based on the grayscale image of the insulating sheath and the grayscale sample image of the insulating sheath. According to the preset insulation loss rate, it is determined whether the charging gun head to be tested should be replaced.
2. A safety detection method for a charging gun head according to claim 1, characterized in that: The weighted processing of the contour grayscale image to obtain the weighted grayscale image of the charging gun head to be detected is specifically as follows: calculating the local mean of the grayscale values in the contour grayscale image, binarizing the contour grayscale image to obtain a binary image, calculating the weights of the grayscale values in the contour grayscale image based on the binary image and the local mean, and obtaining the weighted grayscale image of the charging gun head to be detected through the contour grayscale image and the weights of the grayscale values in the contour grayscale image.
3. A safety detection method for a charging gun head as claimed in claim 1, characterized in that: The improved Ostu segmentation method specifically comprises the following steps: constructing a two-dimensional histogram of a weighted grayscale image, and constructing two segmentation lines parallel to the diagonal of the two-dimensional histogram and one segmentation line perpendicular to the diagonal of the two-dimensional histogram; constructing a threshold segmentation line based on the three segmentation lines; and obtaining a segmentation threshold by solving the threshold segmentation line and introducing an adjustable shrinkage parameter.
4. A safety detection method for a charging gun head as claimed in claim 3, characterized in that: The two segmentation lines parallel to the diagonal line of the two-dimensional histogram are symmetrically distributed on both sides of the diagonal line of the two-dimensional histogram.
5. A safety detection method for a charging gun head as claimed in claim 1, characterized in that: The method of calculating the insulation loss rate of the charging gun head to be detected based on the insulating sheath grayscale image and the insulating sheath grayscale sample image is specifically as follows: a difference image is obtained by subtracting the insulating sheath grayscale sample image from the insulating sheath grayscale image, and the ratio between the total pixel value of the difference image and the total pixel value of the insulating sheath grayscale sample image is calculated to obtain the insulation loss rate of the charging gun head to be detected.
6. A safety detection system for a charging gun head, characterized in that: include: Image acquisition module: acquires a grayscale image of the charging gun head to be tested and a grayscale sample image of a normal charging gun head; the grayscale image and the grayscale sample image contain information about the connector pins and insulating sheath of the charging gun head; Image processing module: segmenting the grayscale image to obtain the grayscale image of the contour of the charging gun head to be detected, and performing weighted processing on the grayscale image to obtain the weighted grayscale image of the charging gun head to be detected; segmenting the weighted grayscale image by an improved Ostu segmentation method to obtain the grayscale image of the insulating sheath of the charging gun head to be detected; segmenting the grayscale image to obtain the grayscale image of the contour of the charging gun head to be detected is specifically to calculate the local mean and local standard deviation of the grayscale value in the grayscale image to obtain the Sauvola threshold, and segmenting the grayscale image based on the Sauvola threshold to obtain the grayscale image of the contour of the charging gun head to be detected; The grayscale sample image is processed in the same way to obtain a grayscale sample image of the insulating sheath of a normal charging gun head; Replacement determination module: Calculate the insulation loss rate of the charging gun head to be detected based on the grayscale image of the insulating sheath and the grayscale sample image of the insulating sheath, and determine whether the charging gun head to be detected should be replaced based on the preset insulation loss rate.
7. A safety detection system for a charging gun head as claimed in claim 6, characterized in that: The step of calculating the insulation loss rate of the charging gun head to be detected based on the insulating sheath grayscale image and the insulating sheath grayscale sample image is specifically to obtain a difference image by subtracting the insulating sheath grayscale sample image from the insulating sheath grayscale image.
8. A safety detection system for a charging gun head as claimed in claim 7, characterized in that: The ratio between the total pixel value of the difference image and the total pixel value of the insulating sheath grayscale sample image is calculated to obtain the insulation loss rate of the charging gun head to be tested.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method described in any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 5 are performed.
Citation Information
Patent Citations
Heart's left ventricle image segmentation system and method
CN105741310A
An EM multi-threshold image segmentation method and device based on a histogram
CN109712146A
Leaf feature extraction method and device, computer equipment and storage medium
CN114299299A
Charging gun detection method and device for operating charging pile
CN114445627A
Code recognition method, device and equipment for reinforcing steel bars and storage medium
CN119107652A
Cited By
Control method of charging gun plug terminal production equipment, equipment and medium
CN121552145A