Display cable testing methods, devices, equipment and storage media
By extracting features from sample images of the ribbon cable area and training a support vector machine model, the problems of high false detection rate and low efficiency in ribbon cable detection are solved, and efficient and accurate ribbon cable detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN HAIWEI TECH CO LTD
- Filing Date
- 2022-11-18
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies for cable testing suffer from high false detection rates, low testing efficiency, and complex debugging and modification.
By acquiring sample images of the area to be detected (the ribbon cable region), determining the feature region, performing grayscale processing and normalization matrix transformation, and training feature vectors using a support vector machine model, ribbon cable detection is achieved.
It improves the accuracy of cable testing, reduces the false detection rate, and simplifies the debugging process.
Smart Images

Figure CN115761337B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital image processing technology, and in particular to a method, apparatus, device, and storage medium for detecting display screen ribbon cables. Background Technology
[0002] Ribbon cables, also known as flexible printed circuits (FPCs), have advantages such as flexibility, easy bending and folding, thinness, small size, simple connection, convenient disassembly, and easy electromagnetic interference (EMI) shielding. They are frequently used in the assembly and production of displays. Therefore, it is necessary to check whether the ribbon cables are properly connected. In the current production process, most ribbon cable inspections are done by human visual inspection, which is not high in quality and efficiency. Some use machine vision for inspection, but it also has a high false detection rate and is complicated to debug and modify.
[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main objective of this invention is to provide a method, apparatus, device, and storage medium for detecting display cable flex cables, aiming to solve the technical problem of high false detection rate in existing technologies for cable flex cable detection.
[0005] To achieve the above objectives, the present invention provides a method for detecting display screen ribbon cables, the method comprising the following steps:
[0006] Acquire sample images of the area to be detected for the ribbon cable;
[0007] The feature region is determined based on the sample image of the area of the cable to be detected.
[0008] The feature region image is processed to obtain a feature matrix;
[0009] The feature matrix is normalized to obtain the normalized matrix;
[0010] The normalized matrix is transformed into a vector to obtain the eigenvectors;
[0011] The feature vector is input into the initialization cable detection model for training to obtain the trained cable detection model.
[0012] An image of the area to be detected is obtained, and the trained ribbon cable detection model detects the image of the area to be detected to obtain the detection result.
[0013] Optionally, determining the feature region based on the sample image of the cable area to be detected includes:
[0014] The ribbon cable region of the sample image of the ribbon cable region to be detected is determined according to preset parameters;
[0015] The location and orientation of the wiring are determined by feature recognition of the wiring area.
[0016] The feature region is determined based on the position and direction of the wiring.
[0017] Optionally, the characteristic region is determined based on the position and direction of the ribbon cable, including:
[0018] The direction of the cable is detected;
[0019] When the direction of the ribbon cable is different from the preset direction, the image of the area to be detected is rotated so that the direction of the ribbon cable in the image of the area to be detected is consistent with the preset direction.
[0020] The feature region is determined based on the position of the ribbon cable.
[0021] Optionally, determining the feature region based on the position of the ribbon cable includes:
[0022] Determine the direction along the cable insertion direction and the direction perpendicular to the cable insertion direction based on the direction of the cable;
[0023] The size of the feature region is obtained by comparing the perpendicularity to the cable insertion direction with a preset value, based on the direction along the cable insertion.
[0024] The feature region is obtained based on the position of the ribbon cable and the size of the ribbon cable area.
[0025] Optionally, the normalization of the feature matrix to obtain a normalized matrix includes:
[0026] The average value of each row of data in the feature matrix is obtained by averaging the data.
[0027] The row averages are combined according to the row numbers before the average processing to obtain the first matrix;
[0028] The second matrix is obtained by calculating each data point in the first matrix;
[0029] Normalize the second matrix to obtain the normalized matrix.
[0030] Optionally, the step of inputting the feature vector into the initialization cable detection model for training to obtain the trained cable detection model includes:
[0031] Determine the type of the sample image of the region to be detected;
[0032] Add labels to the corresponding feature vectors according to the type of the sample images of the region to be detected;
[0033] The initial ribbon cable detection model is trained based on the labels to obtain the trained ribbon cable detection model.
[0034] Optionally, after acquiring the sample image of the area to be detected (the ribbon cable region), the method further includes:
[0035] Detection of the sample image of the area to be detected (the ribbon cable region);
[0036] When the sample image of the cable area to be detected is a complex cable slot, the number of complex cables is determined according to the sample image of the cable area to be detected.
[0037] The step of determining the feature region based on the sample image of the area to be detected ribbon cable is repeated a number of times, wherein the number of repetitions is consistent with the number of complex ribbon cables.
[0038] Furthermore, to achieve the above objectives, the present invention also proposes a display screen ribbon cable detection device, the display screen ribbon cable detection device comprising:
[0039] The sample acquisition module is used to acquire sample images of the area of the ribbon cable to be detected.
[0040] The feature region determination module is used to determine the feature region based on the sample image of the cable area to be detected.
[0041] The feature matrix determination module is used to perform grayscale processing on the feature region image to obtain the feature matrix;
[0042] The matrix normalization module is used to normalize the feature matrix to obtain a normalized matrix;
[0043] The feature vector generation module is used to transform the normalized matrix into a vector to obtain the feature vector.
[0044] The cable detection model training module is used to input the feature vector into the initial cable detection model for training, and obtain the trained cable detection model.
[0045] The ribbon cable detection module is used to acquire an image of the ribbon cable region to be detected. The trained ribbon cable detection model detects the image of the ribbon cable region to be detected and obtains the detection result.
[0046] Furthermore, to achieve the above objectives, the present invention also proposes a display screen cable testing device, which includes: a memory, a processor, and a display screen cable testing program stored in the memory and executable on the processor. The display screen cable testing program is configured to implement the steps of the display screen cable testing method described above.
[0047] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a display cable detection program, wherein the display cable detection program, when executed by a processor, implements the steps of the display cable detection method described above.
[0048] This invention acquires sample images of the cabling area to be detected; determines feature regions based on the sample images; performs grayscale processing on the feature region images to obtain a feature matrix; normalizes the feature matrix to obtain a normalized matrix; performs vector transformation on the normalized matrix to obtain a feature vector; inputs the feature vector into an initial cabling detection model for training to obtain a trained cabling detection model; acquires images of the cabling area to be detected, and the trained cabling detection model detects the cabling area images to obtain detection results. This invention achieves a series of processing steps on the acquired sample images, extracting features from the sample images to obtain feature vectors, training the initial cabling detection model based on the feature vectors to obtain a trained cabling detection model, and then performing cabling detection. This ensures that there are characteristically significant sample inputs during cabling detection, thereby guaranteeing the accuracy of the detection results. Attached Figure Description
[0049] Figure 1 This is a schematic diagram of the structure of a display screen cable testing device in the hardware operating environment involved in the embodiments of the present invention;
[0050] Figure 2 This is a flowchart illustrating the first embodiment of the display cable detection method of the present invention;
[0051] Figure 3 This is a flowchart illustrating the second embodiment of the display cable detection method of the present invention;
[0052] Figure 4 This is a flowchart illustrating the third embodiment of the display cable detection method of the present invention;
[0053] Figure 5 This is a structural block diagram of the first embodiment of the display cable detection device of the present invention.
[0054] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0055] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0056] Reference Figure 1 , Figure 1 This is a schematic diagram of the display cable testing device structure in the hardware operating environment involved in the embodiments of the present invention.
[0057] like Figure 1 As shown, the display cable detection device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0058] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the display cable testing equipment and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0059] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a display cable detection program.
[0060] exist Figure 1 In the display cable testing device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the display cable testing device of the present invention can be set in the display cable testing device, and the display cable testing device calls the display cable testing program stored in the memory 1005 through the processor 1001 and executes the display cable testing method provided in the embodiment of the present invention.
[0061] This invention provides a method for detecting display screen ribbon cables, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of a display screen cable detection method according to the present invention.
[0062] In this embodiment, the display cable detection method includes the following steps:
[0063] Step S10: Obtain a sample image of the area to be detected (the ribbon cable area).
[0064] It should be noted that the execution subject of this embodiment is a display screen cable testing device, which has functions such as data processing, data communication and program execution. The display screen cable testing device can be an integrated controller, a control computer or other devices with similar functions. This embodiment does not limit the scope of the invention.
[0065] It is understandable that the sample image of the ribbon cable area to be detected refers to an image of the display ribbon cable slot area taken by a camera. In addition to the image content, the sample image of the ribbon cable area to be detected also includes the result of whether the image passes the detection.
[0066] In a specific implementation, an image of the display cable slot area can be captured by an external independent image acquisition device, or the image acquisition device built into the display cable detection device can be used to capture the image of the display cable slot area. The external independent image acquisition device can be a mobile phone, computer, camera, etc., and this embodiment does not impose any restrictions. After capturing the image of the display cable slot area, the image can be sampled to determine whether the cable insertion in the image is successful.
[0067] Step S20: Determine the feature region based on the sample image of the cable area to be detected.
[0068] It should be noted that the feature region refers to the area at the ribbon cable slot in the sample image of the ribbon cable area to be detected. The location of the feature region is determined according to the location of the ribbon cable slot, and the feature region includes the insertion status of the ribbon cable into the ribbon cable slot.
[0069] In practice, the display cable inspection device finds the region that matches the characteristics of the cable slot in the sample image of the area to be inspected based on the characteristics of the cable slot. It also reduces noise interference from other areas by cropping other image content that is not related to the cable slot, and retains the image region that matches the characteristics of the cable slot to form the feature region.
[0070] Step S30: Perform grayscale processing on the feature region image to obtain the feature matrix.
[0071] It should be noted that the feature matrix refers to the matrix obtained by performing grayscale processing on the feature region, processing the color corresponding to each pixel in the feature region into grayscale, thereby obtaining grayscale pixel values, and arranging the obtained grayscale pixel values according to the position of the corresponding pixels. The grayscale pixel values in the matrix are in the range of [0, 256).
[0072] In the specific implementation, the pixel values of the image in the feature region are converted to grayscale. Each grayscale pixel value is combined according to its original pixel position to form a feature matrix M0, wherein the grayscale pixel value ranges from [0, 256), and the size of the matrix is consistent with the size of the feature region.
[0073] Step S40: Normalize the feature matrix to obtain a normalized matrix.
[0074] It should be noted that the normalized matrix is obtained by normalizing the characteristic matrix, and the matrix values in the normalized matrix are...
[0075] In practice, matrix normalization can bring the data to the same unit of measurement, making the resulting normalized matrix easier to process. Specific normalization methods include centering, mean-variance normalization, and nonlinear normalization, but this embodiment does not impose any restrictions on these methods.
[0076] Step S50: Transform the normalized matrix into a vector to obtain the eigenvector.
[0077] It should be noted that the feature vector V is the result of vector transformation of the normalized matrix. The feature vector V can be used to identify the features in the sample image of the display cable to be tested, and to convert the features in the image into a digital form, which is beneficial for feature detection and analysis.
[0078] Step S60: Input the feature vector into the initialization cable detection model for training to obtain the trained cable detection model.
[0079] It should be noted that the initialization cable detection model can be a model with machine learning capabilities, preferably a Support Vector Machine (SVM). SVM is a generalized linear classifier that uses supervised learning to perform binary classification of data.
[0080] In the specific implementation, the obtained feature vector is used as input to train the SVM. After a long period of training with a large number of samples, the SVM is trained into a machine model that can make accurate judgments on the sample images of the display cable to be detected, thus obtaining the trained cable detection model.
[0081] Step S70: Obtain the image of the ribbon cable region to be detected. The trained ribbon cable detection model detects the image of the ribbon cable region to be detected and obtains the detection result.
[0082] It should be noted that the detection result refers to the pass or fail result output by the trained ribbon cable detection model when the display cable detection device acquires the image of the ribbon cable area to be detected.
[0083] In the specific implementation, when detecting the image of the ribbon cable region to be detected, the image of the ribbon cable region to be detected is first converted into a feature vector. Then, the feature vector is input into the trained ribbon cable detection model. The trained ribbon cable detection model processes the feature vector, and the ribbon cable detection model trained by the SVM algorithm makes a judgment to obtain the detection result of the ribbon cable region to be detected.
[0084] This embodiment acquires a sample image of the ribbon cable region to be detected; determines a feature region based on the sample image; performs grayscale processing on the feature region image to obtain a feature matrix; normalizes the feature matrix to obtain a normalized matrix; performs vector transformation on the normalized matrix to obtain a feature vector; inputs the feature vector into an initial ribbon cable detection model for training to obtain a trained ribbon cable detection model; acquires an image of the ribbon cable region to be detected, and the trained ribbon cable detection model detects the image of the ribbon cable region to obtain a detection result. This achieves a series of processing steps on the acquired sample image, extracting features from the sample image to obtain a feature vector, training the initial ribbon cable detection model based on the feature vector to obtain a trained ribbon cable detection model, and then performing ribbon cable detection. This ensures that there are characteristically significant sample inputs during ribbon cable detection, thereby guaranteeing the accuracy of the detection results.
[0085] refer to Figure 3 , Figure 3 This is a flowchart illustrating a second embodiment of a display screen cable detection method according to the present invention.
[0086] Based on the first embodiment described above, step S20 of the display cable detection method in this embodiment includes:
[0087] Step S201: Determine the ribbon cable region of the sample image of the ribbon cable region to be detected according to preset parameters.
[0088] It should be noted that the preset parameters are used to constrain the area where the ribbon cable is located in the sample image of the ribbon cable area to be detected. They are used to determine the location of the ribbon cable in the sample image of the ribbon cable area to be detected. The preset parameters can be set according to the color feature parameters of the ribbon cable or the size of the area. The ribbon cable area is located by color and determined by size.
[0089] In the specific implementation, after obtaining the sample image of the area to be detected, it is necessary to first determine the location of the ribbon cable from the image, then divide the area where the ribbon cable is located, and extract the area where the ribbon cable is located to obtain a ribbon cable area containing the ribbon cable, the ribbon cable slot, and other irrelevant noise images.
[0090] Step S202: Perform feature recognition on the wiring area to determine the position and direction of the wiring.
[0091] It should be noted that the position and direction of the ribbon cable refer to the position of the ribbon cable within the ribbon cable area. Based on the position and direction, the position and direction of the ribbon cable and the ribbon cable slot can be determined.
[0092] In practice, due to differences in sample placement and shooting angle, the position and orientation of the ribbon cable in the sample image of the area to be detected are not entirely consistent. Therefore, it is necessary to first determine the outline boundary of the ribbon cable slot based on its characteristics, and then determine the approximate location of the ribbon cable slot through this boundary. After determining the location of the ribbon cable slot, the characteristics of the ribbon cable are matched around the slot. Since the ribbon cable has a perpendicular direction that is almost the same as its insertion direction, the ribbon cable is also perpendicular to the ribbon cable slot, thus allowing the position and orientation of the ribbon cable to be determined.
[0093] Step S203: Determine the feature region based on the position and direction of the ribbon cable.
[0094] In a specific implementation, the corresponding region contour of the ribbon cable can be determined based on its position and direction. By combining the region contour of the ribbon cable with the region contour of the ribbon cable slot, the feature region can be obtained.
[0095] Furthermore, in order to obtain more regular feature regions, step S203 also includes:
[0096] The direction of the cable is detected;
[0097] When the direction of the ribbon cable is different from the preset direction, the image of the area to be detected is rotated so that the direction of the ribbon cable in the image of the area to be detected is consistent with the preset direction.
[0098] The feature region is determined based on the position of the ribbon cable.
[0099] It should be noted that the direction of the ribbon cable refers to the direction pointed to by the ribbon cable in the sample image of the area to be detected. The direction can be based on the sample image or any mark in the image. This embodiment does not limit this.
[0100] It should be understood that the preset direction is the direction that is set during the design process. The preset direction is the preferred direction in this embodiment. In this embodiment, the preset direction is the insertion direction of the ribbon cable, which, as seen in the picture, is from bottom to top.
[0101] In the specific implementation, the direction of the ribbon cable is detected. First, the relative position of the ribbon cable and the ribbon cable slot is determined. The preset relative position is the position of the ribbon cable slot directly above the ribbon cable, and it is perpendicular to the upper and lower boundaries of the image. During the direction detection process, if it is found that the insertion direction of the ribbon cable is not from bottom to top in the image but is tilted or reversed, the offset angle can be determined based on the current direction. The angle between the central axis of the ribbon cable and the ribbon cable slot and the upper and lower boundaries of the image can be obtained. Based on the angle, the sample image of the ribbon cable area to be detected is rotated so that the insertion direction of the ribbon cable conforms to the preset direction, and then the feature areas of the ribbon cable and the ribbon cable slot are extracted. If the insertion direction of the ribbon cable in the image conforms to the preset direction, the feature areas of the ribbon cable and the ribbon cable slot can be extracted directly.
[0102] Furthermore, in order to further extract the feature regions, the following steps are also included:
[0103] Determine the direction along the cable insertion direction and the direction perpendicular to the cable insertion direction based on the direction of the cable;
[0104] The size of the feature region is obtained by comparing the perpendicularity to the cable insertion direction with a preset value, based on the direction along the cable insertion.
[0105] The feature region is obtained based on the position of the ribbon cable and the size of the ribbon cable area.
[0106] It should be noted that when the ribbon cable is inserted into the ribbon cable slot, the ribbon cable slot has contact points that make contact with the ribbon cable. The "along the ribbon cable insertion direction" refers to the direction in which the ribbon cable moves during the process of being inserted into the ribbon cable slot, while "perpendicular to the ribbon cable insertion direction" refers to the direction that is perpendicular to the "along the ribbon cable insertion direction".
[0107] It should be understood that since the feature area needs to include the insertion of the ribbon cable, it is necessary to remove the content outside the ribbon cable. Therefore, it is necessary to constrain the size of the feature area. The preset value refers to the value that constrains the size of the feature area. The feature area is a rectangle, and the specific values of the length and width of the rectangle can be set according to the actual application scenario. This embodiment does not impose any restrictions on this.
[0108] In a specific implementation, the length along the cable insertion direction can be set to n, and the length perpendicular to the cable direction can be set to m. Therefore, the size of the feature region can be limited to obtain a rectangular feature region with side lengths of n and m. The rectangular feature region can contain all the features of the cable insertion into the cable slot.
[0109] This embodiment performs image processing on the sample image of the area to be detected ribbon cable. The original sample image is used to extract feature regions based on the features of the ribbon cable and the ribbon cable slot. The position or pattern of the feature regions can be corrected according to the positional relationship between the ribbon cable and the ribbon cable slot. At the same time, in order to ensure that the feature regions can contain all feature information, the size of the feature regions can be limited. By unifying the position and size of the feature regions, the accuracy of the feature region selection is guaranteed.
[0110] refer to Figure 4 , Figure 4 This is a flowchart illustrating a third embodiment of a display screen cable detection method according to the present invention.
[0111] Based on all the above embodiments, the display cable detection method of this embodiment includes the following in step S40:
[0112] Step S401: Perform mean processing on the data in each row of the feature matrix to obtain the row mean;
[0113] Step S402: Combine the row averages according to the row numbers before the average processing to obtain the first matrix;
[0114] Step S403: Calculate each data point in the first matrix to obtain the second matrix;
[0115] Step S404: Normalize the second matrix to obtain a normalized matrix.
[0116] It should be noted that the first matrix refers to a single-column matrix M1 obtained by averaging each row of the feature matrix M0, and the second matrix refers to a new matrix obtained by transforming the matrix values in the first matrix.
[0117] In the specific implementation, for a feature matrix M0 containing n*m data points, the m data points from each row of M0 are selected for mean processing. This involves summing the values of each row in the feature matrix M0 and then dividing by the number of data points in that row. The result is the mean of that row, which can be denoted as M0. a ,Right now:
[0118]
[0119] The mean values obtained from each row are combined according to their original row numbers to obtain a first matrix M1 of size n*1. Then, the data in the second matrix M1 is transformed again to obtain the eigenvector V. The transformation method is to assign 0 to the data in the first row, and in subsequent rows, the data in the corresponding row is the original data minus the original data from the previous row. See the calculation formula for details:
[0120]
[0121] Where N is the row number of the data, n N V represents the data in the Nth row of matrix M1. N The Nth data point of the feature vector is used to recombine the N data points into an n*1 second matrix M2. The data in the second matrix M2 have a value range of (-256, 256). The second matrix M2 is then normalized to obtain a normalized matrix M3. The normalization method is not limited in this embodiment.
[0122] Furthermore, in order to train the initial cable detection model, the following steps are also included:
[0123] Determine the type of the sample image of the region to be detected;
[0124] Add labels to the corresponding feature vectors according to the type of the sample images of the region to be detected;
[0125] The initial ribbon cable detection model is trained based on the labels to obtain the trained ribbon cable detection model.
[0126] It should be noted that the type of the detection area sample image refers to the pass / fail status of the detection area sample image at the beginning of training. That is, when the sample image is trained, it is first stated whether it passes or fails, and the label refers to pass or fail.
[0127] In the specific implementation, before initializing and training the ribbon cable detection model, it is necessary to clarify the inspection status of the sample images in the detection area, so that the sample images in the detection area correspond one-to-one with the detection results. At the same time, when obtaining the feature vector based on the sample images in the detection area, the feature vector V is equivalent to the sample images in the detection area. Therefore, the feature vector V also needs to have corresponding labels. When initializing and training the ribbon cable detection model, SVM can learn and train based on the feature vector V and its carried labels. It can also be calibrated based on the training results to ensure optimal training, thereby obtaining a trained ribbon cable detection model and saving the trained ribbon cable detection model.
[0128] Furthermore, to ensure a more comprehensive inspection of the ribbon cable area, the following steps are also included:
[0129] Detection of the sample image of the area to be detected (the ribbon cable region);
[0130] When the sample image of the cable area to be detected is a complex cable slot, the number of complex cables is determined according to the sample image of the cable area to be detected.
[0131] The step of determining the feature region based on the sample image of the area to be detected ribbon cable is repeated a number of times, wherein the number of repetitions is consistent with the number of complex ribbon cables.
[0132] It should be noted that multiple ribbon cables refer to a situation where multiple ribbon cables are inserted into ribbon cable slots. Therefore, during testing, each one needs to be tested individually.
[0133] In the specific implementation, after obtaining the sample image of the ribbon cable area to be detected, it is necessary to detect the sample image to determine whether there are multiple ribbon cables in the image. When multiple ribbon cables are detected, the number of multiple ribbon cables is first determined, and each one is detected one by one according to the number, obtaining feature regions to obtain feature vectors, and determining whether it passes the test. After one of them is detected, it can be marked to distinguish between detected and undetected ribbon cable slots.
[0134] This embodiment obtains a feature vector by performing a series of changes on the feature region. When processing the image pixel values, it can reduce the influence of noise in the pixel values, so that the final feature vector can better represent the actual situation of the line area to be detected, thereby improving the accuracy of the detection results. On the other hand, the above operation also reduces the sample size significantly compared with the conventional method, which can also greatly reduce the detection time. At the same time, considering the possible existence of multiple line forms, the existing line areas are also verified during the test to ensure that the detection results are more comprehensive.
[0135] Furthermore, this embodiment of the invention also proposes a storage medium storing a display cable detection program, which, when executed by a processor, implements the steps of the display cable detection method described above.
[0136] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the display cable detection device of the present invention.
[0137] like Figure 5 As shown, the display cable detection device proposed in this embodiment of the invention includes:
[0138] Sample acquisition module 10 is used to acquire sample images of the area to be detected ribbon cable;
[0139] The feature region determination module 20 is used to determine the feature region based on the sample image of the cable area to be detected.
[0140] The feature matrix determination module 30 is used to perform grayscale processing on the feature region image to obtain a feature matrix;
[0141] The matrix normalization module 40 is used to normalize the feature matrix to obtain a normalized matrix;
[0142] The feature vector generation module 50 is used to perform vector transformation on the normalized matrix to obtain feature vectors;
[0143] The cable detection model training module 60 is used to input the feature vector into the initial cable detection model for training, and obtain the trained cable detection model.
[0144] The ribbon cable detection module 70 is used to acquire an image of the ribbon cable region to be detected. The trained ribbon cable detection model detects the image of the ribbon cable region to be detected and obtains the detection result.
[0145] This embodiment acquires a sample image of the ribbon cable region to be detected; determines a feature region based on the sample image; performs grayscale processing on the feature region image to obtain a feature matrix; normalizes the feature matrix to obtain a normalized matrix; performs vector transformation on the normalized matrix to obtain a feature vector; inputs the feature vector into an initial ribbon cable detection model for training to obtain a trained ribbon cable detection model; acquires an image of the ribbon cable region to be detected, and the trained ribbon cable detection model detects the image of the ribbon cable region to obtain a detection result. This achieves a series of processing steps on the acquired sample image, extracting features from the sample image to obtain a feature vector, training the initial ribbon cable detection model based on the feature vector to obtain a trained ribbon cable detection model, and then performing ribbon cable detection. This ensures that there are characteristically significant sample inputs during ribbon cable detection, thereby guaranteeing the accuracy of the detection results.
[0146] In one embodiment, the feature region determination module 20 is further configured to determine the ribbon cable region of the sample image of the ribbon cable region to be detected according to preset parameters; perform feature recognition on the ribbon cable region to determine the position and direction of the ribbon cable; and determine the feature region according to the position and direction of the ribbon cable.
[0147] In one embodiment, the feature region determination module 20 is further configured to detect the direction of the ribbon cable; when the direction of the ribbon cable is different from the preset direction, rotate the image of the region to be detected so that the direction of the ribbon cable in the image of the region to be detected is consistent with the preset direction; and determine the feature region based on the position of the ribbon cable.
[0148] In one embodiment, the feature region determination module 20 is further configured to determine the direction along the ribbon cable insertion direction and the direction perpendicular to the ribbon cable insertion direction based on the direction of the ribbon cable; obtain the size of the feature region based on the direction along the ribbon cable insertion direction, the direction perpendicular to the ribbon cable insertion direction, and a preset value; and obtain the feature region based on the position of the ribbon cable and the size of the ribbon cable region.
[0149] In one embodiment, the matrix normalization module 40 is further configured to perform mean processing on the data of each row in the feature matrix to obtain a row mean; combine the row mean according to the row number before mean processing to obtain a first matrix; calculate a second matrix for each data in the first matrix; and normalize the second matrix to obtain a normalized matrix.
[0150] In one embodiment, the ribbon cable detection model training module 60 is further configured to determine the type of the sample image of the region to be detected; add a label to the corresponding feature vector according to the type of the sample image of the region to be detected; and train the initial ribbon cable detection model according to the label to obtain the trained ribbon cable detection model.
[0151] In one embodiment, the sample acquisition module 10 is further configured to detect the sample image of the cable area to be detected; when the sample image of the cable area to be detected is a complex number of cable slots, determine the number of complex cables based on the sample image of the cable area to be detected; and repeatedly perform the step of determining the feature region based on the sample image of the cable area to be detected a certain number of times, wherein the number of repetitions is consistent with the number of complex cables.
[0152] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.
[0153] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0154] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0155] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0156] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0157] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A display screen winding detection method, characterized by, The display screen cable detection method includes: Acquire sample images of the area to be detected for the ribbon cable; The feature region is determined based on the sample image of the area of the cable to be detected; The feature region image is processed to obtain a feature matrix; The feature matrix is normalized to obtain the normalized matrix; The normalized matrix is transformed into a vector to obtain the eigenvector; The feature vector is input into the initialization cable detection model for training to obtain the trained cable detection model. A flex cable detection model is trained to detect the flex cable detection area image and obtain the detection result. The normalization of the feature matrix to obtain the normalized matrix includes: The average value of each row of data in the feature matrix is obtained by averaging the data. The row averages are combined according to the row numbers before the average processing to obtain the first matrix; The second matrix is obtained by calculating each data point in the first matrix; Normalize the second matrix to obtain the normalized matrix; The step of determining the feature region based on the sample image of the cable area to be detected includes: The ribbon cable region of the sample image of the ribbon cable region to be detected is determined according to preset parameters; The location and orientation of the wiring are determined by feature recognition of the wiring area. The feature region is determined based on the position and direction of the wiring.
2. The method of claim 1, wherein, Determining the feature region based on the position and direction of the wiring includes: The direction of the cable is detected; When the direction of the ribbon cable is different from the preset direction, the image of the area to be detected is rotated so that the direction of the ribbon cable in the image of the area to be detected is consistent with the preset direction. The feature region is determined based on the position of the ribbon cable.
3. The method of claim 2, wherein, Determining the feature region based on the position of the ribbon cable includes: Determine the direction along the cable insertion direction and the direction perpendicular to the cable insertion direction based on the direction of the cable; The size of the feature region is obtained by comparing the perpendicularity to the cable insertion direction with a preset value, based on the direction along the cable insertion. The feature region is obtained based on the position of the ribbon cable and the size of the ribbon cable area.
4. The method of claim 1, wherein, The step of inputting the feature vector into the initialization cable detection model for training to obtain the trained cable detection model includes: Determine the type of the sample image of the region to be detected; Add labels to the corresponding feature vectors according to the type of the sample images of the region to be detected; The initial ribbon cable detection model is trained based on the labels to obtain the trained ribbon cable detection model.
5. The method according to any one of claims 1 to 4, characterized in that, After acquiring the sample image of the area to be detected (the ribbon cable region), the process further includes: Detection of the sample image of the area to be detected (the ribbon cable region); When the sample image of the cable area to be detected is a complex cable slot, the number of complex cables is determined according to the sample image of the cable area to be detected. The step of determining the feature region based on the sample image of the area to be detected ribbon cable is repeated a number of times, wherein the number of repetitions is consistent with the number of complex ribbon cables.
6. A display screen winding detection apparatus, characterized by, The display screen cable detection device includes: The sample acquisition module is used to acquire sample images of the area of the ribbon cable to be detected. The feature region determination module is used to determine the feature region based on the sample image of the cable area to be detected. The feature matrix determination module is used to perform grayscale processing on the feature region image to obtain the feature matrix; The matrix normalization module is used to normalize the feature matrix to obtain a normalized matrix; The feature vector generation module is used to transform the normalized matrix into a vector to obtain the feature vector. The cable detection model training module is used to input the feature vector into the initial cable detection model for training, and obtain the trained cable detection model. The ribbon cable detection module is used to acquire an image of the ribbon cable region to be detected. The trained ribbon cable detection model detects the image of the ribbon cable region to be detected and obtains the detection result. The matrix normalization module is also used to perform mean processing on the data of each row in the feature matrix to obtain the row mean. The row averages are combined according to the row numbers before the average processing to obtain the first matrix; The second matrix is obtained by calculating each data point in the first matrix; Normalize the second matrix to obtain the normalized matrix; The feature region determination module is also used to determine the ribbon cable region of the sample image of the ribbon cable region to be detected according to preset parameters; The location and orientation of the wiring are determined by feature recognition of the wiring area. The feature region is determined based on the position and direction of the wiring.
7. A display screen winding detection apparatus, characterized by, The device includes: a memory, a processor, and a display cable detection program stored in the memory and executable on the processor, the display cable detection program being configured to implement the steps of the display cable detection method as described in any one of claims 1 to 5.
8. A storage medium, characterized by The storage medium stores a display cable detection program, which, when executed by a processor, implements the steps of the display cable detection method as described in any one of claims 1 to 5.