Cable insulation thickness measuring method and system based on alternating curvature driving algorithm

The cable insulation thickness measurement method based on the alternating curvature driving algorithm solves the problems of low accuracy and long time consumption of traditional detection methods for irregular cables, and realizes rapid and accurate measurement of cable insulation thickness.

CN121074007APending Publication Date: 2025-12-05GUANGDONG MAOMING QUALITY METROLOGY SUPERVISION & INSPECTION INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511355632.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Traditional methods for detecting cable insulation thickness are suitable for samples with approximately circular cross-sections. When detecting irregular cables, they have low accuracy and are time-consuming, making it difficult to meet the real-time requirements of large-scale automated rapid testing.

Method used

By employing an alternating curvature-driven algorithm, the system receives cable insulation thickness measurement commands, acquires cross-sectional images of the cable, extracts inner and outer edge contours, constructs an inner and outer edge curvature gene database, generates an initial population, obtains the optimal fitness set, and achieves accurate measurement of cable insulation thickness.

Benefits of technology

It shortens the average inspection time, improves the minimum insulation thickness deviation, and enhances the accuracy and efficiency of inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121074007A_ABST
    Figure CN121074007A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cable insulation thickness measurement, in particular to a cable insulation thickness measurement method and system based on an alternating curvature driving algorithm, and the method comprises the steps: collecting a cable cross section image, extracting an inner edge contour and an outer edge contour from the cable cross section image, obtaining an inner edge pixel coordinate set and an outer edge pixel coordinate set, respectively importing the inner edge pixel coordinate set and the outer edge pixel coordinate set into two pre-constructed blank arrays to obtain an inner edge pixel coordinate array and an outer edge pixel coordinate array, constructing an inner edge curvature gene database and an outer edge curvature gene database, generating an inner edge initial population and an outer edge initial population, and constructing an inner edge curvature gene database and an outer edge curvature gene database; and obtaining an optimal inner adaptation degree set and an optimal outer adaptation degree set, obtaining an optimal insulation thickness measurement coordinate set, and completing cable insulation thickness measurement based on the alternating curvature driving algorithm based on the optimal insulation thickness measurement coordinate set. According to the invention, the average detection time can be shortened and the minimum insulation thickness deviation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cable insulation thickness measurement, in particular to a cable insulation thickness measurement method and system based on an alternating curvature driving algorithm. BACKGROUND

[0002] The alternating curvature driving algorithm is an algorithm used in the field of image processing and computer vision, mainly used for image segmentation, edge detection, etc. It simulates the evolution process of a curve, making the curve gradually approach the boundary of the target object. Cable insulation thickness measurement refers to the process of measuring the thickness of the cable insulation layer.

[0003] Although there have been a large number of studies on the application of heuristic algorithms combined with computer vision technology, there are still some limitations in the field of cable insulation layer thickness detection. Traditional detection methods are only suitable for samples with approximately circular cross-sections, and significant measurement deviations may occur when detecting irregular cables, resulting in low accuracy and limited generalization ability. Secondly, the detection time is relatively long, making it difficult to meet the real-time requirements of large-scale automated rapid detection. Therefore, how to shorten the average detection time and improve the minimum insulation thickness deviation is a technical problem that needs to be solved. SUMMARY

[0004] The present application provides a cable insulation thickness measurement method based on an alternating curvature driving algorithm and a computer readable storage medium, which aims to shorten the average detection time and improve the minimum insulation thickness deviation.

[0005] To achieve the above-mentioned purpose, the present application provides a cable insulation thickness measurement method based on an alternating curvature driving algorithm, which comprises: receiving a cable insulation thickness measurement instruction, collecting a cable cross-section image according to the cable insulation thickness measurement instruction, and extracting an inner edge contour and an outer edge contour from the cable cross-section image; obtaining an inner edge pixel coordinate set and an outer edge pixel coordinate set according to the inner edge contour and the outer edge contour, and importing the inner edge pixel coordinate set and the outer edge pixel coordinate set into two pre-constructed empty array respectively to obtain an inner edge pixel coordinate array and an outer edge pixel coordinate array; constructing an inner edge curvature gene database and an outer edge curvature gene database according to the inner edge pixel coordinate array and the outer edge pixel coordinate array; generating an inner edge initial population and an outer edge initial population according to the inner edge curvature gene database and the outer edge curvature gene database; obtaining an optimal inner fitness set and an optimal outer fitness set according to the inner edge initial population and the outer edge initial population; obtaining an optimal insulation thickness measurement coordinate set based on the optimal inner fitness set and the optimal outer fitness set, and completing the cable insulation thickness measurement based on the alternating curvature driving algorithm based on the optimal insulation thickness measurement coordinate set.

[0006] Optionally, the constructing the inner edge curvature gene database and the outer edge curvature gene database according to the inner edge pixel coordinate array and the outer edge pixel coordinate array comprises: obtaining a set of scaling factors, wherein the set of scaling factors comprises a small-scale scaling factor, a medium-scale scaling factor and a large-scale scaling factor; extracting the scaling factors from the set of scaling factors in sequence, and segmenting the inner edge pixel coordinate array by using the scaling factors to obtain a set of segmented inner pixel coordinate groups, wherein the set of segmented inner pixel coordinate groups comprises a plurality of segmented inner pixel coordinate groups, and each segmented inner pixel coordinate group comprises a plurality of segmented inner pixel coordinates; extracting the segmented inner pixel coordinate groups from the set of segmented inner pixel coordinate groups in sequence, and obtaining the intermediate inner edge pixel coordinates from the segmented inner pixel coordinate groups; calculating a midpoint curvature value according to the intermediate inner edge pixel coordinates, and collecting the midpoint curvature values to obtain a set of midpoint curvature values corresponding to the set of segmented inner pixel coordinate groups, wherein the set of midpoint curvature values comprises a plurality of midpoint curvature values, and each midpoint curvature value corresponds to a segmented inner pixel coordinate group; normalizing each midpoint curvature value in the set of midpoint curvature values to obtain a set of normalized curvature values, extracting the normalized curvature values from the set of normalized curvature values in sequence, and confirming a target segmented inner pixel coordinate group from the set of segmented inner pixel coordinate groups according to the normalized curvature values; assigning each target segmented inner pixel coordinate in the target segmented inner pixel coordinate group by using the normalized curvature value to obtain an initial assigned inner pixel coordinate group; collecting the initial assigned inner pixel coordinate groups to obtain a set of initial assigned inner pixel coordinate groups, and collecting the set of initial assigned inner pixel coordinate groups to obtain a plurality of sets of initial assigned inner pixel coordinate groups corresponding to the set of scaling factors, wherein each scaling factor corresponds to a set of initial assigned inner pixel coordinate groups; integrating the plurality of sets of initial assigned inner pixel coordinate groups to obtain an assigned inner edge pixel coordinate set, and calculating a set of curvature variation amounts according to the assigned inner edge pixel coordinate set, wherein the set of curvature variation amounts comprises a plurality of curvature variation amounts, and each assigned inner edge pixel coordinate corresponds to a curvature variation amount; confirming an updated inner edge pixel coordinate set based on the set of curvature variation amounts and the assigned inner edge pixel coordinate set, constructing the inner edge curvature gene database based on the updated inner edge pixel coordinate set, and constructing the outer edge curvature gene database based on the outer edge pixel coordinate array.

[0007] Optionally, the calculating the midpoint curvature value according to the intermediate inner edge pixel coordinates comprises: obtaining a coordinate index corresponding to the intermediate inner edge pixel coordinates, and performing a plus-one minus-one operation on the coordinate index respectively to obtain a plus-one coordinate index and a minus-one coordinate index; The pre-internal edge pixel coordinate and the post-internal edge pixel coordinate are determined according to the plus one coordinate index and the minus one coordinate index; The first-order difference and the second-order difference are calculated according to the pre-internal edge pixel coordinate and the post-internal edge pixel coordinate, wherein the first-order difference comprises a first-order difference in the x direction and a first-order difference in the y direction, and the second-order difference comprises a second-order difference in the x direction and a second-order difference in the y direction; The midpoint curvature value is calculated according to the first-order difference and the second-order difference, and a calculation formula of the midpoint curvature value is as follows: wherein, the midpoint curvature value is represented by, the first-order difference in the x direction is represented by, the second-order difference in the y direction is represented by, the first-order difference in the y direction is represented by, the second-order difference in the x direction is represented by.

[0008] Optionally, the generating the internal edge initial population and the external edge initial population according to the internal edge curvature gene database and the external edge curvature gene database comprises: The updated internal edge pixel coordinates are sequentially extracted from the internal edge curvature gene database, and the target curvature change amount and the target normalized curvature value set are determined according to the updated internal edge pixel coordinates; The comprehensive curvature factor is calculated according to the preset weight parameter set, the target curvature change amount and the target normalized curvature value set, the comprehensive curvature factors are summarized, and a comprehensive curvature factor set is obtained, wherein the weight parameter set comprises a plurality of weight parameters; The comprehensive curvature factor sum is calculated according to the comprehensive curvature factor set, and the initial population individual probability set is calculated according to the comprehensive curvature factor sum and the updated internal edge pixel coordinate set, wherein the initial population individual probability set comprises a plurality of initial population individual probabilities, and the initial population individual probability corresponds to the updated internal edge pixel coordinate in one-to-one manner; The initial population individual probability set is introduced into the pre-constructed blank probability distribution list to obtain an internal edge probability distribution list, and a weighted random sampling operation is performed on the internal edge probability distribution list to obtain the internal edge initial population; The external edge initial population is generated based on the external edge curvature gene database, wherein the internal edge initial population comprises a plurality of updated internal edge pixel coordinate indexes, and the external edge initial population comprises a plurality of updated external edge pixel coordinate indexes.

[0009] Optionally, the obtaining the optimal internal fitness set and the optimal external fitness set according to the internal edge initial population and the external edge initial population comprises: The target inner pixel coordinate set is determined according to the plurality of updated inner edge pixel coordinate indexes in the inner edge initial population, and the target outer pixel coordinate set is determined according to the plurality of updated outer edge pixel coordinate indexes in the outer edge initial population; The target inner pixel coordinate set is determined according to the plurality of updated inner edge pixel coordinate indexes in the inner edge initial population, and the target outer pixel coordinate set is determined according to the plurality of updated outer edge pixel coordinate indexes in the outer edge initial population; The insulating thickness set is obtained by calculating the insulating thickness of each insulating thickness measurement point in the insulating thickness measurement point set, wherein the insulating thickness is the Euclidean distance between the target inner pixel coordinate and the target outer pixel coordinate in the insulating thickness measurement point; The optimal insulating thickness is determined from the insulating thickness set, and the optimal inner fitness is calculated according to the optimal insulating thickness, wherein the optimal inner fitness is the reciprocal of the optimal insulating thickness; The optimal inner fitness set corresponding to the target inner pixel coordinate set is obtained by summarizing the optimal inner fitness, and the optimal outer fitness set is obtained based on the target outer pixel coordinate set.

[0010] Optionally, the optimal insulating thickness measurement coordinate set is obtained based on the optimal inner fitness set and the optimal outer fitness set, comprising: The current operation edge flag bit and the measurement point counter are set, wherein the current operation edge flag bit includes true and false, and the initial value of the measurement point counter is 0; When it is determined that the current operation edge flag bit is true, the adaptive crossover operation is performed on the inner edge initial population to obtain the inner edge population gene sequence, and the adaptive mutation operation is performed on the inner edge population gene sequence to obtain the updated inner edge population sequence; The updated inner edge population sequence is mixed and paired with the outer edge pixel coordinate array to obtain a mixed pairing group set, and the candidate insulating thickness measurement coordinate is obtained based on the mixed pairing group set; The inner edge pixel removal number and the outer edge pixel removal number are respectively calculated according to the preset removal proportion, the inner edge pixel coordinate array and the outer edge pixel coordinate array; The optimized inner edge pixel coordinate array and the optimized outer edge pixel coordinate array are obtained based on the candidate insulating thickness measurement coordinate, the inner edge pixel removal number, the outer edge pixel removal number, the inner edge pixel coordinate array and the outer edge pixel coordinate array; The updated outer edge initial population is obtained based on the optimized outer edge pixel coordinate array, and the add-one operation is performed on the measurement point counter to obtain the updated measurement point counter; Switching the current operation edge flag, obtaining the switching operation edge flag with the operation edge flag being false, performing adaptive crossover mutation operation on the updated outer edge initial population and the optimized inner edge pixel coordinate array, obtaining the candidate insulation thickness measurement coordinate, the second inner edge pixel coordinate array and the second outer edge pixel coordinate array; Performing plus one operation on the updated measurement point counter, obtaining the second updated measurement point counter, taking the second updated measurement point counter as the measurement point counter, obtaining the second inner edge initial population based on the second inner edge pixel coordinate array, taking the second inner edge initial population and the second outer edge pixel coordinate array as the inner edge initial population and the outer edge pixel coordinate array respectively; Returning to the step of confirming that the current operation edge flag is true until the value of the measurement point counter is greater than or equal to 6; Summarizing the candidate insulation thickness measurement coordinate and the candidate insulation thickness measurement coordinate, obtaining the optimal insulation thickness measurement coordinate set.

[0011] Optionally, the adaptive crossover operation on the inner edge initial population to obtain the inner edge population gene sequence comprises: According to the inner edge initial population and the optimal inner fitness set, obtaining the identified inner edge initial population, grouping the identified inner edge initial population two by two to obtain the inner population group set, wherein the inner population group set comprises: a plurality of inner population groups, and each inner population group comprises two inner edge pixel coordinates. Performing the following operations on each inner population group in the inner population group set: According to the inner population group, obtaining the maximum crossover probability, generating a random crossover probability, and comparing the random crossover probability with the maximum crossover probability; If the maximum crossover probability is less than or equal to the random crossover probability, the inner population group is taken as a reserved inner population group; If the maximum crossover probability is greater than the random crossover probability, performing crossover operation on the inner population group to obtain an optimized inner population group; Respectively summarizing the reserved inner population group and the optimized inner population group to obtain the reserved inner population group set and the optimized inner population group set, and importing the reserved inner population group set and the optimized inner population group set into the pre-constructed blank gene sequence to obtain the inner edge population gene sequence.

[0012] Optionally, the obtaining of the identified inner edge initial population according to the inner edge initial population and the optimal inner fitness set comprises: According to the inner edge initial population and the optimal inner fitness set, confirming the highest inner fitness, the lowest inner fitness and the average fitness; According to the inner edge curvature gene database, confirming the maximum curvature factor, sequentially extracting the updated inner edge pixel coordinate index from the inner edge initial population, and according to the updated inner edge pixel coordinate index, confirming the target inner fitness from the inner edge curvature gene database; The crossover probability is calculated according to the highest internal fitness, the lowest internal fitness, the average fitness, the target internal fitness and the maximum curvature factor, and the calculation formula of the crossover probability is as follows: wherein, represents the crossover probability, , , , and all represent preset crossover fitness coefficients, represents the target internal fitness, represents the average fitness, represents the highest internal fitness, represents the lowest internal fitness, represents the maximum curvature factor. The crossover probabilities are summarized to obtain a crossover probability set, each updated internal edge pixel coordinate in the initial internal edge population is identified by using the crossover probability set, and an identified initial internal edge population is obtained.

[0013] Optionally, the crossover operation is performed on the internal population group to obtain an optimized internal population group, including: The first pixel index value and the second pixel index value are obtained according to two internal edge pixel coordinates in the internal population group, the first pixel index value and the second pixel index value are respectively subjected to pixel index value conversion by using a preset fixed number of bits, and the first binary Gray code sequence and the second binary Gray code sequence are obtained; The first binary Gray code sequence and the second binary Gray code sequence are respectively segmented to obtain a first segmentation sequence set and a second segmentation sequence set, wherein the first segmentation sequence set includes a first segmentation front sequence, a first segmentation middle sequence and a first segmentation rear sequence, and the second segmentation sequence set includes a second segmentation front sequence, a second segmentation middle sequence and a second segmentation rear sequence; The first segmentation middle sequence and the second segmentation middle sequence are exchanged to obtain a first exchanged Gray code sequence and a second exchanged Gray code sequence; The first exchanged Gray code sequence and the second exchanged Gray code sequence are respectively subjected to decimal decoding to obtain a first decoded index value and a second decoded index value, and an effective index value interval is obtained; If the first decoded index value and the second decoded index value are both located in the effective index value interval, the first decoded index value and the second decoded index value are confirmed as the optimized internal population group; Otherwise, the boundary correction operation is performed on the first decoded index value or the second decoded index value to obtain the optimized internal population group.

[0014] To achieve the above object, the application further provides a cable insulation thickness measuring system based on an alternating curvature driving algorithm, comprising: An edge profile extraction module is configured to receive a cable insulation thickness measuring instruction, collect a cable cross-section image according to the cable insulation thickness measuring instruction, and extract an inner edge profile and an outer edge profile from the cable cross-section image. An inner-outer pixel coordinate acquisition module is configured to acquire an inner edge pixel coordinate set and an outer edge pixel coordinate set according to the inner edge profile and the outer edge profile, and introduce the inner edge pixel coordinate set and the outer edge pixel coordinate set into two pre-constructed empty arrays respectively to obtain an inner edge pixel coordinate array and an outer edge pixel coordinate array. A curvature gene database construction module is configured to construct an inner edge curvature gene database and an outer edge curvature gene database according to the inner edge pixel coordinate array and the outer edge pixel coordinate array. An optimal insulation thickness measuring module is configured to generate an inner edge initial population and an outer edge initial population according to the inner edge curvature gene database and the outer edge curvature gene database, acquire an optimal inner fitness set and an optimal outer fitness set according to the inner edge initial population and the outer edge initial population, acquire an optimal insulation thickness measuring coordinate set based on the optimal inner fitness set and the optimal outer fitness set, and complete the cable insulation thickness measurement based on the alternating curvature driving algorithm based on the optimal insulation thickness measuring coordinate set.

[0015] To solve the above problems, the application further provides an electronic device, which comprises: A memory is configured to store at least one instruction. A processor is configured to execute the instruction stored in the memory to implement the cable insulation thickness measuring method based on the alternating curvature driving algorithm.

[0016] To solve the above problems, the application further provides a computer readable storage medium, which stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the cable insulation thickness measuring method based on the alternating curvature driving algorithm.

[0017] The present application is to solve the problems described in the background art, the present application receives the cable insulation thickness measurement instruction, acquires the cable cross-section image according to the cable insulation thickness measurement instruction, extracts the inner edge contour and the outer edge contour from the cable cross-section image, the insulation layer of the cable is located between the inner edge and the outer edge, accurately extracting the inner and outer edge contours is the key prerequisite for subsequent accurate calculation of the insulation thickness, only by clearly defining the inner and outer edges can the accuracy of subsequent measurement be ensured, the inner edge pixel coordinate set and the outer edge pixel coordinate set are obtained according to the inner edge contour and the outer edge contour, the inner edge pixel coordinate set and the outer edge pixel coordinate set are respectively introduced into the two empty distance arrays pre-constructed, and the inner edge pixel coordinate array and the outer edge pixel coordinate array are obtained, the present application extracts the pixel coordinate information of the inner and outer edges from the image data and arranges it into an array form, so that the data is more structured and ordered, the inner edge curvature gene database and the outer edge curvature gene database are constructed according to the inner edge pixel coordinate array and the outer edge pixel coordinate array, the curvature is an important feature for describing the bending degree of a curve, by calculating the curvature of the inner and outer edges and constructing the curvature gene database, the geometric characteristics of the cable edge are quantified, these curvature data can reflect the local shape information of the inner and outer edges of the cable, and provide more rich feature information for the subsequent optimization algorithm, the inner edge initial population and the outer edge initial population are generated according to the inner edge curvature gene database and the outer edge curvature gene database, the generation of the initial population of the present application is based on the curvature gene database, which means that in the process of searching for the optimal solution, the algorithm can fully utilize the curvature characteristics of the cable edge, so that the search direction is more targeted, the unnecessary search space is reduced, and the search efficiency is improved, the optimal inner fitness set and the optimal outer fitness set are obtained according to the inner edge initial population and the outer edge initial population, the fitness of the present application is an index for measuring the advantages and disadvantages of each individual in the population, by calculating the fitness of the inner and outer edge initial populations and screening out the optimal inner fitness set and the optimal outer fitness set, the edge characteristics most consistent with the actual situation of the cable can be found, the optimal insulation thickness measurement coordinate set is obtained based on the optimal inner fitness set and the optimal outer fitness set, the optimal insulation thickness measurement coordinate set is obtained after a series of optimization steps, these coordinates can accurately reflect the positions of the inner and outer edges of the cable, so as to realize the accurate measurement of the insulation thickness of the cable, compared with the traditional measurement method, the algorithm can consider the curvature change and other factors of the cable edge, and the measurement result is more accurate and reliable, the cable insulation thickness measurement based on the alternating curvature driving algorithm is completed based on the optimal insulation thickness measurement coordinate set. Therefore, the present application can shorten the average detection time and improve the minimum insulation thickness deviation. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 The flowchart of the cable insulation thickness measurement method based on the alternating curvature driving algorithm provided by an embodiment of the present application is shown in the figure; Figure 2A functional module diagram of a cable insulation thickness measurement system based on an alternating curvature driving algorithm is provided in an embodiment of the present application. Figure 3 A structural schematic diagram of an electronic device for implementing the cable insulation thickness measurement method based on the alternating curvature driving algorithm is provided in an embodiment of the present application.

[0019] Label explanations are as follows: 1, electronic device; 10, processor; 11, memory; 12, bus.

[0020] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0021] It should be understood that the specific embodiments described herein are merely intended to explain the present application and are not intended to limit the present application.

[0022] An embodiment of the present application provides a cable insulation thickness measurement method based on an alternating curvature driving algorithm. The execution subject of the cable insulation thickness measurement method based on the alternating curvature driving algorithm includes but is not limited to at least one of electronic devices such as a server, a terminal, etc., which can be configured to execute the method provided in the embodiment of the present application. In other words, the cable insulation thickness measurement method based on the alternating curvature driving algorithm can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0023] Referring to Figure 1 A flowchart of the cable insulation thickness measurement method based on the alternating curvature driving algorithm is provided in an embodiment of the present application. In the embodiment, the cable insulation thickness measurement method based on the alternating curvature driving algorithm includes: S1, receiving a cable insulation thickness measurement instruction, collecting a cable cross-section image according to the cable insulation thickness measurement instruction, and extracting an inner edge contour and an outer edge contour from the cable cross-section image.

[0024] It should be explained that the cable insulation thickness measurement instruction refers to the instruction issued by the operator to trigger the cable insulation thickness measurement system to start working. The cable cross-section image collected according to the cable insulation thickness measurement instruction refers to using a high-resolution optical camera to collect a cable cross-section image when the cable insulation thickness measurement instruction is received. The cable cross-section image refers to the image obtained by cutting the cable and shooting its cross-section. The inner edge contour refers to the shape of the edge on the inner side of the cable insulation layer, and in the cable cross-section image, the inner edge contour is the boundary of the insulation layer close to the cable conductor. The outer edge contour refers to the shape of the edge on the outer side of the cable insulation layer, and the boundary of the insulation layer close to the cable sheath. The inner edge contour and the outer edge contour extracted from the cable cross-section image refer to using edge detection technology (such as Canny edge detection algorithm) to extract the inner edge contour and the outer edge contour from the cable cross-section image.

[0025] S2, according to the inner edge contour and the outer edge contour, an inner edge pixel coordinate set and an outer edge pixel coordinate set are obtained, and the inner edge pixel coordinate set and the outer edge pixel coordinate set are respectively introduced into two pre-constructed empty numerical arrays to obtain an inner edge pixel coordinate array and an outer edge pixel coordinate array.

[0026] It should be explained that the inner edge pixel coordinate set refers to the collection of all inner edge pixel point coordinates on the inner edge contour extracted from the cable cross-section image. The inner edge pixel coordinate refers to the coordinate of the pixel point on the inner edge contour. The inner edge pixel coordinate and the outer edge pixel coordinate in the present application are both located on the image coordinate system of the cable cross-section image. The outer edge pixel coordinate set refers to the collection of all outer edge pixel point coordinates on the outer edge contour extracted from the cable cross-section image. The outer edge pixel point coordinate refers to the coordinate of the pixel point on the outer edge contour. The empty numerical array refers to an array that is created in advance but has not stored any data. The inner edge pixel coordinate array refers to the array obtained after storing the inner edge pixel coordinate set into the empty numerical array. The outer edge pixel coordinate array refers to the array obtained after storing the outer edge pixel coordinate set into the empty numerical array. The present application uses arrays to store the outer edge pixel coordinates and the inner edge pixel coordinates, because the subsequent operations such as curvature value calculation, inner edge initial population and outer edge initial population generation all need to process the pixel coordinates, therefore, using arrays to store the coordinates can conveniently index, traverse and calculate, which provides convenience for the smooth progress of the subsequent steps.

[0027] S3, constructing an inner edge curvature gene database and an outer edge curvature gene database according to the inner edge pixel coordinate array and the outer edge pixel coordinate array.

[0028] In detail, the construction of the inner edge curvature gene database and the outer edge curvature gene database according to the inner edge pixel coordinate array and the outer edge pixel coordinate array comprises: obtaining a set of scaling factors, wherein the set of scaling factors comprises a small-scale scaling factor, a middle-scale scaling factor, and a large-scale scaling factor; extracting the scaling factors from the set of scaling factors in sequence, segmenting the array of inner edge pixel coordinates by using the scaling factors to obtain a set of segmented inner pixel coordinate groups, wherein the set of segmented inner pixel coordinate groups comprises a plurality of segmented inner pixel coordinate groups, and each segmented inner pixel coordinate group comprises a plurality of segmented inner pixel coordinates; extracting the segmented inner pixel coordinate groups from the set of segmented inner pixel coordinate groups in sequence, and obtaining an intermediate inner edge pixel coordinate from the segmented inner pixel coordinate groups; calculating a midpoint curvature value according to the intermediate inner edge pixel coordinate, and aggregating the midpoint curvature values to obtain a set of midpoint curvature values corresponding to the set of segmented inner pixel coordinate groups, wherein the set of midpoint curvature values comprises a plurality of midpoint curvature values, and each midpoint curvature value corresponds to a segmented inner pixel coordinate group; normalizing each midpoint curvature value in the set of midpoint curvature values to obtain a set of normalized curvature values, extracting the normalized curvature values from the set of normalized curvature values in sequence, and identifying a target segmented inner pixel coordinate group from the set of segmented inner pixel coordinate groups according to the normalized curvature values; assigning each target segmented inner pixel coordinate in the target segmented inner pixel coordinate group by using the normalized curvature value to obtain an initial assigned inner pixel coordinate group; aggregating the initial assigned inner pixel coordinate groups to obtain a set of initial assigned inner pixel coordinate groups, and aggregating the set of initial assigned inner pixel coordinate groups to obtain a plurality of sets of initial assigned inner pixel coordinate groups corresponding to the set of scaling factors, wherein each scaling factor corresponds to a set of initial assigned inner pixel coordinate groups; integrating the plurality of sets of initial assigned inner pixel coordinate groups to obtain a set of assigned inner edge pixel coordinates, and calculating a set of curvature variation amounts according to the set of assigned inner edge pixel coordinates, wherein the set of curvature variation amounts comprises a plurality of curvature variation amounts, and each assigned inner edge pixel coordinate corresponds to a curvature variation amount; identifying an updated set of inner edge pixel coordinates based on the set of curvature variation amounts and the set of assigned inner edge pixel coordinates, constructing an inner edge curvature gene database based on the updated set of inner edge pixel coordinates, and constructing an outer edge curvature gene database based on the array of outer edge pixel coordinates.

[0029] It should be explained that the array of inner edge pixel coordinates and the array of outer edge pixel coordinates can be segmented by using the set of scaling factors, so as to analyze the geometric characteristics of the edge at different scales. For example, 1s represents a small-scale scaling factor, 2s represents a middle-scale scaling factor, and 3s represents a large-scale scaling factor. For example, the small-scale scaling factor is 3, the array of inner edge pixel coordinates is , and the set of segmented inner pixel coordinate groups obtained by segmenting the array of inner edge pixel coordinates by using the small-scale scaling factor is and The middle inner edge pixel coordinate refers to the coordinate of a middle pixel in each inner edge pixel coordinate group. If the scaling factor is odd, the scaling factor is divided by 2 to obtain a value, the integer part of the value is taken as the index of the pixel, and the coordinate of the pixel corresponding to the index of the pixel is taken as the middle inner edge pixel coordinate. If the scaling factor is even, the scaling factor is divided by 2 to obtain a value, and the value obtained by subtracting 1 from the value is taken as the index of the pixel, and the coordinate of the pixel corresponding to the index of the pixel is taken as the middle inner edge pixel coordinate. The midpoint curvature value set refers to a set composed of all midpoint curvature values. For example, if the scaling factor is 3, 3 / 2 = 1.5, the integer part of 1.5 is taken, the index of the pixel is 1, the coordinate of the pixel corresponding to the index of the pixel is taken as the middle inner edge pixel coordinate, and if the scaling factor is 4, 4 / 2-1 = 1, then 1 is taken as the index of the pixel, and the coordinate of the pixel corresponding to the index of the pixel is taken as the middle inner edge pixel coordinate. The index of the pixel in the present application represents the corresponding storage position of all inner edge pixel coordinates in the array.

[0030] It should be noted that in the present application, one assigned inner edge pixel coordinate corresponds to three normalized curvature values, which are the normalized curvature value under the small-scale scaling factor, the normalized curvature value under the medium-scale scaling factor, and the normalized curvature value under the large-scale scaling factor. The step of calculating the curvature change amount set according to the assigned inner edge pixel coordinate set is: sequentially extracting the assigned inner edge pixel coordinates from the assigned inner edge pixel coordinate set, confirming the small-scale normalized curvature value and the large-scale normalized curvature value according to the assigned inner edge pixel coordinates, taking the value obtained by subtracting the small-scale normalized curvature value from the large-scale normalized curvature value as the curvature change amount, and collecting the curvature change amounts to obtain the curvature change amount set. The small-scale normalized curvature value and the large-scale normalized curvature value refer to the normalized curvature value corresponding to the assigned inner edge pixel coordinate under the small-scale scaling factor and the normalized curvature value under the large-scale scaling factor, respectively. The present application uses the scaling factor set to divide the edge at multiple scales, which can compare the curvature change amounts under different scales to identify true and false features, effectively distinguish real key features from irrelevant noise, and thus realize intelligent and efficient search. If the thinnest position of the insulating layer in the actual cable is under the small-scale scaling factor, it is concave, and it will be more concave under the large-scale scaling factor. At this time, the normalized curvature value is greater than or equal to the normalized curvature value under the small-scale scaling factor, and therefore, the curvature change amount is greater than zero. If it is noise or a small defect, it is concave under the small-scale scaling factor, but the feature disappears or becomes flat (the normalized curvature value decreases) under the large-scale scaling factor, and therefore, the curvature change amount is less than zero.

[0031] Importantly, the step of normalizing each midpoint curvature value in the set of midpoint curvature values is to obtain a maximum midpoint curvature value and a minimum midpoint curvature value in the set of midpoint curvature values, and to normalize each midpoint curvature value in the set of midpoint curvature values by using the maximum midpoint curvature value and the minimum midpoint curvature value. The purpose of normalizing the midpoint curvature values is that the range of the midpoint curvature values may vary due to different edge shapes, scales or images, and by normalizing, all the midpoint curvature values can be adjusted to a unified range [0, 1], so that the comparison and processing between different data sets are more consistent and fair. The assigned inner edge pixel coordinate refers to the coordinate of each inner edge pixel in each segment after the normalized curvature value of the middle inner edge pixel in the segment is assigned, which provides data for subsequent curvature change amount calculation and population generation. The assigned inner edge pixel coordinate set refers to a set composed of all assigned inner edge pixel coordinates. The updated inner edge pixel coordinate set refers to a coordinate set after the inner edge pixel coordinate set is updated after considering the curvature change amount. The inner edge curvature gene database constructed based on the updated inner edge pixel coordinate set refers to storing the updated inner edge pixel coordinate set in a database, and each updated inner edge pixel coordinate in the database includes a corresponding normalized curvature value and a curvature change amount. The inner edge curvature gene database is a database that stores the curvature information of each pixel point of the inner edge. The outer edge curvature gene database is a database that stores the curvature information of each pixel point of the outer edge. The method of constructing the outer edge curvature gene database based on the outer edge pixel coordinate array is the same as the method of constructing the inner edge curvature gene database based on the inner edge pixel coordinate array, which will not be described here.

[0032] In detail, the midpoint curvature value is calculated according to the middle inner edge pixel coordinate, including: The coordinate index corresponding to the middle inner edge pixel coordinate is obtained, and one and one subtraction operations are respectively performed on the coordinate index to obtain one coordinate index and one coordinate index; The front inner edge pixel coordinate and the rear inner edge pixel coordinate are determined according to the one coordinate index and the one coordinate index; The first-order difference and the second-order difference are calculated according to the front inner edge pixel coordinate and the rear inner edge pixel coordinate, wherein the first-order difference includes the first-order difference in the x direction and the first-order difference in the y direction, and the second-order difference includes the second-order difference in the x direction and the second-order difference in the y direction; The midpoint curvature value is calculated according to the first-order difference and the second-order difference, wherein the calculation formula of the midpoint curvature value is as follows: wherein, represents the midpoint curvature value, represents the first-order difference in the x direction, represents the second-order difference in the y direction, a first-order difference in y direction, a second-order difference in x direction.

[0033] It should be explained that the coordinate index refers to the value of the position of the middle inner edge pixel coordinate in the array. The plus one coordinate index refers to the new index obtained by adding 1 to the coordinate index. The minus one coordinate index refers to the new index obtained by subtracting 1 from the coordinate index. For example, the segmented inner pixel coordinate group is The corresponding coordinate index is 0, 1, 2, and the middle inner edge pixel coordinate is The coordinate index corresponding to the middle inner edge pixel coordinate is 1, and the plus one coordinate index and the minus one coordinate index are obtained by performing the plus one and minus one operations on the coordinate index, respectively. The front inner edge pixel coordinate is the coordinate corresponding to the plus one coordinate index. The rear inner edge pixel coordinate is the coordinate corresponding to the minus one coordinate index. The steps of calculating the first-order difference and the second-order difference according to the front inner edge pixel coordinate and the rear inner edge pixel coordinate are as follows: the value obtained by subtracting the horizontal coordinate of the rear inner edge pixel coordinate from the horizontal coordinate of the front inner edge pixel coordinate is used as the first-order difference in the x direction, the value obtained by subtracting the vertical coordinate of the front inner edge pixel coordinate from the vertical coordinate of the front inner edge pixel coordinate is used as the first-order difference in the y direction, the value obtained by subtracting twice the horizontal coordinate corresponding to the middle inner edge pixel coordinate from the horizontal coordinate of the front inner edge pixel coordinate and then adding the horizontal coordinate of the rear inner edge pixel coordinate is used as the second-order difference in the x direction, and the value obtained by subtracting twice the vertical coordinate corresponding to the middle inner edge pixel coordinate from the vertical coordinate of the front inner edge pixel coordinate and then adding the vertical coordinate of the rear inner edge pixel coordinate is used as the second-order difference in the y direction. The midpoint curvature value refers to the curvature value at the middle inner edge pixel point. The curvature is a quantity describing the bending degree of a curve, and the greater the curvature, the greater the bending degree of the curve at the point. is the core formula for calculating the curvature of discrete points, which uses discrete coordinate points to simulate the bending degree of a continuous curve. represents the modulus of the vector product of the velocity vector and the acceleration vector. represents the square of the length of the velocity vector, which represents the speed of the point. In the present application, a pixel point with a relatively high normalized curvature value and a relatively high curvature change amount is most likely to be the key concave point with the thinnest insulating layer.

[0034] S4, generating an inner edge initial population and an outer edge initial population according to the inner edge curvature gene database and the outer edge curvature gene database.

[0035] In detail, the generating of the inner edge initial population and the outer edge initial population according to the inner edge curvature gene database and the outer edge curvature gene database comprises: ​​The updated inner edge pixel coordinates are extracted sequentially from the inner edge curvature gene database, and the target curvature change and the target normalized curvature value set are determined based on the updated inner edge pixel coordinates. The comprehensive curvature factor is calculated based on the preset set of weight parameters, the target curvature change, and the target normalized curvature value set. The comprehensive curvature factors are then summarized to obtain the comprehensive curvature factor set. The set of weight parameters includes multiple weight parameters. The sum of comprehensive curvature factors is calculated based on the comprehensive curvature factor set. The initial population individual probability set is calculated based on the sum of comprehensive curvature factors and the updated inner edge pixel coordinate set. The initial population individual probability set includes multiple initial population individual probabilities, and the initial population individual probabilities correspond one-to-one with the updated inner edge pixel coordinates. The initial population individual probability set is imported into a pre-constructed blank probability distribution list to obtain the inner marginal probability distribution list. A weighted random sampling operation is then performed on the inner marginal probability distribution list to obtain the inner marginal initial population. An initial population for the outer edge is generated based on the outer edge curvature gene database. The initial population for the inner edge includes multiple updated inner edge pixel coordinate indices, and the initial population for the outer edge includes multiple updated outer edge pixel coordinate indices.

[0036] It should be explained that the target curvature change refers to the curvature change corresponding to the updated inner edge pixel coordinates. The target normalized curvature value set refers to the set of normalized curvature values ​​corresponding to the updated inner edge pixel coordinates in the scaling factor set. The step of calculating the comprehensive curvature factor based on the preset weight parameter set, the target curvature change, and the target normalized curvature value set is as follows: The formula for calculating the comprehensive curvature factor is shown below: in, Indicates the overall curvature factor. This represents the preset small-scale normalized curvature weight. This represents the small-scale normalized curvature of the target. This represents the preset mesoscale normalized curvature weight. This represents the scale-normalized curvature of the target. This represents the pre-defined large-scale normalized curvature weight. This represents the large-scale normalized curvature of the target. This represents the weight of the preset target curvature change. The target curvature change amount represents the curvature change amount of the target. The small-scale normalized curvature weight, the medium-scale normalized curvature weight, and the large-scale normalized curvature weight are respectively the weights corresponding to the small-scale scaling factor, the medium-scale scaling factor, and the large-scale scaling factor of the pre-set update inner edge pixel coordinates. The target curvature change amount weight is the weight corresponding to the target curvature change amount pre-set. The sum of the small-scale normalized curvature weight, the medium-scale normalized curvature weight, the large-scale normalized curvature weight, and the target curvature change amount weight of the present application is 1. The comprehensive curvature factor set refers to a set composed of all comprehensive curvature factors. The step of calculating the comprehensive curvature factor sum according to the comprehensive curvature factor set refers to adding all comprehensive curvature factors in the comprehensive curvature factor set to obtain a numerical value as the comprehensive curvature factor sum. The blank probability distribution list refers to a list pre-created but not yet stored any data, used to store the initial population individual probability set. The inner edge probability distribution list refers to the list obtained after storing the initial population individual probability set to the blank probability distribution list. The step of calculating the initial population individual probability set according to the comprehensive curvature factor sum and the update inner edge pixel coordinate set is: sequentially extracting the update inner edge pixel coordinates from the update inner edge pixel coordinate set, obtaining the comprehensive curvature factor corresponding to the update inner edge pixel coordinates, obtaining the initial population individual probability by dividing the comprehensive curvature factor by the comprehensive curvature factor sum, and collecting the initial population individual probability to obtain the initial population individual probability set.

[0037] Importantly, the step of performing a weighted random sampling operation on the inner edge probability distribution list to obtain an initial population of inner edge is: according to the preset population quantity, the extraction times of the inner edge probability distribution list are confirmed, a random number between [0, 1] is randomly generated, the initial population individual probability corresponding to the index value 0 in the inner edge probability distribution list is extracted, if the random number is less than or equal to the initial population individual probability, the index value 0 corresponding to the initial population individual probability is added to the pre-constructed blank population, the filled population is obtained, and the initial population individual probability corresponding to the index value 0 is put back into the inner edge probability distribution list to obtain a new inner edge probability distribution list, the new inner edge probability distribution list is taken as the inner edge probability distribution list, the index value 0 is added by 1 to obtain a new index value 1, the new initial population individual probability is obtained according to the new index value 1, the new initial population individual probability is taken as the initial population individual probability, and the step of returning if the random number is less than or equal to the initial population individual probability is returned until the extraction times are equal to the population quantity, and an initial population of inner edge is obtained. The index value in the initial population individual probability corresponding to the index value 0 extracted from the inner edge probability distribution list represents the storage position of all inner edge pixel coordinates in the array. The population quantity refers to a preset value. The extraction times refer to the number of individuals extracted from the inner edge probability distribution list in the weighted random sampling process. The initial population individual probability refers to the probability of each individual (updated inner edge pixel coordinates) in the inner edge probability distribution list being extracted. The blank population refers to an array pre-created but not yet storing any data, used for storing individuals obtained in the sampling process. The filled population refers to the population obtained after the extracted individuals (updated inner edge pixel coordinates) are added to the blank population in the sampling process. The initial population of inner edge refers to the population generated from the inner edge probability distribution list by the weighted random sampling operation. The method for generating an initial population of outer edge based on the outer edge curvature gene database is the same as the method for generating an initial population of inner edge based on the inner edge curvature gene database, which will not be described here.

[0038] S5、according to the initial population of inner edge and the initial population of outer edge, obtaining an optimal inner fitness set and an optimal outer fitness set.

[0039] In detail, the step of obtaining an optimal inner fitness set and an optimal outer fitness set according to the initial population of inner edge and the initial population of outer edge comprises: confirming a target inner pixel coordinate set according to a plurality of updated inner edge pixel coordinate indexes in the initial population of inner edge, and confirming a target outer pixel coordinate set according to a plurality of updated outer edge pixel coordinate indexes in the initial population of outer edge; extracting the target-in pixel coordinates from the target-in pixel coordinate set in sequence, and pairing each target-in pixel coordinate with each target-out pixel coordinate in the target-out pixel coordinate set to obtain an insulation thickness measurement point set, wherein the insulation thickness measurement point set comprises a plurality of insulation thickness measurement points, and each insulation thickness measurement point comprises one target-in pixel coordinate and one target-out pixel coordinate; calculating the insulation thickness of each insulation thickness measurement point in the insulation thickness measurement point set to obtain an insulation thickness set, wherein the insulation thickness is the Euclidean distance between the target-in pixel coordinate and the target-out pixel coordinate in the insulation thickness measurement point; confirming an optimal insulation thickness from the insulation thickness set, and calculating an optimal inner fitness based on the optimal insulation thickness, wherein the optimal inner fitness is the reciprocal of the optimal insulation thickness; summarizing the optimal inner fitness to obtain an optimal inner fitness set corresponding to the target-in pixel coordinate set, and obtaining an optimal outer fitness set based on the target-out pixel coordinate set.

[0040] It should be explained that updating the inner edge pixel coordinate index means updating the index corresponding to the inner edge pixel coordinate. The target-in pixel coordinate set refers to a set composed of a plurality of updated inner edge pixel coordinates corresponding to the updated inner edge pixel coordinate index. The target-out pixel coordinate set refers to a set composed of a plurality of updated outer edge pixel coordinates corresponding to the updated outer edge pixel coordinate index. Pairing each target-in pixel coordinate with each target-out pixel coordinate in the target-out pixel coordinate set refers to the operation of combining the target-in pixel coordinate with each target-out pixel coordinate in the target-out pixel coordinate set. The insulation thickness set refers to a set composed of insulation thicknesses. The optimal insulation thickness is confirmed from the insulation thickness set, which means that the smallest insulation thickness in the insulation thickness set is taken as the optimal insulation thickness, indicating the position of the thinnest insulation layer among all measurement points. The optimal inner fitness set refers to a set composed of optimal inner fitnesses. The method of obtaining the optimal outer fitness set based on the target-out pixel coordinate set is the same as the method of obtaining the optimal inner fitness set based on the target-in pixel coordinate set, and will not be described here. The optimal outer fitness set refers to a set of optimal outer fitnesses corresponding to the target-out pixel coordinate set. The core benefit of obtaining the optimal outer fitness set (and the optimal inner fitness set) of the present application lies in that it realizes the cooperative evaluation and evolution of the inner and outer edges. It provides accurate basis for the selection operator, so that the evolution process can efficiently and synchronously optimize the inner and outer edges, and finally find the global optimal solution that can be paired to form the optimal insulation thickness, while maintaining the robustness and global search ability of the algorithm.

[0041] S6, obtaining an optimal insulation thickness measurement coordinate set based on the optimal inner fitness set and the optimal outer fitness set.

[0042] In detail, the obtaining of the optimal insulation thickness measurement coordinate set based on the optimal inner and outer adaptation sets comprises: setting a current operation edge flag and a measurement point counter, wherein the current operation edge flag comprises: true and false, and the initial value of the measurement point counter is 0; confirming that the current operation edge flag is true, performing adaptive crossover operation on the inner edge initial population to obtain an inner edge population gene sequence, and performing adaptive mutation operation on the inner edge population gene sequence to obtain an updated inner edge population sequence; mixing and pairing the updated inner edge population sequence with the outer edge pixel coordinate array to obtain a mixed pairing group set, and obtaining a candidate insulation thickness measurement coordinate according to the mixed pairing group set; calculating the number of removed inner edge pixels and the number of removed outer edge pixels according to the preset removal ratio, the inner edge pixel coordinate array and the outer edge pixel coordinate array, respectively; obtaining an optimized inner edge pixel coordinate array and an optimized outer edge pixel coordinate array according to the candidate insulation thickness measurement coordinate, the number of removed inner edge pixels, the number of removed outer edge pixels, the inner edge pixel coordinate array and the outer edge pixel coordinate array; obtaining an updated outer edge initial population according to the optimized outer edge pixel coordinate array, and performing a plus one operation on the measurement point counter to obtain an updated measurement point counter; switching the current operation edge flag to obtain a switched operation edge flag with the operation edge flag being false, performing adaptive crossover mutation operation on the updated outer edge initial population and the optimized inner edge pixel coordinate array to obtain a backup insulation thickness measurement coordinate, a second inner edge pixel coordinate array and a second outer edge pixel coordinate array; performing a plus one operation on the updated measurement point counter to obtain a second updated measurement point counter, taking the second updated measurement point counter as the measurement point counter, obtaining a second inner edge initial population based on the second inner edge pixel coordinate array, and taking the second inner edge initial population and the second outer edge pixel coordinate array as the inner edge initial population and the outer edge pixel coordinate array, respectively; returning to the step of confirming that the current operation edge flag is true until the value of the measurement point counter is greater than or equal to 6; summarizing the candidate insulation thickness measurement coordinate and the backup insulation thickness measurement coordinate to obtain an optimal insulation thickness measurement coordinate set.

[0043] It can be understood that the mixed pairing refers to combining each updated inner edge coordinate in the inner edge population sequence with all outer edge pixel coordinates in the outer edge pixel coordinate array. The mixed pairing group set refers to a set composed of mixed pairing groups generated after mixed pairing. The measurement point counter is a counter for recording the number of current measurement points, which is incremented after the processing of each measurement point is completed, and is used to control the number of iterations of the measurement points. The candidate insulation thickness measurement coordinate is obtained from the mixed pairing group set, which refers to calculating the Euclidean distance of each pair of mixed pairing groups in the mixed pairing group set, obtaining a plurality of Euclidean distances, obtaining the smallest Euclidean distance from the plurality of Euclidean distances, and taking the mixed pairing group corresponding to the smallest Euclidean distance as the candidate insulation thickness measurement coordinate. The removal ratio is a pre-set ratio value for determining the number of pixel coordinates that need to be removed in each iteration, and the removal ratio is a floating point number between 0 and 1. For example, the removal ratio is 0.2, which means that 20% of the pixel coordinates need to be removed in each iteration. The inner edge pixel removal number and the outer edge pixel removal number refer to the number of pixel coordinates that need to be removed from the inner edge pixel coordinate array and the outer edge pixel coordinate array, respectively, according to the removal ratio. The present application adopts an alternating genetic update mechanism to alternately system between the inner and outer edges, ensuring the balance of the optimization process and avoiding overemphasis on one edge. By isolating genetic operations to one side of each iteration, the alternating genetic update mechanism reduces the risk of damaging high-quality genes on the other side, thereby improving stability. At the same time, the alternating operation allows local improvements to each edge during iteration, which collectively contribute to global optimization.

[0044] Importantly, the steps of calculating the inner edge pixel removal number and the outer edge pixel removal number according to the pre-set removal ratio, the inner edge pixel coordinate array and the outer edge pixel coordinate array are as follows: obtaining the total number of inner edge pixel coordinates and the total number of outer edge pixel coordinates in the inner edge pixel coordinate array and the outer edge pixel coordinate array, respectively, inner edge pixel removal number = removal ratio total number of inner edge pixel coordinates, and outer edge pixel removal number = removal ratio total number of outer edge pixel coordinates. The steps of obtaining the optimized inner edge pixel coordinate array and the optimized outer edge pixel coordinate array according to the candidate insulation thickness measurement coordinate, the inner edge pixel removal number, the outer edge pixel removal number, the inner edge pixel coordinate array and the outer edge pixel coordinate array are as follows: taking the candidate insulation thickness measurement coordinate as the center, and deleting the same number of pixel coordinates before and after the inner edge pixel coordinate array and the outer edge pixel coordinate array according to the inner edge pixel removal number and the outer edge pixel removal number, respectively, to obtain the optimized inner edge pixel coordinate array and the optimized outer edge pixel coordinate array. For example, the inner edge pixel coordinate array is , and the candidate insulation thickness measurement coordinate is The number of inner edge pixels removed is 4, 4 / 2=2, so the same number is 2. Therefore, the coordinates are measured using the candidate insulation thickness. Centered on, delete ,Will The pixel coordinates preceding the candidate insulation thickness measurement coordinates were deleted. ,Will The coordinates of the pixels following the candidate insulation thickness measurement coordinates. Updating the initial outer edge population refers to generating a new initial outer edge population based on the optimized outer edge pixel coordinate array in each iteration. The method for obtaining the updated initial outer edge population based on the optimized outer edge pixel coordinate array, and the method for obtaining the second initial inner edge population based on the second inner edge pixel coordinate array, are the same as the method for obtaining the initial outer edge population based on the outer edge pixel coordinate array, and will not be repeated here. The increment operation refers to increasing the value in the measurement point counter by 1. Updating the measurement point counter refers to the measurement point counter obtained after incrementing it after processing each measurement point. The method for performing adaptive crossover and mutation operations on the updated initial outer edge population and the optimized inner edge pixel coordinate array is the same as the method for performing adaptive crossover operations on the initial inner edge population and adaptive mutation operations on the inner edge population gene sequence, and will not be repeated here. The candidate insulation thickness measurement coordinates refer to the candidate insulation thickness measurement coordinates obtained after performing an adaptive crossover mutation operation on the updated outer edge initial population and the optimized inner edge pixel coordinate array. The second inner edge pixel coordinate array and the second outer edge pixel coordinate array refer to the arrays that will be used as the new inner edge pixel coordinate array and the new outer edge pixel coordinate array in the next iteration, respectively. The second updated measurement point counter refers to the measurement point counter obtained after incrementing the updated measurement point counter by one.

[0045] Importantly, the step of performing adaptive mutation on the gene sequence of the inner edge population to obtain the updated inner edge population sequence is as follows: obtaining the highest fitness, lowest fitness, average fitness, and maximum curvature factor of the inner edge population gene sequence, wherein the inner edge population gene sequence includes multiple inner edge population coordinate index values, and each inner edge population coordinate index value corresponds to an inner edge population coordinate; The coordinate index values ​​of the inner edge population are extracted sequentially from the gene sequence of the inner edge population, and the population fitness is determined based on the coordinate index values ​​of the inner edge population. The mutation probability is calculated based on the highest fitness, lowest fitness, average fitness, maximum curvature factor, and fitness of the population. The formula for calculating the mutation probability is as follows: in, Indicates the probability of mutation. , , , , all represent preset variation fitness coefficients, represents population fitness, represents population average fitness, represents population maximum internal fitness, represents population minimum internal fitness, represents population maximum curvature factor; a variation random number is generated, if the variation probability is greater than the variation random number, the internal edge population coordinate index value is converted into a binary Gray code, wherein the binary Gray code includes a plurality of numbers; a Gray code bit number is randomly generated, a target number is confirmed from the binary Gray code according to the Gray code bit number, a number inversion operation is performed on the target number to obtain an updated binary Gray code, and the updated binary Gray code is converted into a decimal to obtain an updated internal edge coordinate index value; if the variation probability is less than or equal to the variation random number, the internal edge population coordinate is retained to obtain a retained internal edge coordinate index value; the updated internal edge coordinate index value and the retained internal edge coordinate index value are summarized to obtain an updated internal edge population sequence.

[0046] It should be explained that: The highest fitness of the population refers to the maximum value among the optimal internal fitness of all individuals (pixel coordinates) in the inner edge population gene sequence. The lowest fitness of the population refers to the minimum value among the optimal internal fitness of all individuals (pixel coordinates) in the inner edge population gene sequence. The average fitness of the population refers to the average value of the optimal internal fitness of all individuals (pixel coordinates) in the inner edge population gene sequence. The maximum curvature factor of the population refers to the maximum value among the normalized curvature factors of all individuals (pixel coordinates) in the inner edge population gene sequence. The inner edge population coordinate index value refers to the index value of each individual (pixel coordinate) in the inner edge population gene sequence within the array. Population fitness refers to the fitness value of each individual (pixel coordinate) in the inner edge population gene sequence. The fitness coefficient is a preset parameter used in the mutation probability calculation formula to adjust the importance of different factors (such as population fitness and maximum curvature factor). Mutation random number refers to a probability value randomly generated during the mutation operation using a random number generator (such as `random.random()` in Python), used to determine whether to perform the mutation operation on a particular individual. Binary Gray code refers to the encoding obtained by converting the inner edge population coordinate index value to binary. The method for randomly generating the Gray code bit length is the same as the method for generating the mutation random number, and will not be repeated here. Gray code bit length refers to a specific position in the binary Gray code. Target number refers to the number determined based on the Gray code bit length. Performing a bit inversion operation on the target number means changing the target number from 0 to 1, or from 1 to 0. Updating the binary Gray code refers to the new binary Gray code obtained after the bit inversion operation. The method for performing decimal conversion on the updated binary Gray code is the same as the method for decimal decoding the first and second swapped Gray code sequences, and will not be repeated here. Updating the inner edge coordinate index value refers to the new inner edge coordinate index value obtained by converting the updated binary Gray code back to a decimal index value. Retaining inner edge coordinate index values ​​refers to keeping the unchanged inner edge population coordinate index values ​​during mutation operations when the mutation probability is less than or equal to the random number generated by random mutation. Updating the inner edge population sequence refers to obtaining a new population sequence after mutation operations by summing all updated inner edge coordinate index values ​​and the retained inner edge coordinate index values. Mutation fitness coefficients refer to a pre-defined set of coefficients used to calculate the mutation probability.

[0047] Importantly, It quantifies the relative fitness of an individual within the population, while In It is a sigmoid function, which maps the relative position to a mutation probability modulator using the sigmoid function (whose shape is controlled by the coefficient λ3): when the individual fitness is significantly lower than the mean ( When ), the Sigmoid output approaches This assigns them a high probability of variation, incentivizing them to engage in exploratory variation; when an individual's fitness is significantly better than the average ( When the output approaches 0, the mutation probability is reduced to the baseline level (0), thus effectively protecting the superior genes from damage. In It is also a sigmoid function, whose sigmoid function is based on the maximum curvature factor. Adjustments were made in key feature areas with high curvature. Large values ​​suppress the mutation probability to protect these important structures; in the flat regions with low curvature ( If the value is small, then mutation is increased to promote the exploration and optimization of the overall contour. In summary, for poor individuals with low fitness, their mutation probability is significantly increased, encouraging them to boldly explore new solutions; for excellent individuals with high fitness, the mutation probability is reduced to protect their superior genes from being destroyed. At the same time, mutation is reduced near key feature points with large image curvature to protect important structures, while mutation is increased in flat areas to optimize the overall contour. The purpose of the alternating curvature driven algorithm of this invention is to find six optimal insulation thickness measurement coordinate sets from the inner and outer edge contours of the cable cross-section image, respectively, so that the Euclidean distance between the inner and outer edge coordinates corresponding to the optimal insulation thickness measurement coordinates is the shortest. The optimal insulation thickness measurement coordinate set represents the thinnest point of the cable insulation layer in actual physical space.

[0048] Specifically, the adaptive crossover operation performed on the initial inner edge population to obtain the inner edge population gene sequence includes: The initial population of the inner edge is obtained based on the initial population of the inner edge and the optimal inner fitness set. The initial population of the inner edge is then grouped into pairs to obtain the inner population set. The inner population set includes multiple inner population groups, and each inner population group includes two inner edge pixel coordinates. For each in-population group in the in-population set, perform the following operations: Based on the in-group, obtain the maximum crossover probability, generate a random crossover probability, and compare the random crossover probability with the maximum crossover probability; If the maximum crossover probability is less than or equal to the random crossover probability, then the in-species group is selected as the retained in-species group. If the maximum crossover probability is greater than the random crossover probability, then perform a crossover operation on the in-species group to obtain an optimized in-species group; The retained and optimized intermecula populations were summarized separately to obtain the retained intermecula population set and the optimized intermecula population set. The retained intermecula population set and the optimized intermecula population set were then imported into a pre-constructed blank gene sequence to obtain the gene sequence of the inner marginal population.

[0049] It should be explained that the two-by-two grouping of the identified inner edge initial population refers to dividing the arrangement order of the inner edge pixel coordinate array in the identified inner edge initial population into multiple groups, each group containing two inner edge pixel coordinates. For example, the identified inner edge initial population is [50, 123, 78, 901, 25, 345], and after the two-by-two grouping of the identified inner edge initial population, the inner population group set is {[50, 123}, {78, 901}, {25, 345}}. The inner population group set refers to the set of all inner population groups obtained by grouping the inner edge pixel coordinates in the inner edge initial population two by two. The step of obtaining the maximum crossover probability according to the inner population group is: obtaining two crossover probabilities in the inner population group, and confirming the maximum crossover probability from the two crossover probabilities as the maximum crossover probability, wherein the inner population group includes two inner edge pixel coordinates, and the inner edge pixel coordinates correspond to the crossover probability one by one. The random crossover probability is generated by using a random generator (random.random() in Python). The reserved inner population group refers to the inner population group that remains unchanged when the maximum crossover probability is less than or equal to the random crossover probability in the crossover operation. The reserved inner population group set refers to the set of all inner population groups that remain unchanged. The optimized inner population group set refers to the set of inner population groups obtained after the crossover operation when the maximum crossover probability is less than or equal to the random crossover probability. The blank gene sequence refers to a sequence created in advance but not yet storing any data, used to store the final inner edge population gene sequence. The inner edge population gene sequence refers to the final sequence obtained by summarizing the reserved inner population group set and the optimized inner population group set.

[0050] In detail, the identified inner edge initial population is obtained according to the inner edge initial population and the optimal inner fitness set, including: The highest inner fitness, the lowest inner fitness, and the average fitness are confirmed according to the inner edge initial population and the optimal inner fitness set; The maximum curvature factor is confirmed according to the inner edge curvature gene database, and the updated inner edge pixel coordinate index is extracted from the inner edge initial population in turn, and the target inner fitness is confirmed from the inner edge curvature gene database according to the updated inner edge pixel coordinate index; The crossover probability is calculated according to the highest inner fitness, the lowest inner fitness, the average fitness, the target inner fitness, and the maximum curvature factor, wherein the calculation formula of the crossover probability is as follows: wherein, represents the crossover probability, , , , and all represent the preset crossover fitness coefficient, Indicates the in-target fitness. Indicates average fit. Indicates the highest internal fit. Indicates the minimum internal fitness. Represents the maximum curvature factor; The crossover probabilities are summarized to obtain a crossover probability set. The crossover probability set is used to identify the coordinates of each updated inner edge pixel in the initial inner edge population to obtain the identified inner edge initial population.

[0051] It should be explained that: Highest internal fitness refers to the largest optimal internal fitness in the optimal internal fitness set. Lowest internal fitness refers to the smallest optimal internal fitness in the optimal internal fitness set, indicating that in the current population, the fitness of a certain individual (pixel coordinate) is the lowest, meaning that the individual's adaptability in the current environment is the weakest. Average fitness refers to the average of all optimal internal fitness values ​​in the optimal internal fitness set. Maximum curvature factor refers to the largest normalized curvature value in the inner edge curvature gene database. Target internal fitness refers to the optimal internal fitness corresponding to the updated inner edge pixel coordinate index in the initial inner edge population. Crossover probability refers to the probability of two individuals (pixel coordinates) undergoing a crossover operation in the genetic algorithm. Crossover probability set refers to the set obtained by summing the crossover probabilities corresponding to each updated inner edge pixel coordinate in the initial inner edge population. Identifying the initial inner edge population refers to the population after identifying each updated inner edge pixel coordinate according to the crossover probability in the initial inner edge population. Crossover fitness coefficient refers to a pre-defined set of coefficients used to calculate the crossover probability.

[0052] Importantly, The relative position of the optimal inner fitness for updating the inner edge pixel coordinates within the initial inner edge population was quantified, while The term uses the Sigmoid function (whose shape is modulated by the coefficient λ1) to map this relative position into a crossover probability modifier: when the individual fitness is significantly lower than the mean ( When ), the Sigmoid output approaches This gives them a high crossover probability, prompting them to improve their own quality by exchanging gene fragments with superior individuals; when an individual's fitness is significantly better than the average ( When the crossover probability is low, the output approaches 0, reducing it to a baseline level and effectively protecting superior gene patterns from destructive crossover by low-quality individuals. Meanwhile, Its sigmoid function is adjusted based on the maximum curvature factor: in key feature regions with high curvature ( Large values ​​indicate that crossover probability is suppressed to protect the gene integrity of these important structural regions; in flat regions with low curvature ( If the value is small, then increase the crossover to promote gene mixing and optimize the overall continuity and smoothness of the profile.

[0053] In detail, the cross operation is performed on the inner population group to obtain an optimized inner population group, including: obtaining a first pixel index value and a second pixel index value according to two inner edge pixel coordinates in the inner population group, performing pixel index value conversion on the first pixel index value and the second pixel index value respectively by using a preset fixed number of bits, and obtaining a first binary Gray code sequence and a second binary Gray code sequence; segmenting the first binary Gray code sequence and the second binary Gray code sequence respectively to obtain a first segmented sequence set and a second segmented sequence set, wherein the first segmented sequence set includes a first segmented front sequence, a first segmented middle sequence and a first segmented rear sequence, and the second segmented sequence set includes a second segmented front sequence, a second segmented middle sequence and a second segmented rear sequence; swapping the first segmented middle sequence and the second segmented middle sequence to obtain a first exchanged Gray code sequence and a second exchanged Gray code sequence; performing decimal decoding on the first exchanged Gray code sequence and the second exchanged Gray code sequence respectively to obtain a first decoded index value and a second decoded index value, and obtaining an effective index value interval; if the first decoded index value and the second decoded index value are both located in the effective index value interval, the first decoded index value and the second decoded index value are confirmed as the optimized inner population group; otherwise, performing a boundary correction operation on the first decoded index value or the second decoded index value to obtain the optimized inner population group.

[0054] It should be explained that the first pixel index value and the second pixel index value respectively refer to the index values corresponding to the two inner edge pixel coordinates. The fixed number of bits refers to the number of bits of the binary sequence preset when the pixel index value conversion is performed, which is used to ensure that the binary representations of all index values have consistent lengths. The pixel index value conversion refers to the operation of converting the pixel index value from decimal to binary Gray code sequence. The first binary Gray code sequence refers to the binary Gray code sequence converted from the first pixel index value. The second binary Gray code sequence refers to the binary Gray code sequence converted from the second pixel index value. The segmentation refers to the division of the Gray code sequence into multiple parts, which is divided into a front segment, a middle segment and a rear segment. The first segmented front segment sequence, the first segmented middle segment sequence and the first segmented rear segment sequence respectively refer to the front segment sequence, the middle segment sequence and the rear segment sequence after the segmentation of the first binary Gray code sequence. The second segmented front segment sequence, the second segmented middle segment sequence and the second segmented rear segment sequence respectively refer to the front segment sequence, the middle segment sequence and the rear segment sequence after the segmentation of the second binary Gray code sequence. The first exchanged Gray code sequence refers to the first Gray code sequence obtained by exchanging the first segmented middle segment sequence and the second segmented middle segment sequence. The conversion and crossover using Gray code in the present application effectively avoid the solution space mapping mutation problem caused by the discontinuity of the standard binary coding due to Hamming distance. It ensures that small changes in the genotype (binary coding) always correspond to small changes in the phenotype (pixel index value), optimizes the global search process of genetic algorithm from non-associated random exploration in the solution space to local fine development with good neighborhood preservation characteristics, greatly enhances the local development capability for ordered discrete problems, and improves the stability and efficiency of algorithm optimization.

[0055] Further, the second exchanged Gray code sequence refers to the second Gray code sequence obtained by exchanging the first segmented middle segment sequence and the second segmented middle segment sequence. The decimal decoding refers to the operation of converting the binary Gray code sequence back to the decimal index value. The first decoded index value refers to the decimal index value decoded from the first exchanged Gray code sequence. The second decoded index value refers to the decimal index value decoded from the second exchanged Gray code sequence. The step of obtaining the effective index value interval is: obtaining the upper limit of the effective index value interval by subtracting one from the total number of inner edge pixels, and obtaining the effective index value interval by combining zero to the upper limit of the effective index value interval. The total number of inner edge pixels refers to the number of inner edge pixel coordinates in the inner edge pixel coordinate set. The optimized inner population group refers to the first decoded index value and the second decoded index value obtained by the crossover operation. The step of performing a boundary correction operation on the first decoded index value or the second decoded index value is: if the first decoded index value or the second decoded index value is less than zero, setting the first decoded index value or the second decoded index value to zero, and if the first decoded index value or the second decoded index value is greater than or equal to the total number of inner edge pixels, setting the first decoded index value or the second decoded index value to the upper limit of the effective index value interval.

[0056] S7, based on the optimal insulation thickness measurement coordinate set, complete the cable insulation thickness measurement based on the alternating curvature driving algorithm.

[0057] It should be explained that the optimal insulation thickness measurement coordinate set refers to a set composed of all candidate insulation thickness measurement coordinates and alternative insulation thickness measurement coordinates after all iterations are completed.

[0058] The present application is to solve the problems described in the background art, the present application receives the cable insulation thickness measurement instruction, acquires the cable cross-section image according to the cable insulation thickness measurement instruction, extracts the inner edge contour and the outer edge contour from the cable cross-section image, the insulation layer of the cable is located between the inner edge and the outer edge, accurately extracting the inner and outer edge contours is the key prerequisite for subsequent accurate calculation of the insulation thickness, only the inner and outer edges are clearly defined, the accuracy of subsequent measurement can be ensured, the inner edge pixel coordinate set and the outer edge pixel coordinate set are obtained according to the inner edge contour and the outer edge contour, the inner edge pixel coordinate set and the outer edge pixel coordinate set are respectively introduced into the two empty distance arrays pre-constructed, the inner edge pixel coordinate array and the outer edge pixel coordinate array are obtained, the pixel coordinate information of the inner and outer edges is extracted from the image data and arranged in the form of an array, so that the data is more structured and ordered, the inner edge curvature gene database and the outer edge curvature gene database are constructed according to the inner edge pixel coordinate array and the outer edge pixel coordinate array, the curvature is an important feature to describe the bending degree of the curve, the curvature of the inner and outer edges is calculated and the curvature gene database is constructed, the geometric characteristics of the cable edge are quantified, these curvature data can reflect the local shape information of the inner and outer edges of the cable, and provide more rich feature information for the subsequent optimization algorithm, the inner edge initial population and the outer edge initial population are generated according to the inner edge curvature gene database and the outer edge curvature gene database, the generation of the initial population of the present application is based on the curvature gene database, which means that in the process of searching for the optimal solution, the algorithm can fully utilize the curvature characteristics of the cable edge, so that the search direction is more targeted, the unnecessary search space is reduced, and the search efficiency is improved, the optimal inner fitness set and the optimal outer fitness set are obtained according to the inner edge initial population and the outer edge initial population, the fitness of the present application is an index for measuring the advantages and disadvantages of each individual in the population, by calculating the fitness of the inner and outer edge initial population, and screening the optimal inner fitness set and the optimal outer fitness set, the edge characteristics most consistent with the actual situation of the cable can be found, the optimal insulation thickness measurement coordinate set is obtained based on the optimal inner fitness set and the optimal outer fitness set, the optimal insulation thickness measurement coordinate set is obtained after a series of optimization steps, these coordinates can accurately reflect the position of the inner and outer edges of the cable, so as to realize the accurate measurement of the insulation thickness of the cable, compared with the traditional measurement method, the algorithm can consider the curvature change and other factors of the cable edge, and the measurement result is more accurate and reliable, the cable insulation thickness measurement based on the alternating curvature driving algorithm is completed based on the optimal insulation thickness measurement coordinate set. Therefore, the average detection time can be shortened and the minimum insulation thickness deviation can be improved.

[0059] As Figure 2 shown, it is the functional module diagram of the cable insulation thickness measurement system based on the alternating curvature driving algorithm provided by the embodiment of the present application.

[0060] The cable insulation thickness measuring system 100 based on the alternating curvature driving algorithm can be installed in an electronic device. According to the implemented function, the cable insulation thickness measuring system 100 based on the alternating curvature driving algorithm can include an edge contour extraction module 101, an inner and outer pixel coordinate acquisition module 102, a curvature gene database construction module 103, and an optimal insulation thickness measurement module 104. The modules of the present application can also be referred to as units, which refer to a series of computer program segments that can be executed by an electronic device processor and can complete a fixed function, which are stored in the memory of the electronic device; The edge contour extraction module 101 is used to receive a cable insulation thickness measuring instruction, acquire a cable cross-sectional image according to the cable insulation thickness measuring instruction, and extract an inner edge contour and an outer edge contour from the cable cross-sectional image. The inner and outer pixel coordinate acquisition module 102 is used to acquire an inner edge pixel coordinate set and an outer edge pixel coordinate set according to the inner edge contour and the outer edge contour, and import the inner edge pixel coordinate set and the outer edge pixel coordinate set into two pre-constructed empty array respectively to obtain an inner edge pixel coordinate array and an outer edge pixel coordinate array. The curvature gene database construction module 103 is used to construct an inner edge curvature gene database and an outer edge curvature gene database according to the inner edge pixel coordinate array and the outer edge pixel coordinate array. The optimal insulation thickness measurement module 104 is used to generate an inner edge initial population and an outer edge initial population according to the inner edge curvature gene database and the outer edge curvature gene database, acquire an optimal inner fitness set and an optimal outer fitness set according to the inner edge initial population and the outer edge initial population, acquire an optimal insulation thickness measurement coordinate set based on the optimal inner fitness set and the optimal outer fitness set, and complete the cable insulation thickness measurement based on the alternating curvature driving algorithm based on the optimal insulation thickness measurement coordinate set.

[0061] In detail, the modules in the cable insulation thickness measuring system 100 based on the alternating curvature driving algorithm in the embodiments of the present application use the same technical means as the cable insulation thickness measuring method based on the alternating curvature driving algorithm in the above Figure 1 , and can produce the same technical effects, which will not be described here.

[0062] As Figure 3 shown is a structural schematic diagram of an electronic device for implementing the cable insulation thickness measuring method based on the alternating curvature driving algorithm according to an embodiment of the present application.

[0063] The electronic device 1 can include a processor 10, a memory 11, and a bus 12, and can also include a computer program stored in the memory 11 and executable on the processor 10, such as a cable insulation thickness measuring method program based on the alternating curvature driving algorithm.

[0064] The memory 11 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as the portable hard drive of the electronic device 1. In other embodiments, the memory 11 can be an external storage device of the electronic device 1, such as a plug-in portable hard drive, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device 1. Furthermore, the memory 11 includes both internal storage units and external storage devices of the electronic device 1. The memory 11 can be used not only to store application software and various types of data installed on the electronic device 1, such as the code of a cable insulation thickness measurement method program based on an alternating curvature driving algorithm, but also to temporarily store data that has been output or will be output.

[0065] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., a cable insulation thickness measurement method program based on an alternating curvature drive algorithm) and calls data stored in the memory 11 to perform various functions of the electronic device 1 and process data.

[0066] The bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 can be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize the connection and communication between the memory 11 and at least one processor 10, etc.

[0067] Figure 3 Only electronic devices with components are shown; those skilled in the art will understand that... Figure 3The illustrated structure does not constitute a limitation on the electronic device 1, and can include fewer or more components than illustrated, or combine certain components, or different component arrangements.

[0068] For example, although not shown, the electronic device 1 can also include a power source (such as a battery) to power the various components, and preferably the power source can be logically connected to the at least one processor 10 through a power management device, so that the power management device implements functions such as charge management, discharge management, and power consumption management. The power source can also include one or more direct current or alternating current power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device 1 can also include various sensors, Bluetooth modules, Wi-Fi modules, and the like, which are not described here.

[0069] Further, the electronic device 1 can also include a network interface, which can optionally include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), and is typically used to establish a communication connection between the electronic device 1 and other electronic devices.

[0070] Optionally, the electronic device 1 can also include a user interface, which can be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally can also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, etc. The display can also be appropriately referred to as a display screen or a display unit, and is used to display information processed in the electronic device 1 and to display a visualized user interface.

[0071] The cable insulation thickness measurement method program based on the alternating curvature driving algorithm stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, which, when executed in the processor 10, can achieve: receiving a cable insulation thickness measurement instruction, collecting a cable cross-sectional image according to the cable insulation thickness measurement instruction, and extracting an inner edge contour and an outer edge contour from the cable cross-sectional image; obtaining an inner edge pixel coordinate set and an outer edge pixel coordinate set according to the inner edge contour and the outer edge contour, and respectively importing the inner edge pixel coordinate set and the outer edge pixel coordinate set into two empty curvature arrays pre-constructed to obtain an inner edge pixel coordinate array and an outer edge pixel coordinate array; constructing an inner edge curvature gene database and an outer edge curvature gene database according to the inner edge pixel coordinate array and the outer edge pixel coordinate array; According to the inner edge curvature gene database and the outer edge curvature gene database, the inner edge initial population and the outer edge initial population are generated; According to the inner edge initial population and the outer edge initial population, the optimal inner fitness set and the optimal outer fitness set are obtained; Based on the optimal inner fitness set and the optimal outer fitness set, the optimal insulation thickness measurement coordinate set is obtained, and the cable insulation thickness measurement based on the alternating curvature driving algorithm is completed based on the optimal insulation thickness measurement coordinate set.

[0072] Specifically, the specific implementation method of the processor 10 to the above instructions can refer to Figures 1 to 3 The description of related steps in the corresponding embodiments will not be repeated here.

[0073] Further, the modules / units integrated in the electronic device 1, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. The computer readable storage medium can be volatile or non-volatile. For example, the computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).

[0074] The application also provides a computer readable storage medium, which stores a computer program, and the computer program can realize the following when executed by a processor of an electronic device: Receive a cable insulation thickness measurement instruction, collect a cable cross-sectional image according to the cable insulation thickness measurement instruction, and extract an inner edge contour and an outer edge contour from the cable cross-sectional image; According to the inner edge contour and the outer edge contour, an inner edge pixel coordinate set and an outer edge pixel coordinate set are obtained, and the inner edge pixel coordinate set and the outer edge pixel coordinate set are respectively introduced into two pre-constructed empty array, to obtain an inner edge pixel coordinate array and an outer edge pixel coordinate array; According to the inner edge pixel coordinate array and the outer edge pixel coordinate array, an inner edge curvature gene database and an outer edge curvature gene database are constructed; According to the inner edge curvature gene database and the outer edge curvature gene database, the inner edge initial population and the outer edge initial population are generated; According to the inner edge initial population and the outer edge initial population, the optimal inner fitness set and the optimal outer fitness set are obtained; Based on the optimal inner fitness set and the optimal outer fitness set, the optimal insulation thickness measurement coordinate set is obtained, and the cable insulation thickness measurement based on the alternating curvature driving algorithm is completed based on the optimal insulation thickness measurement coordinate set.

[0075] In several embodiments provided by the present application, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the above-described system embodiments are only illustrative, and actual implementation can have other divisions.

[0076] The modules described as separate components can or can not be physically separate, and the components shown as modules can or can not be physical units, i.e. can be located in one place or distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment.

[0077] In addition, the functional modules in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software functional modules.

[0078] It is obvious for those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.

[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. A method for measuring the thickness of cable insulation based on an alternating curvature drive algorithm, characterized in that, The method comprises: receiving a cable insulation thickness measurement instruction, collecting a cable cross-section image according to the cable insulation thickness measurement instruction, and extracting an inner edge contour and an outer edge contour from the cable cross-section image; obtaining an inner edge pixel coordinate set and an outer edge pixel coordinate set according to the inner edge contour and the outer edge contour, and introducing the inner edge pixel coordinate set and the outer edge pixel coordinate set into two empty edge number arrays respectively pre-constructed to obtain an inner edge pixel coordinate array and an outer edge pixel coordinate array; constructing an inner edge curvature gene database and an outer edge curvature gene database according to the inner edge pixel coordinate array and the outer edge pixel coordinate array; generating an inner edge initial population and an outer edge initial population according to the inner edge curvature gene database and the outer edge curvature gene database; obtaining an optimal inner fitness set and an optimal outer fitness set according to the inner edge initial population and the outer edge initial population; obtaining an optimal insulation thickness measurement coordinate set based on the optimal inner fitness set and the optimal outer fitness set, and completing cable insulation thickness measurement based on an alternating curvature driving algorithm based on the optimal insulation thickness measurement coordinate set.

2. The cable insulation thickness measurement method based on the alternating curvature drive algorithm as claimed in claim 1, wherein, The method comprises: obtaining a scaling factor set, wherein the scaling factor set comprises a small-scale scaling factor, a medium-scale scaling factor and a large-scale scaling factor; extracting scaling factors from the scaling factor set in sequence, segmenting the inner edge pixel coordinate array by using the scaling factors to obtain a segmented inner pixel coordinate group set, wherein the segmented inner pixel coordinate group set comprises a plurality of segmented inner pixel coordinate groups, and each segmented inner pixel coordinate group comprises a plurality of segmented inner pixel coordinates; extracting segmented inner pixel coordinate groups from the segmented inner pixel coordinate group set in sequence, and obtaining intermediate inner edge pixel coordinates from the segmented inner pixel coordinate groups; calculating a midpoint curvature value according to the intermediate inner edge pixel coordinates, and obtaining a midpoint curvature value group corresponding to the segmented inner pixel coordinate group set by summarizing the midpoint curvature values, wherein the midpoint curvature value group comprises a plurality of midpoint curvature values, and each midpoint curvature value corresponds to a segmented inner pixel coordinate group; normalizing each midpoint curvature value in the midpoint curvature value group to obtain a normalized curvature value group, extracting normalized curvature values from the normalized curvature value group in sequence, and identifying a target segmented inner pixel coordinate group from the segmented inner pixel coordinate group set according to the normalized curvature values; assigning each target segmented inner pixel coordinate in the target segmented inner pixel coordinate group by using the normalized curvature values to obtain an initial assigned inner pixel coordinate group; summarizing the initial assigned inner pixel coordinate group to obtain an initial assigned inner pixel coordinate group set, and summarizing the initial assigned inner pixel coordinate group set to obtain a plurality of initial assigned inner pixel coordinate group sets corresponding to the scaling factor set, wherein each scaling factor corresponds to an initial assigned inner pixel coordinate group set; integrating the plurality of initial assigned inner pixel coordinate group sets to obtain an assigned inner edge pixel coordinate set, and calculating a curvature change amount set according to the assigned inner edge pixel coordinate set, wherein the curvature change amount set comprises a plurality of curvature change amounts, and each assigned inner edge pixel coordinate corresponds to a curvature change amount. The updated inner edge pixel coordinate set is determined based on the curvature change amount set and the assigned inner edge pixel coordinate set, the inner edge curvature gene database is constructed based on the updated inner edge pixel coordinate set, and the outer edge curvature gene database is constructed based on the outer edge pixel coordinate array.

3. The cable insulation thickness measurement method based on the alternating curvature drive algorithm as claimed in claim 2, wherein, The midpoint curvature value is calculated according to the intermediate inner edge pixel coordinate, and the midpoint curvature value is calculated according to the intermediate inner edge pixel coordinate. The coordinate index corresponding to the intermediate inner edge pixel coordinate is obtained, and the add-one coordinate index and the subtract-one coordinate index are obtained by performing the add-one and subtract-one operations on the coordinate index, respectively. The front inner edge pixel coordinate and the rear inner edge pixel coordinate are determined according to the add-one coordinate index and the subtract-one coordinate index. The first-order difference and the second-order difference are calculated according to the front inner edge pixel coordinate and the rear inner edge pixel coordinate, wherein the first-order difference includes the x-direction first-order difference and the y-direction first-order difference, and the second-order difference includes the x-direction second-order difference and the y-direction second-order difference. The midpoint curvature value is calculated according to the first-order difference and the second-order difference, and the calculation formula of the midpoint curvature value is as follows: wherein, represents a midpoint curvature value, represents a first order difference in the x-direction, represents a second order difference in the y-direction, represents a first order difference in the y-direction, represents a second order difference in the x-direction.

4. The cable insulation thickness measurement method based on the alternating curvature drive algorithm as claimed in claim 3, wherein, The inner edge initial population and the outer edge initial population are generated according to the inner edge curvature gene database and the outer edge curvature gene database, and the inner edge initial population and the outer edge initial population are generated according to the inner edge curvature gene database and the outer edge curvature gene database. The updated inner edge pixel coordinate is extracted from the inner edge curvature gene database in sequence, and the target curvature change amount and the target normalized curvature value set are determined according to the updated inner edge pixel coordinate. The comprehensive curvature factor set is obtained by calculating the comprehensive curvature factor according to the preset weight parameter set, the target curvature change amount and the target normalized curvature value set, and the comprehensive curvature factor set is obtained by calculating the comprehensive curvature factor according to the preset weight parameter set, the target curvature change amount and the target normalized curvature value set. The initial population individual probability set is calculated according to the comprehensive curvature factor sum and the updated inner edge pixel coordinate set, and the initial population individual probability set is calculated according to the comprehensive curvature factor sum and the updated inner edge pixel coordinate set. The initial population individual probability set is introduced into the pre-constructed blank probability distribution list to obtain the inner edge probability distribution list, and the inner edge initial population is obtained by performing the weighted random sampling operation on the inner edge probability distribution list. The outer edge initial population is generated based on the outer edge curvature gene database, and the outer edge initial population includes a plurality of updated outer edge pixel coordinate indexes.

5. The cable insulation thickness measurement method based on the alternating curvature drive algorithm as claimed in claim 4, wherein, The optimal inner fitness set and the optimal outer fitness set are obtained according to the inner edge initial population and the outer edge initial population, and the optimal inner fitness set and the optimal outer fitness set are obtained according to the inner edge initial population and the outer edge initial population. The target inner pixel coordinate set is determined according to the plurality of updated inner edge pixel coordinate indexes in the inner edge initial population, and the target outer pixel coordinate set is determined according to the plurality of updated outer edge pixel coordinate indexes in the outer edge initial population. The target inner pixel coordinate is extracted from the target inner pixel coordinate set in sequence, and the target inner pixel coordinate and the target outer pixel coordinate set are paired two by two to obtain the insulation thickness measurement point set, and the target inner pixel coordinate is extracted from the target inner pixel coordinate set in sequence. Calculate the insulation thickness of each insulation thickness measurement point in the insulation thickness measurement point set to obtain an insulation thickness set, wherein the insulation thickness is the Euclidean distance between the target inner pixel coordinates and the target outer pixel coordinates in the insulation thickness measurement point; Confirm the optimal insulation thickness from the insulation thickness set, and calculate the optimal inner fitness based on the optimal insulation thickness, wherein the optimal inner fitness is the reciprocal of the optimal insulation thickness; Summarize the optimal inner fitness to obtain an optimal inner fitness set corresponding to the target inner pixel coordinate set, and obtain an optimal outer fitness set based on the target outer pixel coordinate set.

6. The cable insulation thickness measurement method based on the alternating curvature drive algorithm as claimed in claim 5, wherein, The optimal insulation thickness measurement coordinate set is obtained based on the optimal inner fitness set and the optimal outer fitness set, comprising: Set the current operation edge flag and the measurement point counter, wherein the current operation edge flag includes true and false, and the initial value of the measurement point counter is 0; Confirm that the current operation edge flag is true, perform adaptive crossover operation on the inner edge initial population to obtain the inner edge population gene sequence, and perform adaptive mutation operation on the inner edge population gene sequence to obtain the updated inner edge population sequence; Mix and pair the updated inner edge population sequence and the outer edge pixel coordinate array to obtain a mixed pairing group set, and obtain the candidate insulation thickness measurement coordinate based on the mixed pairing group set; According to the preset removal ratio, the inner edge pixel coordinate array and the outer edge pixel coordinate array, calculate the inner edge pixel removal quantity and the outer edge pixel removal quantity respectively; According to the candidate insulation thickness measurement coordinate, the inner edge pixel removal quantity, the outer edge pixel removal quantity, the inner edge pixel coordinate array and the outer edge pixel coordinate array, obtain the optimized inner edge pixel coordinate array and the optimized outer edge pixel coordinate array; Update the outer edge initial population according to the optimized outer edge pixel coordinate array, and perform the plus one operation on the measurement point counter to obtain the updated measurement point counter; Switch the current operation edge flag to obtain the switched operation edge flag with the operation edge flag being false, and perform adaptive crossover mutation operation on the updated outer edge initial population and the optimized inner edge pixel coordinate array to obtain the candidate insulation thickness measurement coordinate, the second inner edge pixel coordinate array and the second outer edge pixel coordinate array; Perform the plus one operation on the updated measurement point counter to obtain the second updated measurement point counter, take the second updated measurement point counter as the measurement point counter, obtain the second inner edge initial population based on the second inner edge pixel coordinate array, and take the second inner edge initial population and the second outer edge pixel coordinate array as the inner edge initial population and the outer edge pixel coordinate array respectively; Return to the step of confirming that the current operation edge flag is true until the value of the measurement point counter is greater than or equal to 6; Summarize the candidate insulation thickness measurement coordinate and the candidate insulation thickness measurement coordinate to obtain the optimal insulation thickness measurement coordinate set.

7. The cable insulation thickness measurement method based on the alternating curvature drive algorithm as claimed in claim 6, wherein, The adaptive crossover operation on the inner edge initial population to obtain the inner edge population gene sequence comprises: According to the inner edge initial population and the optimal inner fitness set, an identified inner edge initial population is obtained, and the identified inner edge initial population is grouped two by two to obtain an inner population group set, wherein the inner population group set includes a plurality of inner population groups, and each inner population group includes two inner edge pixel coordinates; The following operations are performed on each inner population group in the inner population group set: According to the inner population group, a maximum cross probability is obtained, a random cross probability is generated, and the random cross probability is compared with the maximum cross probability; If the maximum cross probability is less than or equal to the random cross probability, the inner population group is taken as a reserved inner population group; If the maximum cross probability is greater than the random cross probability, a cross operation is performed on the inner population group to obtain an optimized inner population group; The reserved inner population groups and the optimized inner population groups are respectively summarized to obtain a reserved inner population group set and an optimized inner population group set, and the reserved inner population group set and the optimized inner population group set are introduced into a pre-constructed blank gene sequence to obtain an inner edge population gene sequence.

8. The cable insulation thickness measurement method based on the alternating curvature drive algorithm as claimed in claim 7, wherein, The identified inner edge initial population is obtained according to the inner edge initial population and the optimal inner fitness set, including: According to the inner edge initial population and the optimal inner fitness set, the highest inner fitness, the lowest inner fitness and the average fitness are determined; According to the inner edge curvature gene database, the maximum curvature factor is determined, and the updated inner edge pixel coordinate index is extracted from the inner edge initial population in turn, and the target inner fitness is determined from the inner edge curvature gene database according to the updated inner edge pixel coordinate index; The cross probability is calculated according to the highest inner fitness, the lowest inner fitness, the average fitness, the target inner fitness and the maximum curvature factor, wherein the calculation formula of the cross probability is as follows: wherein, represents a cross probability, , , , and all represent preset cross fitness coefficients, represents a target intra fitness, represents an average fitness, represents a highest intra fitness, represents a lowest intra fitness, represents a maximum curvature factor; The cross probability set is obtained by summarizing the cross probability, and each updated inner edge pixel coordinate in the inner edge initial population is labeled by using the cross probability set to obtain the identified inner edge initial population.

9. The cable insulation thickness measurement method based on the alternating curvature drive algorithm as claimed in claim 8, wherein, The cross operation is performed on the inner population group to obtain the optimized inner population group, including: According to the two inner edge pixel coordinates in the inner population group, a first pixel index value and a second pixel index value are obtained, and the first pixel index value and the second pixel index value are respectively converted into pixel index values by using a preset fixed number of bits to obtain a first binary Gray code sequence and a second binary Gray code sequence; The first binary Gray code sequence and the second binary Gray code sequence are respectively segmented to obtain a first segmentation sequence set and a second segmentation sequence set, wherein the first segmentation sequence set includes a first segmentation front sequence, a first segmentation middle sequence and a first segmentation rear sequence, and the second segmentation sequence set includes a second segmentation front sequence, a second segmentation middle sequence and a second segmentation rear sequence; The first segmentation middle sequence and the second segmentation middle sequence are exchanged to obtain a first exchanged Gray code sequence and a second exchanged Gray code sequence; The first exchanged Gray code sequence and the second exchanged Gray code sequence are respectively decoded into a first decoded index value and a second decoded index value, and an effective index value interval is obtained; If the first decoded index value and the second decoded index value are both located in the effective index value interval, the first decoded index value and the second decoded index value are determined as the optimized inner population group. Otherwise, a boundary correction operation is performed on the first decoding index value or the second decoding index value, to obtain an optimized inner population group.

10. A cable insulation thickness measurement system based on an alternating curvature drive algorithm, characterized by, The system comprises: An edge profile extraction module is configured to receive a cable insulation thickness measurement instruction, collect a cable cross-section image according to the cable insulation thickness measurement instruction, and extract an inner edge profile and an outer edge profile from the cable cross-section image; An inner-outer pixel coordinate acquisition module is configured to acquire an inner edge pixel coordinate set and an outer edge pixel coordinate set according to the inner edge profile and the outer edge profile, and input the inner edge pixel coordinate set and the outer edge pixel coordinate set into two pre-constructed empty arrays respectively, to obtain an inner edge pixel coordinate array and an outer edge pixel coordinate array; A curvature gene database construction module is configured to construct an inner edge curvature gene database and an outer edge curvature gene database according to the inner edge pixel coordinate array and the outer edge pixel coordinate array; An optimal insulation thickness measurement module is configured to generate an inner edge initial population and an outer edge initial population according to the inner edge curvature gene database and the outer edge curvature gene database, acquire an optimal inner fitness set and an optimal outer fitness set according to the inner edge initial population and the outer edge initial population, acquire an optimal insulation thickness measurement coordinate set based on the optimal inner fitness set and the optimal outer fitness set, and complete cable insulation thickness measurement based on an alternating curvature driving algorithm based on the optimal insulation thickness measurement coordinate set.