CN109978832B - Twisted pair lay detection method based on edge reconstruction - Google Patents

Twisted pair lay detection method based on edge reconstruction Download PDF

Info

Publication number
CN109978832B
CN109978832B CN201910155109.5A CN201910155109A CN109978832B CN 109978832 B CN109978832 B CN 109978832B CN 201910155109 A CN201910155109 A CN 201910155109A CN 109978832 B CN109978832 B CN 109978832B
Authority
CN
China
Prior art keywords
twisted pair
coefficient
value
column
upper edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910155109.5A
Other languages
Chinese (zh)
Other versions
CN109978832A (en
Inventor
李俊晖
石守东
徐淼华
方劲
陈锦涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo University
Original Assignee
Ningbo University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ningbo University filed Critical Ningbo University
Priority to CN201910155109.5A priority Critical patent/CN109978832B/en
Publication of CN109978832A publication Critical patent/CN109978832A/en
Application granted granted Critical
Publication of CN109978832B publication Critical patent/CN109978832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Abstract

The invention discloses a twisted pair twist lay detection method based on edge reconstruction, which comprises the steps of collecting original images of twisted pairs in real time, carrying out gray level pretreatment on the collected original images of the twisted pairs to obtain gray level images, drawing upper edge curve graphs of the twisted pairs based on the gray level images, constructing a training array based on the upper edge curve graphs of the twisted pairs, then constructing a Hammerstein model, training the Hammerstein model, reconstructing the upper edge curve graphs of the twisted pairs by using the trained Hammerstein model, finding out actual twist points of the twisted pairs in the original images from the reconstructed upper edge curve graphs of the twisted pairs, calculating the number of pixel points at intervals between every two adjacent actual twist points, and then calculating the twist lay between every two adjacent actual twist points; the method has the advantages of high detection efficiency and high detection precision, and when the detection result is unqualified, the production line can be immediately stopped, so that the rejection rate and the production cost are reduced, and the loss is reduced.

Description

Twisted pair lay detection method based on edge reconstruction
Technical Field
The invention relates to a twisted pair lay detection method, in particular to a twisted pair lay detection method based on edge reconstruction.
Background
With the rapid development of the information age, networks have become an indispensable part of people's lives. The network cable is used as a main medium for network information transmission, and the signal transmission function of the network cable is actually completed by four twisted pairs in the network cable, so that the quality of the twisted pairs directly determines the signal quality of the network cable. The twist lay, one of the important technical indicators of twisted pair, directly affects the quality of signal transmission of twisted pair.
The traditional twisted pair lay detection method is realized by a manual detection method after the twisted pair is produced, but the manual detection method has low efficiency and larger detection error, and the twisted pair is completely produced during detection, so that the rejection rate of the twisted pair is very high.
In recent years, computer vision technology has been rapidly developed. The computer vision technology obtains the relevant external information wanted by people by processing and analyzing the environment image acquired by the acquisition. The quality detection of industrial products by computer vision technology has high efficiency and high precision, so that the technology is used for detecting the quality of the industrial products more and more. At present, researchers have proposed a method for detecting the twist pitch of a twisted pair using a computer vision technology, but since twisted pair images collected in an industrial environment contain a large amount of industrial noise, these methods filter the twisted pair images in the detection process, and the filtering process filters out the industrial noise and simultaneously causes the twisted pair image to lose real information, so that the detection accuracy of the twist pitch of the twisted pair is greatly reduced.
Therefore, the twisted pair lay length detection method without filtering the images of the twisted pair is designed, and has important significance for improving the detection precision of the twisted pair, and reducing the rejection rate and the production cost of the twisted pair.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a twisted pair lay detection method based on edge reconstruction, which has high detection precision and can reduce the rejection rate and production cost of twisted pairs.
The technical scheme adopted by the invention for solving the technical problems is as follows: a twisted pair lay detection method based on edge reconstruction comprises the following steps:
(1) Acquiring an original image of the twisted pair in real time, and performing gray level preprocessing on the acquired original image of the twisted pair to obtain a gray level image of the twisted pair;
(2) Drawing an upper edge curve graph of the twisted pair based on the gray image of the twisted pair, and constructing a training array based on the upper edge curve graph of the twisted pair;
(3) Constructing a Hammerstein model;
(4) Training the Hammerstein model based on the training array to obtain a trained Hammerstein model;
(5) Reconstructing an upper edge curve graph of the twisted pair by using a trained Hammerstein model;
(6) Finding out the twisting point of the twisted pair from the reconstructed graph of the upper edge of the twisted pair, wherein the found twisting point of the twisted pair is the actual twisting point of the twisted pair in the original image;
(7) And calculating the number of the pixel points at intervals between every two adjacent actual twisting points in the original image, and obtaining the twisting distance between every two adjacent actual twisting points according to the calculated number of the pixel points.
The step (1) of obtaining the grayscale image of the twisted pair specifically comprises the following steps:
1.1. fixing an industrial-grade net mouth camera with 1300 ten thousand pixels above the rear side of a wire outlet of a twisted pair wire twisting machine, arranging black light-absorbing photographic cloth below the rear side of the wire outlet of the twisted pair wire twisting machine as a background, and setting the vertical distance from the bottom of a lens of the industrial-grade net mouth camera to a twisted pair to be 7.5-9.5 cm;
1.2. the industrial-grade net mouth camera collects images of a twisted pair passing through the lower part of the twisted pair after being output from a wire outlet of the twisted pair stranding machine in real time, the collected images of the twisted pair are used as original images of the twisted pair, the resolution of the original images of the twisted pair is recorded as mxn, m represents the number of rows, n represents the number of columns, and the original images of the twisted pair are sent to a computer;
1.3. and carrying out graying processing on the original image of the twisted pair in a computer to obtain a grayscale image of the twisted pair with the resolution of m multiplied by n.
3. The twisted pair lay length detection method based on edge reconstruction as claimed in claim 1, wherein the step (2) of plotting a graph of the upper edge of the twisted pair and constructing the training array based on the graph of the upper edge of the twisted pair comprises the specific steps of:
2.1. calculating the gray value of each pixel point in the gray image of the twisted pair;
2.2. setting a gray level threshold, and marking the gray level threshold as beta, and making beta =20, starting from the 1 st column to the nth column of the gray level image, and processing each column according to the following rules: the method comprises the following steps of sequentially checking rows from the 1 st row to the mth row in the h row, modifying the gray value of a pixel point with the gray value more than or equal to beta found in the first row to be 255, and modifying the gray values of all other pixel points in the h row to be 0, wherein h =1,2, \ 8230n; the graph obtained after the gray level image processing is finished is the upper edge curve graph of the twisted pair;
2.3. marking the pixel point with the gray value more than or equal to beta found first in the h-th column as p h ,p h The value of (b) is equal to the number of rows of the pixel point in the h column; constructing a training array comprising n data, recording the training array as A, and recording the h-th data in the training array A as A h A 1 is to p h Is given by the value of A h
The expression of the Hammerstein model constructed in the step (3) is as follows:
y(T)=i 1 ·x(T)+i 2 ·x(T-1)+c 1 ·w(T)+c 2 ·w(T-1)-o 1 ·y(T-1)
wherein T represents the sampling time of the Hammerstein model, T =1,2, \8230n, y (T) is the output value of the Hammerstein model at the T sampling time, y (T-1) is the output value of the Hammerstein model at the T-1 sampling time, x (T) is the normal input value at the T sampling time, i 1 Is the coefficient of the normal input value at the sampling time T, x (T-1) is the normal input value at the sampling time T-1, i 2 Coefficient of normal input value at the time of T-1 sampling o 1 Is the coefficient of the output value of the Hammerstein model at the T-1 sampling time, w (T) is the noise input value of the Hammerstein model at the T sampling time, c 1 A coefficient that is a noise input value at the time of T sampling; w (T-1) is the noise input value of Hammerstein model at the sampling moment of T-1, c 2 Is the coefficient of the noise input value at the sampling time T-1, "·" is the sign of the multiplication.
The step (4) is based on the training array, training the Hammerstein model, and the specific steps of obtaining the trained Hammerstein model are as follows:
4.1 train the ith data A in array A l As a model of the Hammerstein at the l sampling instantsLet y (l) = A l ,l=1,2,…n;
4.2 determining the coefficient i in the Hammerstein model 1 、i 2 、o 1 、c 1 、c 2 The method comprises the following specific steps:
4.2.1 5 temporary coefficient groups each including 20 temporary coefficients are set, and the 5 temporary coefficient groups are respectively denoted as it 1 、it 2 、ot 1 、ct 1 And ct 2 Set it of temporary coefficients 1 The jth temporary coefficient is recorded as it 1 (j) Set it of temporary coefficients 2 The jth temporary coefficient is recorded as it 2 (j) Group ot of temporary coefficients 1 The jth temporary coefficient in (j) is marked as ot 1 (j) The temporary coefficient set ct 1 The j-th temporary coefficient is marked as ct 1 (j) A temporary coefficient set ct 2 The j-th temporary coefficient is marked as ct 2 (j) J =1,2, \ 823020, 20, respectively, it is converted to an it by a random function 1 (j)、it 2 (j)、ot 1 (j)、ct 1 (j) And ct 2 (j) The 100 data are initialized to random numbers greater than 0 and less than 5;
4.2.2 building a coefficient calculation model based on the temporary coefficients in the 5 temporary coefficient groups, the coefficient calculation model is expressed as:
Figure BDA0001982578850000041
wherein the content of the first and second substances,
Figure BDA0001982578850000042
representing the sampling instants of the coefficient calculation models,
Figure BDA0001982578850000043
represent
Figure BDA0001982578850000044
The jth output of the sampling instant coefficient computation model,
Figure BDA0001982578850000045
represent
Figure BDA0001982578850000046
Sampling the jth output of the time coefficient computation model, yt (j, 0) =0, wt (0) =0;
4.2.3 pairs
Figure BDA0001982578850000047
Carry out initialization assignment to ensure that
Figure BDA0001982578850000048
4.2.4 pairs of coefficients i 1 、i 2 、o 1 、c 1 、c 2 To proceed with
Figure BDA0001982578850000049
The secondary updating comprises the following specific processes:
A. using pairs of random functions
Figure BDA00019825788500000410
Assigning to be a random number larger than 0 and smaller than 1;
B. will it 1 (j)、it 2 (j)、ot 1 (j)、ct 1 (j) And ct 2 (j) Calculated by substituting into a coefficient calculation model
Figure BDA00019825788500000411
C. Will be provided with
Figure BDA00019825788500000412
The calculation error of the jth output of the sampling time coefficient calculation model is recorded as
Figure BDA00019825788500000413
Error is calculated according to the following formula
Figure BDA00019825788500000414
Figure BDA00019825788500000415
D. Comparison
Figure BDA00019825788500000416
To
Figure BDA00019825788500000417
To find the smallest calculation error among them, the smallest calculation error is
Figure BDA00019825788500000418
E. To i 1 、i 2 、o 1 、c 1 、c 2 Update the current value of (a): let i 1 =it 1 (Be)、i 2 =it 2 (Be)、o 1 =ot 1 (Be)、c 1 =ct 1 (Be)、c 2 =ct 2 (Be);
4.2.5 pairs it 1 (j)、it 2 (j)、ot 1 (j)、ct 1 (j) And ct 2 (j) Updating the value of (c): by it 1 (j)+0.8·(it 1 (Be)-it 1 (j) Value of) update it 1 (j) The current value of (1) is it 2 (j)+0.8·(it 2 (Be)-it 2 (j) Value of) update it 2 (j) Current value of, take ot 1 (j)+0.8·(ot 1 (Be)-ot 1 (j) Value update ot of) to 1 (j) The current value of (c) is ct 1 (j)+0.8·(ct 1 (Be)-ct 1 (j) Update ct of the value of (c) 1 (j) The current value of (c) is ct 2 (j)=ct 2 (j)+0.8·(ct 2 (Be)-ct 2 (j) Update ct of the value of (c) 2 (j) The current value of (a); in the updating process, each parameter participating in operation in each calculation adopts the latest value;
4.2.6 judgment
Figure BDA0001982578850000051
Whether n is equal to n, if n is equal to n, i after the nth update 1 、i 2 、o 1 、c 1 、c 2 I is each coefficient of Hammerstein model, i is 1 、i 2 、o 1 、c 1 、c 2 Substituting the expression into a Hammerstein model to obtain a trained Hammerstein model; if not equal to n, then adopt
Figure BDA0001982578850000052
Is updated by adding 1 to the current value
Figure BDA0001982578850000053
Then return to step 4.2.4 for coefficient i 1 、i 2 、o 1 、c 1 、c 2 Performing next update until
Figure BDA0001982578850000054
Is equal to n.
The specific process of reconstructing the upper edge graph of the twisted pair by using the trained Hammerstein model in the step (5) is as follows:
5.1, setting w (T) =0, x (0) =0 and y (0) =0, setting a normal input value x (T) to be constant 1, and calculating outputs y (1) to y (n) of the trained Hammerstein model;
5.2 constructing a reconstructed edge data group comprising n data, marking the reconstructed edge data group as B, and marking the T-th data in the reconstructed edge data group as B T The value of y (T) obtained in step 5.1 is assigned to B T And taking the n data in the reconstructed edge data group B as the upper edge of the twisted pair, redrawing to obtain an upper edge curve of the twisted pair, and completing reconstruction of an upper edge curve graph of the twisted pair.
The specific step of finding out the twist point of the twisted pair from the reconstructed graph of the upper edge of the twisted pair in the step (6) is as follows:
6.1 scanning the reconstructed edge data group B in sequence from left to right, and finding all columns from the 1 st column to the nth column of the reconstructed edge data group B in sequence according to the scanning sequence, wherein the columns meet the following conditions: in every adjacent three columns, the number of the black pixel points in the middle column is less than or equal to that of the black pixel points in the previous column and less than that of the black pixel points in the next column;
6.2 counting the number of columns meeting the condition found in step 6.1, recording the number as Q, obtaining the column number of the column found at the kth time in step 6.1, and recording the column number as S k Wherein k =1,2, \8230q;
6.3 constructing a final edge data group comprising Q data, marking the final edge data group as C, and marking the kth data in the final edge data group as C k Will S k Value of (2) to C k
6.4 the Q data in the final edge data set C is the column number of the column where the actual twist point of the twisted pair is located in the original image, and the actual twist point of the twisted pair in the original image is found according to the column number of the column where the actual twist point of the twisted pair is located in the original image.
The specific steps of calculating the lay length between every two adjacent actual lay points in the step (7) are as follows:
7.1 recording the number of pixel points between the u-th actual twisted point and the u + 1-th actual twisted point as H u ,u=1,2,…Q-1,H u =S u+1 -S u
7.2 marking the lay length between the u actual lay point and the u +1 actual lay point as D u ,D u =H u D, d is the length of a single pixel point in the collected original image.
Compared with the prior art, the method has the advantages that the original image of the twisted pair is collected in real time, the grey scale pretreatment is carried out on the collected original image of the twisted pair to obtain the grey scale image of the twisted pair, the upper edge curve graph of the twisted pair is drawn based on the grey scale image of the twisted pair, the training array is constructed based on the upper edge curve graph of the twisted pair, the Hammerstein model is constructed based on the training array, the Hammerstein model is trained based on the training array to obtain the trained Hammerstein model, the upper edge curve graph of the twisted pair is reconstructed by using the trained Hammerstein model, the twisting point of the twisted pair is found from the reconstructed upper edge curve graph of the twisted pair, the found twisting point of the twisted pair is the actual twisting point of the twisted pair in the original image, the number of pixels spaced between every two adjacent actual twisting points in the original image is calculated, the distance between every two adjacent actual twisting points is obtained according to the number of the calculated pixels, the Hammerstein model is introduced, the Hammerstein model is used for realizing the reconstruction of the twisting point on the reconstructed twisting point model, the basis of the upper edge curve graph of the original twisted pair, the defect that the filtering is caused by the filtering of the conventional method, the high-based on the visual detection of the twisting point, the defect detection method, the rejection rate detection method is quickly, the rejection rate is quickly, and the rejection rate is reduced, and the rejection rate of the rejection rate is quickly, and the rejection rate is reduced.
Drawings
FIG. 1 is an original image of a twisted pair sampled by the twisted pair lay detection method of the present invention;
FIG. 2 is a graph of the upper edge of a twisted pair drawn based on a gray scale image of the twisted pair in the twisted pair lay detection method of the present invention;
FIG. 3 is a graph illustrating an update evolution process of each coefficient of a Hammerstein model in the twisted pair lay detection method of the present invention;
fig. 4 is a graph of an upper edge of a twisted pair reconstructed by a Hammerstein model in the twisted pair lay detection method of the present invention.
Detailed Description
The invention discloses a twisted pair lay detection method based on edge reconstruction, which is further explained by combining with the specific embodiment of the attached drawings.
The embodiment is as follows: a twisted pair lay detection method based on edge reconstruction comprises the following steps:
(1) Acquiring an original image of the twisted pair in real time, and performing gray level preprocessing on the acquired original image of the twisted pair to obtain a gray level image of the twisted pair;
(2) Drawing an upper edge curve graph of the twisted pair based on the gray image of the twisted pair, and constructing a training array based on the upper edge curve graph of the twisted pair;
(3) Constructing a Hammerstein model;
(4) Training the Hammerstein model based on the training array to obtain a trained Hammerstein model;
(5) Reconstructing an upper edge curve graph of the twisted pair by using a trained Hammerstein model;
(6) Finding out the twisting point of the twisted pair from the reconstructed graph of the upper edge of the twisted pair, wherein the found twisting point of the twisted pair is the actual twisting point of the twisted pair in the original image;
(7) And calculating the number of the pixel points at intervals between every two adjacent actual twisting points in the original image, and obtaining the twisting distance between every two adjacent actual twisting points according to the calculated number of the pixel points.
In this embodiment, the specific steps of obtaining the grayscale image of the twisted pair in step (1) are as follows:
1.1. fixing an industrial-grade net mouth camera with 1300 ten thousand pixels above the rear side of a wire outlet of a twisted pair wire twisting machine, arranging black light-absorbing photographic cloth below the rear side of the wire outlet of the twisted pair wire twisting machine as a background, and setting the vertical distance from the bottom of a lens of the industrial-grade net mouth camera to a twisted pair to be 7.5-9.5 cm;
1.2. the industrial-grade network port camera collects images of a twisted pair passing through the lower part of the twisted pair after being output from an outlet of the twisted pair stranding machine in real time, the collected images of the twisted pair are used as original images of the twisted pair, the resolution of the original images of the twisted pair is recorded as mxn, m represents row number, n represents column number, and the original images of the twisted pair are sent to a computer;
1.3. and (3) carrying out gray processing on the original image of the twisted pair in a computer to obtain a gray image of the twisted pair with the resolution of m multiplied by n.
In this embodiment, the drawing the graph of the upper edge of the twisted pair in step (2), and the constructing the training array based on the graph of the upper edge of the twisted pair specifically includes:
2.1. calculating the gray value of each pixel point in the gray image of the twisted pair;
2.2. setting a gray level threshold, and marking the gray level threshold as beta, and making beta =20, starting from the 1 st column to the nth column of the gray level image, and processing each column according to the following rules: the method comprises the following steps of sequentially checking rows from the 1 st row to the mth row in the h row, modifying the gray value of a pixel point with the gray value more than or equal to beta found in the first row to be 255, and modifying the gray values of all other pixel points in the h row to be 0, wherein h =1,2, \ 8230n; the graph obtained after the gray level image processing is finished is the upper edge curve graph of the twisted pair;
2.3. marking the pixel point with the gray value more than or equal to beta found first in the h-th row as p h ,p h The value of (b) is equal to the number of rows of the pixel point in the h column; constructing a training array comprising n data, recording the training array as A, and recording the h-th data in the training array A as A h Let p be h Is given by the value of A h
In this embodiment, the expression of the Hammerstein model constructed in step (3) is:
y(T)=i 1 ·x(T)+i 2 ·x(T-1)+c 1 ·w(T)+c 2 ·w(T-1)-o 1 ·y(T-1)
wherein T represents the sampling time of the Hammerstein model, T =1,2, \8230n, y (T) is the output value of the Hammerstein model at the T sampling time, y (T-1) is the output value of the Hammerstein model at the T-1 sampling time, x (T) is the normal input value at the T sampling time, i 1 Is the coefficient of the normal input value at the sampling time T, x (T-1) is the normal input value at the sampling time T-1, i 2 Coefficient of normal input value at the time of T-1 sampling, o 1 Is the coefficient of the output value of the Hammerstein model at the T-1 sampling time, w (T) is the noise input value of the Hammerstein model at the T sampling time, c 1 A coefficient which is a noise input value at the time of T sampling; w (T-1) is the noise input value of Hammerstein model at the sampling moment of T-1, c 2 Is the coefficient of the noise input value at the time of the T-1 sample, "·" is the sign of the multiplication operation.
In this embodiment, the training of the Hammerstein model based on the training array in step (4) to obtain the trained Hammerstein model specifically includes:
4.1 train the number I in array AAccording to A l As an output value of the Hammerstein model at l sampling times, i.e., let y (l) = a l ,l=1,2,…n;
4.2 determining the coefficient i in the Hammerstein model 1 、i 2 、o 1 、c 1 、c 2 The method comprises the following specific steps:
4.2.1 5 temporary coefficient groups each including 20 temporary coefficients are set, and the 5 temporary coefficient groups are respectively denoted as it 1 、it 2 、ot 1 、ct 1 And ct 2 The temporary coefficient is set to it 1 The jth temporary coefficient is recorded as it 1 (j) The temporary coefficient is set to it 2 The jth temporary coefficient is recorded as it 2 (j) Set the temporary coefficients ot 1 The jth temporary coefficient in the sequence is marked as ot 1 (j) A temporary coefficient set ct 1 The jth temporary coefficient is marked as ct 1 (j) A temporary coefficient set ct 2 The jth temporary coefficient is marked as ct 2 (j) J =1,2, \ 823020, 20, respectively, it is converted to an it by a random function 1 (j)、it 2 (j)、ot 1 (j)、ct 1 (j) And ct 2 (j) The 100 data are initialized to random numbers greater than 0 and less than 5;
4.2.2 building a coefficient calculation model based on the temporary coefficients in the 5 temporary coefficient groups, the coefficient calculation model is expressed as:
Figure BDA0001982578850000091
wherein the content of the first and second substances,
Figure BDA0001982578850000092
representing the sampling instants of the coefficient calculation models,
Figure BDA0001982578850000093
represent
Figure BDA0001982578850000094
The jth output of the sample time coefficient computation model,
Figure BDA0001982578850000095
represent
Figure BDA0001982578850000096
Sampling the jth output of the time-of-day coefficient computation model, yt (j, 0) =0, wt (0) =0;
4.2.3 pairs
Figure BDA0001982578850000097
Carry out initialization assignment to order
Figure BDA0001982578850000098
4.2.4 pairs of coefficients i 1 、i 2 、o 1 、c 1 、c 2 To proceed with
Figure BDA0001982578850000099
The secondary updating comprises the following specific processes:
A. using pairs of random functions
Figure BDA00019825788500000910
Assigning to be a random number larger than 0 and smaller than 1;
B. will it 1 (j)、it 2 (j)、ot 1 (j)、ct 1 (j) And ct 2 (j) Calculated by substituting into a coefficient calculation model
Figure BDA00019825788500000911
C. Will be provided with
Figure BDA00019825788500000912
The calculation error of the jth output of the sampling time coefficient calculation model is recorded as
Figure BDA00019825788500000913
Error is calculated according to the following formula
Figure BDA00019825788500000914
Figure BDA00019825788500000915
D. Comparison
Figure BDA00019825788500000916
To
Figure BDA00019825788500000917
Finding the smallest calculation error among them, the smallest calculation error is
Figure BDA00019825788500000918
E. To i 1 、i 2 、o 1 、c 1 、c 2 Updating the current value of: let i 1 =it 1 (Be)、i 2 =it 2 (Be)、o 1 =ot 1 (Be)、c 1 =ct 1 (Be)、c 2 =ct 2 (Be);
4.2.5 pairs it 1 (j)、it 2 (j)、ot 1 (j)、ct 1 (j) And ct 2 (j) Updating the value of (a): by it 1 (j)+0.8·(it 1 (Be)-it 1 (j) It) value update it 1 (j) The current value of (1) is it 2 (j)+0.8·(it 2 (Be)-it 2 (j) It) value update it 2 (j) Current value of, take ot 1 (j)+0.8·(ot 1 (Be)-ot 1 (j) Value update ot of) to 1 (j) Using the current value of ct 1 (j)+0.8·(ct 1 (Be)-ct 1 (j) Update ct of the value of (c) 1 (j) The current value of (c) is ct 2 (j)=ct 2 (j)+0.8·(ct 2 (Be)-ct 2 (j) Update ct of the value of (c) 2 (j) The current value of (a); in the updating process, each parameter participating in the operation in each calculation adopts the latest value;
4.2.6 judgment
Figure BDA0001982578850000101
Whether it is equal to n, if it is, thenUpdated i for the nth time 1 、i 2 、o 1 、c 1 、c 2 I is each coefficient of Hammerstein model, i is 1 、i 2 、o 1 、c 1 、c 2 Substituting the model into an expression of a Hammerstein model to obtain a trained Hammerstein model; if not equal to n, adopt
Figure BDA0001982578850000102
The current value of (1) is added to update
Figure BDA0001982578850000103
Then return to step 4.2.4 for coefficient i 1 、i 2 、o 1 、c 1 、c 2 Performing next update until
Figure BDA0001982578850000104
Equal to n.
In this embodiment, the specific process of reconstructing the upper edge graph of the twisted pair by using the trained Hammerstein model in the step (5) is as follows:
5.1, setting w (T) =0, x (0) =0 and y (0) =0, setting a normal input value x (T) to be constant 1, and calculating outputs y (1) to y (n) of the trained Hammerstein model;
5.2 constructing a reconstructed edge data group comprising n data, marking the reconstructed edge data group as B, and marking the T-th data in the reconstructed edge data group as B T The value of y (T) obtained in step 5.1 is assigned to B T And taking the n data in the reconstructed edge data group B as the upper edge of the twisted pair, redrawing to obtain an upper edge curve of the twisted pair, and completing reconstruction of an upper edge curve graph of the twisted pair.
In this embodiment, the specific step of finding the twist point of the twisted pair from the reconstructed upper edge graph of the twisted pair in step (6) is as follows:
6.1 scanning the reconstructed edge data group B in sequence from left to right, and finding all columns from the 1 st column to the nth column of the reconstructed edge data group B in sequence according to the scanning sequence, wherein the columns meet the following conditions: in every adjacent three columns, the number of the black pixel points in the middle column is less than or equal to that of the black pixel points in the previous column and less than that of the black pixel points in the next column;
6.2 counting the number of columns meeting the condition found in step 6.1, recording the number as Q, obtaining the column number of the column found at the kth time in step 6.1, and recording the column number as S k Wherein k =1,2, \ 8230;
6.3 constructing a final edge data group comprising Q data, marking the final edge data group as C, and marking the kth data in the final edge data group as C k Will S k Value of (2) to C k
6.4 the Q data in the final edge data set C is the column number of the column where the actual twist point of the twisted pair is located in the original image, and the actual twist point of the twisted pair in the original image is found according to the column number of the column where the actual twist point of the twisted pair is located in the original image.
In this embodiment, the specific step of calculating the lay length between every two adjacent actual lay points in step (7) is as follows:
7.1 recording the number of pixel points between the u-th actual twisted point and the u + 1-th actual twisted point as H u ,u=1,2,…Q-1,H u =S u+1 -S u
7.2 marking the lay length between the u actual lay point and the u +1 actual lay point as D u ,D u =H u D, d is the length of a single pixel point in the acquired original image, and d =23um.
In this embodiment, an original image of a twisted pair sampled by the twisted pair lay detection method of the present invention is shown in fig. 1, an upper edge curve of the twisted pair drawn based on a gray image of the twisted pair is shown in fig. 2, an update evolution process curve of each coefficient of a Hammerstein model is shown in fig. 3, and an upper edge curve of the twisted pair reconstructed by the Hammerstein model in the twisted pair lay detection method of the present invention is shown in fig. 4.
As can be seen from fig. 2, the upper edge curve of the twisted pair contains noise, which results in that the twist point of the twisted pair cannot be accurately obtained and the twist lay cannot be calculated. As can be seen from the analysis of FIG. 3, in the twisted pair lay detection method of the present invention, each coefficient of the Hammerstein model can converge to reach an accurate value. As can be seen from the analysis of FIG. 4, the method of the present invention can effectively overcome the noise, and the reconstructed upper edge curve graph of the twisted pair has a smooth twisting point with accurate position.

Claims (8)

1. A twisted pair lay detection method based on edge reconstruction is characterized by comprising the following steps:
(1) Acquiring an original image of the twisted pair in real time, and performing gray level preprocessing on the acquired original image of the twisted pair to obtain a gray level image of the twisted pair;
(2) Drawing an upper edge curve graph of the twisted pair based on the gray image of the twisted pair, and constructing a training array based on the upper edge curve graph of the twisted pair;
(3) Constructing a Hammerstein model;
(4) Training the Hammerstein model based on the training array to obtain a trained Hammerstein model;
(5) Reconstructing an upper edge curve graph of the twisted pair by using a trained Hammerstein model;
(6) Finding out the twisting point of the twisted pair from the reconstructed graph of the upper edge of the twisted pair, wherein the found twisting point of the twisted pair is the actual twisting point of the twisted pair in the original image;
(7) And calculating the number of the pixels spaced between every two adjacent actual twisting points in the original image, and obtaining the twisting distance between every two adjacent actual twisting points according to the calculated number of the pixels.
2. The twisted pair lay detection method based on edge reconstruction as claimed in claim 1, wherein the specific step of obtaining the gray scale image of the twisted pair in step (1) is:
1.1. fixing an industrial-grade net mouth camera with 1300 ten thousand pixels above the rear side of a wire outlet of a twisted pair wire twisting machine, arranging black light-absorbing photographic cloth below the rear side of the wire outlet of the twisted pair wire twisting machine as a background, and setting the vertical distance from the bottom of a lens of the industrial-grade net mouth camera to a twisted pair to be 7.5-9.5 cm;
1.2. the industrial-grade net mouth camera collects images of a twisted pair passing through the lower part of the twisted pair after being output from a wire outlet of the twisted pair stranding machine in real time, the collected images of the twisted pair are used as original images of the twisted pair, the resolution of the original images of the twisted pair is recorded as mxn, m represents the number of rows, n represents the number of columns, and the original images of the twisted pair are sent to a computer;
1.3. and carrying out graying processing on the original image of the twisted pair in a computer to obtain a grayscale image of the twisted pair with the resolution of m multiplied by n.
3. The twisted pair lay length detection method based on edge reconstruction as claimed in claim 2, wherein the step (2) of plotting a graph of the upper edge of the twisted pair and constructing the training array based on the graph of the upper edge of the twisted pair comprises the specific steps of:
2.1. calculating the gray value of each pixel point in the gray image of the twisted pair;
2.2. setting a gray level threshold, and marking the gray level threshold as beta, and making beta =20, starting from the 1 st column to the nth column of the gray level image, and processing each column according to the following rules: the method comprises the following steps of sequentially checking the lines from the line 1 of the h column to the line m of the h column according to the columns, modifying the gray value of a pixel point with the gray value which is found first in the h column and is more than or equal to beta into 255, and modifying the gray values of all other pixel points in the h column into 0, wherein h =1,2, \8230n; the graph obtained after the gray level image processing is finished is the upper edge curve graph of the twisted pair;
2.3. marking the pixel point with the gray value more than or equal to beta found first in the h-th column as p h ,p h The value of (b) is equal to the number of rows of the pixel point in the h column; constructing a training array comprising n data, recording the training array as A, and recording the h-th data in the training array A as A h A 1 is to p h Is given by the value of A h
4. The twisted pair lay detection method based on edge reconstruction as claimed in claim 3, wherein the expression of the Hammerstein model constructed in step (3) is as follows:
y(T)=i 1 ·x(T)+i 2 ·x(T-1)+c 1 ·w(T)+c 2 ·w(T-1)-o 1 ·y(T-1)
wherein T represents the sampling time of the Hammerstein model, T =1,2, \8230n, y (T) is the output value of the Hammerstein model at the T sampling time, y (T-1) is the output value of the Hammerstein model at the T-1 sampling time, x (T) is the normal input value at the T sampling time, i 1 Is the coefficient of the normal input value at the sampling time T, x (T-1) is the normal input value at the sampling time T-1, i 2 Coefficient of normal input value at the time of T-1 sampling o 1 Is the coefficient of the output value of the Hammerstein model at the T-1 sampling time, w (T) is the noise input value of the Hammerstein model at the T sampling time, c 1 A coefficient which is a noise input value at the time of T sampling; w (T-1) is the noise input value of Hammerstein model at the sampling moment of T-1, c 2 Is the coefficient of the noise input value at the time of the T-1 sample, "·" is the sign of the multiplication operation.
5. The twisted pair lay detection method based on edge reconstruction as claimed in claim 4, wherein the step (4) of training the Hammerstein model based on the training array comprises the specific steps of:
4.1 train the ith data A in array A l As an output value of the Hammerstein model at l sampling times, let y (l) = a l ,l=1,2,…n;
4.2 determining the coefficient i in the Hammerstein model 1 、i 2 、o 1 、c 1 、c 2 The method comprises the following specific steps:
4.2.1 5 temporary coefficient groups each including 20 temporary coefficients are set, and the 5 temporary coefficient groups are respectively denoted as it 1 、it 2 、ot 1 、ct 1 And ct 2 The temporary coefficient is set to it 1 The jth temporary coefficient is recorded as it 1 (j) The temporary coefficient is set to it 2 The jth temporary coefficient is recorded as it 2 (j) Set the temporary coefficients ot 1 The jth temporary coefficient in (j) is marked as ot 1 (j) The temporary coefficient set ct 1 The jth temporary coefficient is marked as ct 1 (j) The temporary coefficient set ct 2 The jth temporary coefficient is marked as ct 2 (j) J =1,2, \ 823020, 20, respectively, it is converted to an it by a random function 1 (j)、it 2 (j)、ot 1 (j)、ct 1 (j) And ct 2 (j) The 100 data are initialized to random numbers greater than 0 and less than 5;
4.2.2 building a coefficient calculation model based on the temporary coefficients in the 5 temporary coefficient groups, the coefficient calculation model is expressed as:
Figure FDA0001982578840000031
wherein the content of the first and second substances,
Figure FDA0001982578840000032
representing the sampling instants of the coefficient calculation models,
Figure FDA0001982578840000033
to represent
Figure FDA0001982578840000034
The jth output of the sample time coefficient computation model,
Figure FDA0001982578840000035
to represent
Figure FDA0001982578840000036
Sampling the jth output of the time-of-day coefficient computation model, yt (j, 0) =0, wt (0) =0;
4.2.3 pairs
Figure FDA0001982578840000037
Carry out initialization assignment to order
Figure FDA0001982578840000038
4.2.4 pairs of coefficients i 1 、i 2 、o 1 、c 1 、c 2 To proceed with the first
Figure FDA0001982578840000039
The secondary updating comprises the following specific processes:
A. using pairs of random functions
Figure FDA00019825788400000310
Assigning to be a random number larger than 0 and smaller than 1;
B. will it 1 (j)、it 2 (j)、ot 1 (j)、ct 1 (j) And ct 2 (j) Calculated by substituting into a coefficient calculation model
Figure FDA00019825788400000311
C. Will be provided with
Figure FDA00019825788400000312
The calculation error of the jth output of the sampling time coefficient calculation model is recorded as
Figure FDA00019825788400000313
Error is calculated according to the following formula
Figure FDA00019825788400000314
Figure FDA00019825788400000315
D. Comparison
Figure FDA00019825788400000316
To
Figure FDA00019825788400000317
To find the smallest calculation error among them, the smallest calculation error is
Figure FDA00019825788400000318
E. To i 1 、i 2 、o 1 、c 1 、c 2 Update the current value of (a): let i 1 =it 1 (Be)、i 2 =it 2 (Be)、o 1 =ot 1 (Be)、c 1 =ct 1 (Be)、c 2 =ct 2 (Be);
4.2.5 pairs it 1 (j)、it 2 (j)、ot 1 (j)、ct 1 (j) And ct 2 (j) Updating the value of (a): by using it 1 (j)+0.8·(it 1 (Be)-it 1 (j) It) value update it 1 (j) The current value of (1) is it 2 (j)+0.8·(it 2 (Be)-it 2 (j) It) value update it 2 (j) Current value of, take ot 1 (j)+0.8·(ot 1 (Be)-ot 1 (j) Value of ot) update ot 1 (j) Using the current value of ct 1 (j)+0.8·(ct 1 (Be)-ct 1 (j) Ct) value update 1 (j) The current value of (c) is ct 2 (j)=ct 2 (j)+0.8·(ct 2 (Be)-ct 2 (j) Ct) value update 2 (j) The current value of (a); in the updating process, each parameter participating in operation during each calculation adopts the current latest value;
4.2.6 judgment
Figure FDA0001982578840000041
Whether n is equal to n, if n is equal to n, i after the nth update 1 、i 2 、o 1 、c 1 、c 2 I is each coefficient of Hammerstein model, i is 1 、i 2 、o 1 、c 1 、c 2 Substituting the expression into a Hammerstein model to obtain a trained Hammerstein model; if not equal to n, adopt
Figure FDA0001982578840000042
Is updated by adding 1 to the current value
Figure FDA0001982578840000043
Then return to step 4.2.4 for coefficient i 1 、i 2 、o 1 、c 1 、c 2 Performing next iteration update until
Figure FDA0001982578840000044
Equal to n.
6. The twisted pair lay detection method based on edge reconstruction as claimed in claim 5, wherein the specific process of reconstructing the upper edge graph of the twisted pair by using the trained Hammerstein model in the step (5) is as follows:
5.1, setting w (T) =0, x (0) =0 and y (0) =0, setting a normal input value x (T) to be constant 1, and calculating outputs y (1) to y (n) of the trained Hammerstein model;
5.2 constructing a reconstructed edge data group comprising n data, marking the reconstructed edge data group as B, and marking the T-th data in the reconstructed edge data group as B T The value of y (T) obtained in step 5.1 is assigned to B T And taking the n data in the reconstructed edge data group B as the upper edge of the twisted pair, redrawing to obtain an upper edge curve of the twisted pair, and completing reconstruction of an upper edge curve graph of the twisted pair.
7. The twisted pair lay detection method based on edge reconstruction as claimed in claim 6, wherein the specific step of finding the twist point of the twisted pair from the graph of the upper edge of the reconstructed twisted pair in the step (6) is:
6.1 scanning the reconstructed edge data group B in sequence from left to right, and finding all columns from the 1 st column to the nth column of the reconstructed edge data group B in sequence according to the scanning sequence, wherein the columns meet the following conditions: in every adjacent three columns, the number of the black pixel points in the middle column is less than or equal to that of the black pixel points in the previous column and less than that of the black pixel points in the next column;
6.2 statistics of the conditions found in step 6.1 that are satisfiedThe number of columns, denoted Q, is obtained for the column number of the column found at the kth time in step 6.1, denoted S k Wherein k =1,2, \ 8230;
6.3 constructing a final edge data group comprising Q data, marking the final edge data group as C, and marking the kth data in the final edge data group as C k Will S k Value of (2) to C k
6.4 the Q data in the final edge data set C is the column number of the column where the actual twist point of the twisted pair is located in the original image, and the actual twist point of the twisted pair in the original image is found according to the column number of the column where the actual twist point of the twisted pair is located in the original image.
8. The method for detecting twisted pair lay length based on edge reconstruction as claimed in claim 7, wherein the step (7) of calculating the lay length between each two adjacent actual lay lengths comprises the following specific steps:
7.1 recording the number of pixel points between the u-th actual twisted point and the u + 1-th actual twisted point as H u ,u=1,2,…Q-1,H u =S u+1 -S u
7.2 marking the lay length between the u actual lay point and the u +1 actual lay point as D u ,D u =H u D, d is the length of a single pixel point in the collected original image.
CN201910155109.5A 2019-03-01 2019-03-01 Twisted pair lay detection method based on edge reconstruction Active CN109978832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910155109.5A CN109978832B (en) 2019-03-01 2019-03-01 Twisted pair lay detection method based on edge reconstruction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910155109.5A CN109978832B (en) 2019-03-01 2019-03-01 Twisted pair lay detection method based on edge reconstruction

Publications (2)

Publication Number Publication Date
CN109978832A CN109978832A (en) 2019-07-05
CN109978832B true CN109978832B (en) 2022-11-22

Family

ID=67077673

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910155109.5A Active CN109978832B (en) 2019-03-01 2019-03-01 Twisted pair lay detection method based on edge reconstruction

Country Status (1)

Country Link
CN (1) CN109978832B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110544242B (en) * 2019-08-26 2022-05-13 珠海博明软件有限公司 Real-time cable pitch extraction method
CN112945077B (en) * 2021-02-02 2023-02-28 杭州海康威视数字技术股份有限公司 Twisted pair lay length detection method and device applied to twisted pair cable

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE0003608D0 (en) * 2000-10-06 2000-10-06 Xcounter Ab Noise reduction in images
CN108038839A (en) * 2017-11-23 2018-05-15 宁波大学 Twisted-pair feeder lay real-time detection method on a kind of flow production line
CN108961331A (en) * 2018-06-29 2018-12-07 珠海博明软件有限公司 A kind of measurement method and device of twisted string pitch

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE0003608D0 (en) * 2000-10-06 2000-10-06 Xcounter Ab Noise reduction in images
CN108038839A (en) * 2017-11-23 2018-05-15 宁波大学 Twisted-pair feeder lay real-time detection method on a kind of flow production line
CN108961331A (en) * 2018-06-29 2018-12-07 珠海博明软件有限公司 A kind of measurement method and device of twisted string pitch

Also Published As

Publication number Publication date
CN109978832A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN110659718B (en) Small convolution nuclear cell counting method and system based on deep convolution neural network
CN108038839B (en) Real-time detection method for twisted pair twist pitch on production line
CN111402226A (en) Surface defect detection method based on cascade convolution neural network
CN112818969B (en) Knowledge distillation-based face pose estimation method and system
CN112733950A (en) Power equipment fault diagnosis method based on combination of image fusion and target detection
CN109903282B (en) Cell counting method, system, device and storage medium
CN109978832B (en) Twisted pair lay detection method based on edge reconstruction
CN110245550B (en) Human face noise data set CNN training method based on total cosine distribution
CN109325513B (en) Image classification network training method based on massive single-class images
CN113177937B (en) Improved YOLOv 4-tiny-based cloth defect detection method
CN110930378A (en) Emphysema image processing method and system based on low data demand
CN111222519A (en) Construction method, method and device of hierarchical colored drawing manuscript line extraction model
CN116612098B (en) Insulator RTV spraying quality evaluation method and device based on image processing
CN110728666B (en) Typing method and system for chronic nasosinusitis based on digital pathological slide
CN115661459A (en) 2D mean teacher model using difference information
CN110288026A (en) A kind of image partition method and device practised based on metric relation graphics
CN111832479B (en) Video target detection method based on improved self-adaptive anchor point R-CNN
CN115830514B (en) Whole river reach surface flow velocity calculation method and system suitable for curved river channel
CN113327243A (en) PAD light guide plate defect visualization detection method based on AYOLOv3-Tiny new framework
CN111932639A (en) Detection method of unbalanced defect sample based on convolutional neural network
CN115063410B (en) Steel pipe counting method based on anchor-free target detection
CN112730437B (en) Spinneret plate surface defect detection method and device based on depth separable convolutional neural network, storage medium and equipment
CN115760720A (en) Crack online detection method and system based on mobile device and super-resolution reconstruction segmentation network
CN112488125B (en) Reconstruction method and system based on high-speed visual diagnosis and BP neural network
CN112288694B (en) Method for identifying defects of power transformation equipment based on mask region convolution neural network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant