An AI recognition-based margin detection method and medium

Through the margin detection method based on AI recognition, the unit distance of each pixel point of the margin detection device is automatically calculated. Combined with AI analysis and recognition of image data, the problems of low margin detection accuracy and low efficiency in the existing technology are solved, and efficient and automated margin detection and data recording are achieved.

CN119006389BActive Publication Date: 2025-10-17XIAMEN FOUR FAITH COMM TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411036552.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2025-10-17
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

In the existing technology, margin detection tools such as vernier calipers and laser measuring instruments have low accuracy, are greatly affected by human factors, and have low operating efficiency, and cannot meet the high-precision detection requirements of the installation position of electronic device display screens.

Method used

It adopts a margin detection method based on AI recognition. By automatically identifying the SN number on the margin detection device, it generates the unit distance of each pixel in the image data. Combined with AI analysis, it calculates the actual margin distance and compares it with the preset error range to achieve automatic detection and recording.

Benefits of technology

It achieves high-precision, automated margin detection, reduces the impact of human factors, improves detection efficiency, supports manual correction of misidentification, simplifies the operating process, and records data that can be uploaded for quality analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006389B_ABST
    Figure CN119006389B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on AI identification's edge distance detection method and medium, comprising: running edge distance detection service program, report device model and configuration parameter information;Determine whether new configuration parameter information is issued, determine final configuration parameter information;Obtain image data, when SN is identified, send edge distance detection request;Judge whether to execute edge distance detection and feedback;Identify the first clamp and the second clamp in image data, generate X axis unit distance and Y axis unit distance;Identify the region to be detected, generate X axis edge distance measurement data group and Y axis edge distance measurement data group;Extract the largest multiple values and the smallest multiple values in X axis edge distance measurement data group and Y axis edge distance measurement data group, determine whether the region to be detected exceeds the allowable error range, send the result to user interface program;User interface program reports the result to production management platform and handles.The application automatically generates whether qualified prompt, so that edge distance detection is more automated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the field of edge distance detection methods, in particular to an edge distance detection method based on AI recognition and a medium. BACKGROUND

[0002] In the production process of electronic devices with display screens, the installation position of the display screen of the electronic device has strict requirements and needs to be installed within a specific range, so as to ensure the quality of the electronic device. The installation position of the display screen is usually checked by detecting the edge distance between the edge of the electronic device and the edge of the display screen, checking the installation and structure frame edge distance precision of the display screen of the electronic device and judging whether the deviation is within the effective range. If the deviation exceeds the pre-set deviation threshold, a prompt is given to rework and make an abnormal record, so as to improve product quality and detect data and report to the production management platform for storage, facilitating subsequent production and quality departments to analyze and improve the production data.

[0003] In the prior art, the commonly used tool for edge distance detection is a vernier caliper and a laser measuring instrument. However, the vernier caliper has low precision and will cause large deviation, and needs to be measured manually, so that the measurement result is high in human factors. Although the laser measuring instrument has high precision, it still needs to be operated and measured by a special person, and the measurement result will also be affected by human factors, so that the work efficiency is low, and the laser measuring instrument has a large volume and high equipment cost. SUMMARY

[0004] Therefore, the purpose of the present application is to provide an edge distance detection method based on AI recognition, which automatically identifies the SN number on the edge distance detection device, then requests confirmation to start edge distance detection, automatically generates the X-axis unit distance of each pixel point of each pixel row on the first clamp and the second clamp in the image data according to the pre-set first reference edge distance and the second reference edge distance on the first clamp and the second clamp, combines AI analysis to identify the to-be-detected area in the image data to calculate the actual to-be-detected edge distance, and further compares the actual to-be-detected edge distance with the pre-set allowable error range to judge whether the actual to-be-detected edge distance exceeds the deviation range required by the production quality, and makes corresponding records and processing prompts.

[0005] In order to achieve the above technical purposes, the technical scheme adopted by the present application is as follows:

[0006] The present application provides an edge distance detection method based on AI recognition, which is applied to an edge distance detection device with a display screen to be detected and a production management platform, and includes the following steps:

[0007] Step 1, running an edge distance detection service program on the edge distance detection device, the edge distance detection service program reporting the device model and configuration parameter information of the current edge distance detection device to the production management platform;

[0008] Step 2, the production management platform determines whether to issue new configuration parameter information according to the equipment model and configuration parameter information, and the margin detection device determines the final configuration parameter information according to the issuance situation;

[0009] Step 3, the margin detection service program acquires image data collected by the camera in real time, and identifies whether there is an SN number of the margin detection device in the image data according to the final configuration parameter information, and when the SN number is identified, sends a margin detection request carrying the SN number to the user interface program on the margin detection device;

[0010] Step 4, the user interface program receives the margin detection request, judges whether to perform margin detection according to the SN number carried by the margin detection request, and feeds back the judgment result to the margin detection service program;

[0011] Step 5, when the margin detection service program receives the feedback of the user interface program as agreeing to perform margin detection, analyzes and identifies the first clamp and the second clamp in the image data through an AI recognition algorithm, and calculates and generates the X-axis unit distance of each pixel point in each pixel row in the first clamp and the Y-axis unit distance of each pixel point in each pixel column in the second clamp according to the final configuration parameter information and the image pixel size;

[0012] Step 6, analyze and identify the to-be-detected area in the image data through an AI recognition algorithm, and calculate and generate the X-axis margin measurement data group and the Y-axis margin measurement data group corresponding to the to-be-detected area according to the pixel point number, the X-axis unit distance of each pixel row and the Y-axis unit distance of each pixel column of the to-be-detected area;

[0013] Step 7, extract the maximum multiple values and the minimum multiple values in the X-axis margin measurement data group and the Y-axis margin measurement data group respectively, judge whether the to-be-detected area exceeds the allowed error range according to the configuration parameter information, the maximum multiple values and the minimum multiple values, and send the result to the user interface program;

[0014] Step 8, the user interface program reports the result to the production management platform and processes it.

[0015] Further, the step 1 specifically comprises:

[0016] Step 11, the margin detection service program is configured on the margin detection device;

[0017] Step 12, start the margin detection device, and establish a network connection with the production management platform through a TCP protocol;

[0018] Step 13, the login account and password for registration are pre-stored in the margin detection device;

[0019] Step 14, run the margin detection service program, the margin detection service program calls the http interface and uses the pre-stored login account and password in the margin detection device to register and log in to the production management platform;

[0020] Step 15, after logging in, the margin detection service program reports the device model and configuration parameter information of the current margin detection device to the production management platform; the configuration parameter information includes the reference margin actual value, the margin standard value to be detected of the margin detection device, the allowable error range of the margin detection device and the SN number reference format of the margin detection device.

[0021] Further, the step 2 specifically comprises:

[0022] Step 21, the production management platform is configured with a production management database for storing data;

[0023] Step 22, different device models and corresponding configuration parameter information are pre-set in the production management database; each set of device model and corresponding configuration parameter information is associated one by one;

[0024] Step 23, the production management platform receives the reported device model and configuration parameter information;

[0025] Step 24, the production management platform finds out the matched device model and configuration parameter information from the production management database according to the received device model;

[0026] Step 25, the production management platform compares the received configuration parameter information with the configuration parameter information found from the production management database; if the comparison result is inconsistent, it is determined that the configuration parameter information of the margin detection device needs to be updated, and step 26 is entered; if the comparison result is consistent, it is determined that the configuration parameter information of the margin detection device does not need to be updated, and the current configuration parameter information of the margin detection device is taken as the final configuration parameter information, and step 3 is entered;

[0027] Step 26, the production management platform issues the configuration parameter information found in the production management database to the margin detection device as new configuration parameter information;

[0028] Step 27, the margin detection device receives the new configuration parameter information as the final configuration parameter information, and stores the final configuration parameter information on the flash, and enters step 3.

[0029] Further, the step 3 specifically comprises:

[0030] Step 31, a camera is fixed above the margin detection device;

[0031] Step 33, the camera real-time collects image data of the edge distance detection device and sends it to the edge distance detection device, and the image data photographed by the camera is an image containing the edge distance detection device, a display screen, two first clamps respectively installed on the left and right edges of the edge distance detection device, and two second clamps respectively installed on the upper and lower edges of the edge distance detection device;

[0032] Step 32, the camera is connected to the edge distance detection device through a USB interface or a network port;

[0033] Step 34, the edge distance detection service program obtains the image data, calls an OCR recognition algorithm to recognize the SN number in the image data, compares the character format of the SN number in the image data with the reference format of the SN number of the edge distance detection device in the final configuration parameter information, and if they are consistent, it is determined that the SN number is recognized, and step 35 is entered; if they are not consistent, it is determined that the SN number is not recognized, and step 34 is returned;

[0034] Step 35, the edge distance detection service program sends an edge distance detection request carrying the SN number to the user interface program configured on the edge distance detection device.

[0035] Further, the step 4 specifically includes:

[0036] Step 41, the edge distance detection device starts a user interface program and creates a message queue, which is used to receive messages from the edge distance detection service program;

[0037] Step 42, the user interface program receives the edge distance detection request sent by the edge distance detection service program through the message queue;

[0038] Step 43, parse the edge distance detection request to obtain the SN number of the edge distance detection device, and display it on the display screen;

[0039] Step 44, compare the SN number displayed on the display screen with the SN number attached to the edge distance detection device, if they are consistent, the user interface program sends feedback information agreeing to perform detection to the edge distance detection service program, and step 5 is entered; if they are not consistent, step 45 is entered,

[0040] Step 45, manually correct the SN number on the display screen through the user interface, and return to step 44.

[0041] Further, the step 5 analyzes and recognizes the first clamp and the second clamp in the image data through the AI recognition algorithm, and calculates the X-axis unit distance of each pixel point in each pixel row of the first clamp and the Y-axis unit distance of each pixel point in each pixel column of the second clamp according to the final configuration parameter information and the image pixel size, specifically including:

[0042] Step 51, the edge detection service program starts a detection task thread to enter the edge detection process;

[0043] Step 52, the edge detection service program analyzes and identifies the first clamp and the second clamp in the image data through an AI recognition algorithm, the known fixed width distance between the left edge of the edge detection device and the edge of the first clamp located on the left side and the known fixed width distance between the right edge of the edge detection device and the edge of the first clamp located on the right side are both first reference edges, and the known fixed height distance between the upper edge of the edge detection device and the edge of the second clamp located on the upper side and the known fixed height distance between the lower edge of the edge detection device and the edge of the second clamp located on the lower side are both second reference edges; the values of the first reference edge and the second reference edge are equal to the actual value of the reference edge;

[0044] Step 53, the actual value of the reference edge, the number of pixel rows of the first clamp and the number of pixel columns of the second clamp in the final configuration parameter information are obtained, the X-axis unit distance of each pixel point in each pixel row of the first clamp is calculated according to the actual value of the reference edge and the number of pixel points in each pixel row of the first clamp, and stored in the corresponding array CKX[]; the calculation formula is: the X-axis unit distance of the pixel point in the current pixel row = the actual value of the reference edge ÷ the number of pixel points in the current pixel row;

[0045] Step 54, the Y-axis unit distance of each pixel point in each pixel column of the second clamp is calculated according to the actual value of the reference edge and the number of pixel points in each pixel column of the second clamp, and stored in the corresponding array CKY[]; the calculation formula is: the Y-axis unit distance of the pixel point in the current pixel column = the actual value of the reference edge ÷ the number of pixel points in the current pixel column.

[0046] Further, the step 6 specifically includes:

[0047] Step 61, the AI recognition algorithm is used to analyze and identify the to-be-detected area in the image data, the to-be-detected area is an area formed between the edge line of the first clamp and the second clamp in contact with the edge detection device and the edge of the display screen; the to-be-detected area includes a first area, a second area, a third area and a fourth area, the first area is an area close to the first clamp located on the left side, the second area is an area close to the first clamp located on the right side, the third area is an area close to the second clamp located on the upper side, and the fourth area is an area close to the second clamp located on the lower side;

[0048] Step 62, identify the number of pixel rows in the first region and the number of pixels in each pixel row, obtain the X-axis unit distance of the pixel row at the corresponding position from the array CKX[], calculate the X-axis margin measurement data of the corresponding pixel row in the first region according to the number of pixels in each pixel row and the X-axis unit distance; the calculation formula is: the X-axis margin measurement data corresponding to the current pixel row in the first region = the X-axis unit distance of the current pixel row × the number of pixels in the current pixel row;

[0049] Step 63, identify the number of pixel rows in the second region and the number of pixels in each pixel row, obtain the X-axis unit distance of the pixel row at the corresponding position from the array CKX[], calculate the X-axis margin measurement data of the corresponding pixel row in the second region according to the number of pixels in each pixel row and the X-axis unit distance; the calculation formula is: the X-axis margin measurement data corresponding to the current pixel row in the second region = the X-axis unit distance of the current pixel row × the number of pixels in the current pixel row; all the X-axis margin measurement data calculated by the first region and the second region form the X-axis margin measurement data group Val_xl[];

[0050] Step 64, identify the number of pixel columns in the third region and the number of pixels in each pixel column, obtain the Y-axis unit distance of the pixel column at the corresponding position from the array CKY[], calculate the Y-axis margin measurement data of the corresponding pixel column in the third region according to the number of pixels in each pixel column and the Y-axis unit distance; the calculation formula is: the Y-axis margin measurement data corresponding to the current pixel column in the third region = the Y-axis unit distance of the current pixel column × the number of pixels in the current pixel column;

[0051] Step 65, identify the number of pixel columns in the fourth region and the number of pixels in each pixel column, obtain the Y-axis unit distance of the pixel column at the corresponding position from the array CKY[], calculate the Y-axis margin measurement data of the corresponding pixel column in the fourth region according to the number of pixels in each pixel column and the Y-axis unit distance; the calculation formula is: the Y-axis margin measurement data corresponding to the current pixel column in the fourth region = the Y-axis unit distance of the current pixel column × the number of pixels in the current pixel column; all the Y-axis margin measurement data calculated by the third region and the fourth region form the Y-axis margin measurement data group Val_yl[];

[0052] Step 66, merge and solve the average value of the two X-axis margin measurement data calculated in the X-axis margin measurement data group Val_xl[] to compress the data, obtain the compressed X-axis margin measurement data group Val_x2[]; at the same time, merge and solve the average value of the two Y-axis margin measurement data calculated in the Y-axis margin measurement data group Val_yl[] to compress the data, obtain the compressed Y-axis margin measurement data group Val_y2[].

[0053] Furthermore, the step 7 specifically includes:

[0054] Step 71: The standard values ​​of the margins to be detected in the configuration parameter information include an X-axis standard value x_val and a Y-axis standard value y_val; the width of the first area or the second area is a first margin to be detected, and the height of the third area or the fourth area is a second margin to be detected;

[0055] Step 72: extract the largest m1 values ​​in the X-axis margin measurement data set Val_x2[] and store them in the max1[m1] array, and the smallest n1 values ​​in the min1[n1] array; the values ​​of m1 and n1 are set according to user needs;

[0056] Step 73: Calculate the difference between the m1 values ​​in the max1[m1] array and the X-axis standard value x_val to obtain m1 first differences. Compare each of the m1 first differences with the allowable error range. If at least one first difference is larger than the allowable error range, it is determined that the margin detection device has a positive deviation that exceeds the allowable error range. The positive deviation rate of the X-axis = the number of positive deviations that exceed the allowable error range / m1.

[0057] Step 74: Calculate the difference between the X-axis standard value x_val and the n1 values ​​in the min1[n1] array to obtain n1 second difference values. Compare each of the n1 second difference values ​​with the allowable error range. If at least one second difference value is greater than the allowable error range, it is determined that the margin detection device has a negative deviation that exceeds the allowable error range. The negative deviation rate of the X-axis = the number of negative deviations that exceed the allowable error range / n1.

[0058] Step 75: extract the largest m2 values ​​in the Y-axis margin measurement data set Val_y2[] and store them in the max2[m2] array and the smallest n2 values ​​in the min2[n2] array; the values ​​of m2 and n2 are set according to user needs;

[0059] Step 76: Calculate the difference between the m2 values ​​in the max2[m2] array and the Y-axis standard value y_val to obtain m2 third differences. Compare the m2 third differences with the allowable error range. If at least one third difference is larger than the allowable error range, it is determined that the margin detection device has a positive deviation that exceeds the allowable error range. The positive deviation rate of the Y-axis = the number of positive deviations that exceed the allowable error range / m2;

[0060] Step 77, respectively, the Y-axis standard value y_val is subtracted from the n2 values in the min2[n2] array to obtain n2 fourth differences, and the n2 fourth differences are compared with the allowable error range, and if at least one fourth difference is greater than the allowable error range, it is determined that the edge detection device has a negative deviation beyond the allowable error range, and the negative deviation rate of the Y-axis thereof = the number of negative deviations beyond the allowable error range ÷ n2;

[0061] Step 78, if all the first differences and the second differences are not greater than the allowable error range, it is determined that the first to-be-detected edge does not exceed the allowable error range, if all the third differences and the fourth differences are not greater than the allowable error range, it is determined that the second to-be-detected edge does not exceed the allowable error range, if the first to-be-detected edge and the second to-be-detected edge both do not exceed the allowable error range, it is determined that the to-be-detected area does not exceed the allowable error range, if at least one of all the first differences and the second differences is greater than the allowable error range, it is determined that the first to-be-detected edge exceeds the allowable error range, if at least one of all the third differences and the fourth differences is greater than the allowable error range, it is determined that the second to-be-detected edge exceeds the allowable error range, if the first to-be-detected edge and / or the second to-be-detected edge exceeds the allowable error range, it is determined that the to-be-detected area exceeds the allowable error range;

[0062] Step 79, the detection result is sent to the user interface program.

[0063] Further, the step 8 specifically comprises:

[0064] Step 81, the user interface program receives the detection result;

[0065] Step 82, if the detection result is that the to-be-detected area does not exceed the allowable error range, it means that the edge detection device is qualified, then the SN number and the detection result information of the edge detection device are recorded and reported to the production management platform, and then the user interface prompts that the edge detection device is qualified and enters the next device detection process after confirmation;

[0066] Step 83, if the detection result is that the to-be-detected area exceeds the allowable error range, it means that the edge detection device is unqualified, then the detection result is reported to the production management platform, and then the user interface displays the data and the ratio of the exceeding value range, and prompts the device to rework, and records the SN number of the edge detection device and the analyzed information data when the rework is confirmed and enters the next device detection process.

[0067] The application also provides a computer readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the AI recognition-based edge detection method.

[0068] By adopting the technical scheme, the application has the beneficial effects that:

[0069] 1. The configuration parameter information (including the reference margin actual value, the margin detection device's to-be-detected margin standard value, the margin detection device's allowable error range, and the margin detection device's SN number reference format) is associated with the device model of the margin detection device and stored in the production management platform. The production management platform identifies and issues new configuration parameter information according to the reported device model and configuration parameter information, realizing unified and centralized configuration management of parameter configuration information.

[0070] 2. Real-time acquisition of image data collected by the camera and calling of an OCR recognition algorithm to execute the SN number on the margin detection device, margin detection after UI prompt confirmation of the SN number, interactive confirmation of the SN number and support for manual modification of misrecognition, which can ensure detection execution and the correctness of SN number recording.

[0071] 3. The margin detection service program first detects the first reference margin and the second reference margin to generate X-axis unit distance and Y-axis unit distance, respectively, and stores them in the corresponding arrays, providing basic data for automatic margin detection, and the detection does not require manual entry or manual calibration operation.

[0072] 4. The to-be-detected region is identified, and the X-axis margin measurement data group and the Y-axis margin measurement data group corresponding to the to-be-detected region are calculated and generated according to the pixel point number of the to-be-detected region, the X-axis unit distance of each pixel row, and the Y-axis unit distance of each pixel column, and average value calculation and compression processing are performed to realize data anti-shake processing and make the data more accurate.

[0073] 5. The margin data is identified and difference calculated with the pre-set to-be-detected margin standard value, compared with the pre-set allowable error range, and a pass / fail prompt is automatically generated, which is more simple and efficient; the UI prompts the personnel to confirm rework and automatically records, the record can be further uploaded to the production management platform for analysis by the quality department and further improvement of the process.

[0074] 6. The OCR recognizes the SN number and automatically records the unqualified products, without manual video recording operation, which is more simple and efficient. BRIEF DESCRIPTION OF DRAWINGS

[0075] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0076] Figure 1 is an execution flowchart of a margin detection method based on AI recognition provided by an embodiment of the present application.

[0077] Figure 2 is a structural schematic diagram of a margin detection device provided by an embodiment of the present application.

[0078] Figure 3 is a data interaction schematic diagram of a margin detection device provided by an embodiment of the present application.

[0079] Figure 4 is a data interaction schematic diagram of a production management platform provided by an embodiment of the present application.

[0080] Figure 5 is a data interaction schematic diagram of a margin detection service program provided by an embodiment of the present application.

[0081] Figure 6 is a data interaction schematic diagram of a user interface program provided by an embodiment of the present application.

[0082] Figure 7 is a schematic diagram of a computer readable storage medium provided by an embodiment of the present application.

[0083] Explanation of reference numerals in the drawings:

[0084] 1 - margin detection device, 2 - display screen, 3 - first clamp, 4 - second clamp, 5 - to-be-detected area, 51 - first area, 52 - second area, 53 - third area, 54 - fourth area, L1 - first reference margin, L2 - second reference margin, L3 - first to-be-detected margin, L4 - second to-be-detected margin. DETAILED DESCRIPTION

[0085] The present application will be further described in conjunction with the drawings and embodiments. It is particularly pointed out that the following embodiments are only used to illustrate the present application, but do not limit the scope of the present application. Similarly, the following embodiments are only part of the embodiments of the present application, not all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of the present application.

[0086] Please refer to Figures 1-6 The margin detection method based on AI recognition provided by the present application is applied to a margin detection device 1 with a display screen 2 to be detected and a production management platform, and includes the following steps:

[0087] Step 1, running a margin detection service program on the margin detection device 1, the margin detection service program reporting the device model and configuration parameter information of the current margin detection device 1 to the production management platform;

[0088] In this embodiment, the step 1 specifically includes:

[0089] Step 11, the margin detection device 1 is configured with a margin detection service program; the margin detection service program is a self-developed embedded program running on the margin detection device 1 and is integrated in the margin detection device 1 by default;

[0090] Step 12, start the margin detection device 1, and establish a network connection with the production management platform through a TCP protocol; through the network connection between the margin detection device 1 and the production management platform, data interaction between the margin detection service program and the production management platform can be realized;

[0091] Step 13, the margin detection device 1 pre-stores a login account and password for registration; the data can be directly called during registration;

[0092] Step 14, run the margin detection service program, the margin detection service program calls an http interface and uses the pre-stored login account and password in the margin detection device 1 to register and log in to the production management platform;

[0093] Step 15, after logging in, the margin detection service program reports the device model and configuration parameter information of the current margin detection device 1 to the production management platform; the configuration parameter information includes a reference margin actual value, a margin standard value to be detected of the margin detection device 1, an allowable error range of the margin detection device 1, and an SN number reference format of the margin detection device 1.

[0094] Step 2, the production management platform determines whether to issue new configuration parameter information according to the device model and configuration parameter information, and the margin detection device 1 determines the final configuration parameter information according to the issuance situation;

[0095] In this embodiment, the step 2 specifically includes:

[0096] Step 21, the production management platform is configured with a production management database for storing data;

[0097] Step 22, preset different device models and corresponding configuration parameter information in the production management database; each set of device models and corresponding configuration parameter information is associated; the actual margin detection device 1 has multiple device models, because the frame size of the display screen 2 of different device models is different, so the device model corresponding to the appropriate margin detection device 1 is different, the detection device model is integrated by default, the reference margin corresponding to different device models is different, and the test corresponding display screen 2 margin value and allowable error range are also different; for example, the device model used for testing 10.1-inch display screen 2 and testing 21.5-inch display screen 2 is different. The production management database will pre-record the device model corresponding to the margin detection device 1, and the margin value to be detected and the allowable error range using this device model, and the corresponding SN number reference format, and the allowable error range will be adjusted by the quality department according to the actual product quality on the production management system, and the SN format will also be adjusted according to the product demand on the production management system. Therefore, the device model and the reference margin actual value, the margin detection device 1 margin standard value to be detected, the margin detection device 1 allowable error range and the margin detection device 1 SN number reference format are one-to-one corresponding relationship on the production management platform.

[0098] Step 23, the production management platform receives the reported device model and configuration parameter information;

[0099] Step 24, the production management platform finds out the matching device model and configuration parameter information from the production management database according to the received device model;

[0100] Step 25, the production management platform compares the received configuration parameter information with the configuration parameter information found from the production management database; if the comparison result is inconsistent, it is determined that the configuration parameter information of the margin detection device 1 needs to be updated, and step 26 is entered; if the comparison result is consistent, it is determined that the configuration parameter information of the margin detection device 1 does not need to be updated, and the current configuration parameter information of the margin detection device 1 is taken as the final configuration parameter information, and step 3 is entered;

[0101] Step 26, the production management platform sends the configuration parameter information found in the production management database to the margin detection device 1 as new configuration parameter information; the configuration parameter information (including the reference margin actual value, the margin detection device 1 margin standard value to be detected, the margin detection device 1 allowable error range and the margin detection device 1 SN number reference format) is associated with the device model of the margin detection device 1 and stored in the production management platform. The production management platform identifies and sends new configuration parameter information according to the reported device model and configuration parameter information, realizes unified and centralized configuration management of parameter configuration information.

[0102] Step 27, the edge detection device 1 receives new configuration parameter information as final configuration parameter information, and stores the final configuration parameter information on the flash, and enters step 3. The device model reported by the edge detection device 1, the actual value of the reference edge, the standard value of the edge to be detected by the edge detection device 1, the allowable error range of the edge detection device 1 and the SN number reference format of the edge detection device 1 are matched with the data in the production management database. If it is matched, there is no need to issue an update. If the actual value of the reference edge corresponding to the same device model, the standard value of the edge to be detected by the edge detection device 1, the allowable error range of the edge detection device 1 and the SN number reference format of the edge detection device 1 are inconsistent, it means that the production management platform needs to reissue updated parameters to the edge detection device 1 and store them on the flash of the edge detection device 1. Through the parameter adjustment of the production management platform, the same edge detection device 1 can also adapt to test different display screens 2 products.

[0103] Step 3, the edge detection service program acquires image data collected by the camera in real time, and identifies whether there is an SN number of the edge detection device 1 in the image data according to the final configuration parameter information. When the SN number is identified, the edge detection request carrying the SN number is sent to the user interface program on the edge detection device 1.

[0104] In this embodiment, step 3 specifically includes:

[0105] Step 31, a camera is fixed directly above the edge detection device 1, which can be a macro camera. The camera can be erected on the edge detection device 1 through a support and the position is fixed by default.

[0106] Step 32, the camera is connected to the edge detection device 1 through a USB interface or a network port;

[0107] Step 33, the camera collects image data of the edge detection device 1 in real time and sends it to the edge detection device 1. The image data photographed by the camera includes the edge detection device 1, the display screen 2, two first clamps 3 respectively installed on the left and right edges of the edge detection device 1, and two second clamps 4 respectively installed on the upper and lower edges of the edge detection device 1. The SN number is a two-dimensional code and characters pasted on the blank position below the edge detection device 1 to be detected during production. The camera can photograph the SN number and display it in the image data. The SN number has a fixed format, and the SN number reference format is input in advance in the production management platform according to the production order demand.

[0108] Step 34, the margin detection service program acquires the image data, and calls an OCR recognition algorithm to recognize the SN number in the image data, compares the character format of the SN number in the image data with the reference format of the SN number of the margin detection device 1 preset in the final configuration parameter information, if they are consistent, it is determined that the SN number is recognized, and step 35 is entered; if they are not consistent, it is determined that the SN number is not recognized, and step 34 is returned; wherein the OCR recognition algorithm is to use the npu hardware unit on the margin detection device 1 in combination with the npu algorithm model actually trained to realize the OCR image input to the character output of the SN number in the npu. The format of the SN number is similar to: FFD101NO0001, wherein the four characters D101 from the third character represent that the display device is a 10.1 size specification device, if the flash of the margin detection device 1 stores FFD215NO0001, it means that the current margin detection device 1 is to detect a 21.5 inch device; the image data collected by the camera is acquired in real time and the OCR recognition algorithm is called to execute the SN number on the margin detection device 1, and the margin detection is performed after the SN number is confirmed through the UI prompt, the SN number is interactively confirmed and manual correction of misrecognition is supported, which can ensure the detection execution and the correctness of the SN number record.

[0109] Step 35, the margin detection service program sends a margin detection request carrying the SN number to the user interface program configured on the margin detection device 1. Step 4, the user interface program receives the margin detection request, judges whether to perform margin detection according to the SN number carried by the margin detection request, and feeds back the judgment result to the margin detection service program;

[0110] In the embodiment, the step 4 specifically includes:

[0111] Step 41, the margin detection device 1 starts a user interface (UI) program, and creates a message queue, which is used to receive the message of the margin detection service program; the UI display screen 2 of the margin detection device 1 has a touch screen and a button, which supports the margin detection device 1 to perform UI interactive operation on the user interface (UI) program, including manually correcting the SN number when the displayed SN number and the SN number data posted on the margin detection device 1 are wrong, and the configuration parameter information can be modified or reset through the UI program.

[0112] Step 42, the user interface program receives the margin detection request sent by the margin detection service program through the message queue;

[0113] Step 43, parse the margin detection request to obtain the SN number of the margin detection device 1, and display it on the display screen 2;

[0114] Step 44, compare the SN number displayed on the display screen 2 with the SN number pasted on the edge detection device 1, if consistent, the user interface program will send the feedback information of agreeing to perform detection to the edge detection service program, and enter step 5; if not consistent, enter step 45,

[0115] Step 45, manually correct the SN number on the display screen 2 through the user interface, and return to step 44.

[0116] Step 5, when the edge detection service program receives the feedback of the user interface program that agrees to perform edge detection, analyze and identify the first clamp 3 and the second clamp 4 in the image data through the AI recognition algorithm, and calculate the X-axis unit distance of each pixel point in each pixel row in the first clamp 3 and the Y-axis unit distance of each pixel point in each pixel column in the second clamp 4 according to the final configuration parameter information and the image pixel size;

[0117] In this embodiment, the step 5 of analyzing and identifying the first clamp 3 and the second clamp 4 in the image data through the AI recognition algorithm, and calculating the X-axis unit distance of each pixel point in each pixel row in the first clamp 3 and the Y-axis unit distance of each pixel point in each pixel column in the second clamp 4 according to the final configuration parameter information and the image pixel size, specifically includes:

[0118] Step 51, the edge detection service program starts the detection task thread to enter the edge detection process;

[0119] Step 52, the edge detection service program analyzes and identifies the first clamp 3 and the second clamp 4 in the image data through the AI recognition algorithm, for example, in the process of identifying the first clamp 3: AI first performs edge detection algorithm of the image, identifies the edge of the first clamp 3 and the edge line of the first clamp 3 and the edge of the edge detection device 1, and then extracts the separate image of the first clamp 3; the identification process of the second clamp 4 is the same;

[0120] The known fixed width distance between the left edge of the edge detection device 1 and the edge of the first clamp 3 located on the left side and the known fixed width distance between the right edge of the edge detection device 1 and the edge of the first clamp 3 located on the right side are both the first reference edge L1, and the known fixed height distance between the upper edge of the edge detection device 1 and the edge of the second clamp 4 located on the upper side and the known fixed height distance between the lower edge of the edge detection device 1 and the edge of the second clamp 4 located on the lower side are both the second reference edge L2; the values of the first reference edge L1 and the second reference edge L2 are equal to the actual value of the reference edge;

[0121] Step 53, obtain the reference margin actual value, the number of pixel rows of the first clamp 3 and the number of pixel columns of the second clamp 4 in the final configuration parameter information, calculate the X-axis unit distance of each pixel point in each pixel row of the first clamp 3 according to the reference margin actual value and the number of pixel points in each pixel row of the first clamp 3, and store it in the corresponding array CKX [];

[0122] For example, the reference margin actual value is 10 mm, the AI identifies that there are multiple rows of pixels on the first clamp 3 on the left in the image data, and the number of pixel points in each pixel row, if the number of pixel points in the first row of pixels generated is 60, then the X-axis unit distance of the pixel points in this row is 10 / 60 = 0.1667 mm, and the calculation method of other pixel rows on the first clamp 3 on the left is the same; the calculation method of each pixel row on the first clamp 3 on the right is the same as that of each pixel row on the first clamp 3 on the left;

[0123] Step 54, calculate the Y-axis unit distance of each pixel point in each pixel column of the second clamp 4 according to the reference margin actual value and the number of pixel points in each pixel column of the second clamp 4, and store it in the corresponding array CKY []; the calculation formula is: the Y-axis unit distance of the pixel points in the current pixel column = the reference margin actual value ÷ the number of pixel points in the current pixel column. Similarly, the calculation method of each pixel column on the second clamp 4 on the top and bottom is similar to that of each pixel row on the first clamp 3 on the left. The margin detection service program first detects the first reference margin L1 and the second reference margin L2 to generate the X-axis unit distance and the Y-axis unit distance, respectively, and stores them in the corresponding arrays, providing basic data for automatic margin detection. When detecting, there is no need for personnel to manually enter or manually calibrate the operation.

[0124] Step 6, analyze and identify the to-be-detected area 5 in the image data through the AI recognition algorithm, and calculate the corresponding X-axis margin measurement data group and Y-axis margin measurement data group of the to-be-detected area 5 according to the number of pixel points, the X-axis unit distance of each pixel row and the Y-axis unit distance of each pixel column of the to-be-detected area 5;

[0125] In this embodiment, the step 6 specifically comprises:

[0126] Step 61, analyze and identify the to-be-detected area 5 in the image data through the AI recognition algorithm, specifically: the AI first performs an edge detection algorithm on the image, identifies the inner frame of the display screen 2 and the outer frame edge of the margin detection device 1, and then extracts the area between the edge line of the first clamp 3 and the second clamp 4 in contact with the margin detection device 1 and the edge of the display screen 2 as the to-be-detected area 5;

[0127] The to-be-detected area 5 is an area formed between the edge line where the first clamp 3 and the second clamp 4 contact the edge detection device 1 and the edge of the display screen 2; the to-be-detected area 5 includes a first area 51, a second area 52, a third area 53, and a fourth area 54, the first area 51 is an area close to the first clamp 3 located on the left side, the second area 52 is an area close to the first clamp 3 located on the right side, the third area 53 is an area close to the second clamp 4 located on the upper side, and the fourth area 54 is an area close to the second clamp 4 located on the lower side.

[0128] Step 62, identify the number of pixel rows in the first area 51 and the number of pixel points in each pixel row, obtain the X-axis unit distance of the pixel row at the corresponding position from the array CKX[], and calculate the X-axis edge distance measurement data of the corresponding pixel row in the first area 51 according to the number of pixel points in each pixel row and the X-axis unit distance; the calculation formula is: the X-axis edge distance measurement data corresponding to the current pixel row in the first area 51 = the X-axis unit distance of the current pixel row x the number of pixel points of the current pixel row.

[0129] For example: AI identifies that the first pixel row in the first area 51 has 70 pixel points, and the first pixel row in the first area 51 corresponds to the first pixel row position on the first clamp 3 located on the left side; therefore, the X-axis unit distance corresponding to this row is 0.1667 mm, and the X-axis edge distance measurement data corresponding to the first pixel row in the first area 51 is 0.1667x70=11.669 mm. Assuming that the X-axis standard value x_val is 11 mm and the allowable error range is ±0.5 mm, the X-axis edge distance measurement data of the current pixel row has exceeded the range of 11±0.5 mm, indicating that the deviation of the assembled product is too large. Similarly, the calculation method of the X-axis edge distance measurement data corresponding to other pixel rows in the first area 51 is the same.

[0130] Step 63, identify the number of pixel rows in the second area 52 and the number of pixel points in each pixel row, obtain the X-axis unit distance of the pixel row at the corresponding position from the array CKX[], and calculate the X-axis edge distance measurement data of the corresponding pixel row in the second area 52 according to the number of pixel points in each pixel row and the X-axis unit distance; the calculation formula is: the X-axis edge distance measurement data corresponding to the current pixel row in the second area 52 = the X-axis unit distance of the current pixel row x the number of pixel points of the current pixel row; all the X-axis edge distance measurement data obtained by calculating the first area 51 and the second area 52 form the X-axis edge distance measurement data group Val_xl[]; similarly, the calculation method of the X-axis edge distance measurement data corresponding to each pixel row in the second area 52 is the same as that of the first area 51.

[0131] Step 64, identify the number of pixel columns in the third region 53 and the number of pixels in each pixel column, and obtain the Y-axis unit distance of the pixel column at the corresponding position from the array CKY[]; calculate the Y-axis margin measurement data of the corresponding pixel column of the third region 53 according to the number of pixels in each pixel column and the Y-axis unit distance; the calculation formula is: the Y-axis margin measurement data corresponding to the current pixel column in the third region 53 = the Y-axis unit distance of the current pixel column × the number of pixels in the current pixel column; similarly, the calculation method of the Y-axis margin measurement data corresponding to each pixel column in the third region 53 is similar to that of the first region 51.

[0132] Step 65, identify the number of pixel columns in the fourth region 54 and the number of pixels in each pixel column, and obtain the Y-axis unit distance of the pixel column at the corresponding position from the array CKY[]; calculate the Y-axis margin measurement data of the corresponding pixel column of the fourth region 54 according to the number of pixels in each pixel column and the Y-axis unit distance; the calculation formula is: the Y-axis margin measurement data corresponding to the current pixel column in the fourth region 54 = the Y-axis unit distance of the current pixel column × the number of pixels in the current pixel column; all Y-axis margin measurement data calculated by the third region 53 and the fourth region 54 form the Y-axis margin measurement data group Val_yl[]; similarly, the calculation method of the Y-axis margin measurement data corresponding to each pixel column in the fourth region 54 is similar to that of the first region 51.

[0133] Step 66, merge and solve the average value of the two X-axis margin measurement data calculated for the adjacent pixel rows in the X-axis margin measurement data group Val_xl[] to compress the data, and obtain the compressed X-axis margin measurement data group Val_x2[]; at the same time, merge and solve the average value of the two Y-axis margin measurement data calculated for the adjacent pixel columns in the Y-axis margin measurement data group Val_yl[] to compress the data, and obtain the compressed Y-axis margin measurement data group Val_y2[]. The purpose of this step is to prevent data jitter and further compress the array size. Identify the detection area 5, calculate the X-axis margin measurement data group and the Y-axis margin measurement data group corresponding to the detection area 5 according to the number of pixels in the detection area 5, the X-axis unit distance of each pixel row and the Y-axis unit distance of each pixel column, and perform average value solving and compression processing to realize data anti-jitter processing and make the data more accurate.

[0134] Step 7, respectively extract the maximum and minimum values in the X-axis margin measurement data group and the Y-axis margin measurement data group, judge whether the detection area 5 exceeds the allowed error range according to the configuration parameter information, the maximum and minimum values, and send the result to the user interface program;

[0135] In the embodiment, the step 7 specifically comprises:

[0136] The margin standard value to be detected in the configuration parameter information is the accurate margin value required by the margin detection device 1 in actual production, including the X-axis standard value x_val and the Y-axis standard value y_val; the width distance of the first region 51 or the second region 52 is the first margin to be detected L3, and the height distance of the third region 53 or the fourth region 54 is the second margin to be detected L4;

[0137] Step 72, the maximum m1 values in the X-axis margin measurement data set Val_x2[] are stored in the max1[m1] array, and the minimum n1 values are stored in the min1[n1] array; the values of m1 and n1 are set by the user as required, and the values of m1 and n1 can be the same, for example, both set to 10, then the max1

[10] array contains the value max1[1], the value max1[2], the value max1[3], the value max1[4], the value max1[5], the value max1[6], the value max1[7], the value max1[8], the value max1[9], and the value max1

[10] , and the min1

[10] array contains the value min1[1], the value min1[2], the value min1[3], the value min1[4], the value min1[5], the value min1[6], the value min1[7], the value min1[8], the value min1[9], and the value min1

[10] ;

[0138] Step 73, the m1 values in the max1[m1] array are respectively subtracted from the X-axis standard value x_val to obtain m1 first difference values, and the m1 first difference values are respectively compared with the allowable error range, if at least one first difference value is greater than the allowable error range, it is determined that the margin detection device 1 has a positive deviation beyond the allowable error range, and the positive deviation rate of the X-axis of the margin detection device 1 = the number of positive deviation beyond the allowable error range ÷ m1;

[0139] For example, the value max1[1] is 11.23 mm, and the X-axis standard value x_val is 11 mm, then max1[1]-x_val=11.23-11=0.23 mm, which is less than the allowable error range 0.5 mm, indicating that the margin deviation is within the allowable error range; the judgment method of other values is the same. Here, 10 groups are used for the convenience of calculating the 0%~100% ratio of positive (negative) deviation exceeding, for example, if two groups of the 10 groups in the max1

[10] array exceed the allowable error range, then the positive deviation rate is 20%.

[0140] Step 74, the X-axis standard value x_val is subtracted from the n1 values in the min1[n1] array respectively to obtain n1 second differences, and the n1 second differences are compared with the allowable error range respectively. If there is at least one second difference greater than the allowable error range, it is determined that the edge detection device 1 has a negative deviation exceeding the allowable error range, and the negative deviation rate of the X-axis = the number of negative deviations exceeding the allowable error range ÷ n1.

[0141] For example: the value min1[1] is 10.53 mm, and the X-axis standard value x_val is 11 mm, then x_val-min1[1]=11-10.53=0.47 mm, which is less than the allowable error range 0.5 mm, indicating that the edge deviation is within the allowable error range; the judgment method of other values is the same. Here, 10 groups are used for convenience of calculating the positive (negative) deviation exceeding 0%~100% rate, if there are 5 groups of min1

[10] array exceeding the allowable error range, then the negative deviation rate is 50%.

[0142] Step 75, the largest m2 values in the Y-axis edge measurement data set Val_y2[] are extracted and stored in the max2[m2] array, and the smallest n2 values are stored in the min2[n2] array; the values of m2 and n2 are set by the user as needed;

[0143] Step 76, the m2 values in the max2[m2] array are subtracted from the Y-axis standard value y_val respectively to obtain m2 third differences, and the m2 third differences are compared with the allowable error range respectively. If there is at least one third difference greater than the allowable error range, it is determined that the edge detection device 1 has a positive deviation exceeding the allowable error range, and the positive deviation rate of the Y-axis = the number of positive deviations exceeding the allowable error range ÷ m2; similarly, the judgment method of the max2[m2] array is the same as that of the max1[m1] array.

[0144] Step 77, the Y-axis standard value y_val is subtracted from the n2 values in the min2[n2] array respectively to obtain n2 fourth differences, and the n2 fourth differences are compared with the allowable error range respectively. If there is at least one fourth difference greater than the allowable error range, it is determined that the edge detection device 1 has a negative deviation exceeding the allowable error range, and the negative deviation rate of the Y-axis = the number of negative deviations exceeding the allowable error range ÷ n2; similarly, the judgment method of the min2[n2] array is the same as that of the min1[n1] array.

[0145] Step 78, if all the first difference and the second difference are not greater than the allowable error range, it is determined that the first to-be-detected edge distance L3 does not exceed the allowable error range, if all the third difference and the fourth difference are not greater than the allowable error range, it is determined that the second to-be-detected edge distance L4 does not exceed the allowable error range, if the first to-be-detected edge distance L3 and the second to-be-detected edge distance L4 both do not exceed the allowable error range, it is determined that the to-be-detected area 5 does not exceed the allowable error range; if at least one of all the first difference and the second difference is greater than the allowable error range, it is determined that the first to-be-detected edge distance L3 exceeds the allowable error range, if at least one of all the third difference and the fourth difference is greater than the allowable error range, it is determined that the second to-be-detected edge distance L4 exceeds the allowable error range, if the first to-be-detected edge distance L3 and / or the second to-be-detected edge distance L4 exceeds the allowable error range, it is determined that the to-be-detected area 5 exceeds the allowable error range;

[0146] Step 79, the detection result determined is sent to the user interface program. After the edge distance data is identified and the difference is calculated with the pre-set to-be-detected edge distance standard value, it is compared with the pre-set allowable error range, and whether it is qualified is automatically prompted, which is more simple and efficient.

[0147] Step 8, the user interface program reports the result to the production management platform and processes. The UI prompts the personnel to confirm the rework and automatically records, the record can be further uploaded to the production management platform for the quality department to analyze and use, and the process is further improved. The SN number is recognized by OCR and the unqualified product is automatically recorded, without manual recording operation, which is more simple and efficient.

[0148] In the embodiment, the step 8 specifically comprises:

[0149] Step 81, the user interface program receives the detection result;

[0150] Step 82, if the detection result is that the to-be-detected area 5 does not exceed the allowable error range, it means that the edge distance detection device 1 is qualified, then the SN number and the detection result information of the edge distance detection device 1 are recorded and reported to the production management platform, and then the user interface prompts that the edge distance detection device 1 is qualified and enters the next device detection process after confirmation.

[0151] Step 83, if the detection result is that the to-be-detected area 5 exceeds the allowable error range, it means that the edge distance detection device 1 is unqualified, then the detection result is reported to the production management platform, and then the user interface displays the data and the ratio of the excess value range and prompts the device to rework, and records the SN number and the information data of the edge distance detection device 1 after confirming the rework and enters the next device detection process.

[0152] As Figure 7As shown, the embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the AI recognition based margin detection method.

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

[0154] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0155] The above only describes some embodiments of the present application, and does not limit the protection scope of the present application, and any equivalent device or equivalent process transformation made by using the content of the specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A margin detection method based on AI recognition, characterized in that: The method is applied to the margin detection equipment and production management platform with a display screen to be detected, and includes the following steps: Step 1: running a margin detection service program on the margin detection device, wherein the margin detection service program reports the device model and configuration parameter information of the current margin detection device to the production management platform; Step 2: The production management platform determines whether to issue new configuration parameter information based on the equipment model and configuration parameter information, and the margin detection device determines the final configuration parameter information based on the issued information; Step 3: The margin detection service program acquires image data collected by the camera in real time, and identifies whether the image data contains the SN of the margin detection device based on the final configuration parameter information. When the SN is identified, a margin detection request carrying the SN is sent to the user interface program on the margin detection device; Step 4: The user interface program receives the margin detection request, determines whether to perform margin detection based on the SN number carried in the margin detection request, and feeds back the determination result to the margin detection service program; Step 5: When the margin detection service program receives feedback from the user interface program that it agrees to perform margin detection, it analyzes and identifies the first fixture and the second fixture in the image data using an AI recognition algorithm, and calculates and generates the X-axis unit distance of each pixel point in each pixel row in the first fixture and the Y-axis unit distance of each pixel point in each pixel column in the second fixture based on the final configuration parameter information and the image pixel size; Step 6: Analyze and identify the area to be detected in the image data using an AI recognition algorithm, and calculate and generate an X-axis margin measurement data set and a Y-axis margin measurement data set corresponding to the area to be detected based on the number of pixels in the area to be detected, the X-axis unit distance of each pixel row, and the Y-axis unit distance of each pixel column; Step 7: extracting the maximum and minimum values ​​from the X-axis margin measurement data set and the Y-axis margin measurement data set, respectively, determining whether the area to be inspected exceeds an allowable error range based on the configuration parameter information, the maximum and minimum values, and sending the result to the user interface program; Step 8: The user interface program reports the results to the production management platform for processing.

2. The margin detection method based on AI recognition according to claim 1, characterized in that: The step 1 specifically includes: Step 11: configuring a margin detection service program on the margin detection device; Step 12: Start the margin detection device and establish a network connection with the production management platform via the TCP protocol; Step 13: A login account and password for registration are pre-stored in the margin detection device; Step 14: Run the margin detection service program, which calls the http interface and uses the login account and password pre-stored in the margin detection device to register and log in to the production management platform; Step 15. After logging in, the margin detection service program reports the device model and configuration parameter information of the current margin detection device to the production management platform; the configuration parameter information includes the actual value of the reference margin, the standard value of the margin to be detected of the margin detection device, the allowable error range of the margin detection device, and the SN number reference format of the margin detection device.

3. The margin detection method based on AI recognition according to claim 2, characterized in that: The step 2 specifically includes: Step 21: A production management database for storing data is configured on the production management platform; Step 22: Different equipment models and corresponding configuration parameter information are preset in the production management database; each set of equipment models and their corresponding configuration parameter information are associated one by one; Step 23: The production management platform receives the reported equipment model and configuration parameter information; Step 24: The production management platform finds matching equipment model and configuration parameter information from the production management database according to the received equipment model; Step 25: The production management platform compares the received configuration parameter information with the configuration parameter information found in the production management database; if the comparison result is inconsistent, it is determined that the configuration parameter information of the margin detection device needs to be updated, and the process proceeds to step 26; if the comparison result is consistent, it is determined that the configuration parameter information of the margin detection device does not need to be updated, and the current configuration parameter information of the margin detection device is used as the final configuration parameter information, and the process proceeds to step 3; Step 26: The production management platform sends the configuration parameter information found in the production management database as new configuration parameter information to the margin detection device; Step 27: The margin detection device receives the new configuration parameter information as the final configuration parameter information, and stores the final configuration parameter information in the flash, and then proceeds to step 3.

4. The margin detection method based on AI recognition according to claim 3, characterized in that: The step 3 specifically includes: Step 31: A camera is fixed directly above the margin detection device; Step 32: Connect the camera to the margin detection device via a USB interface or an Ethernet port; Step 33: The camera collects image data of the margin detection device in real time and sends it to the margin detection device. The image data captured by the camera includes images of the margin detection device, the display screen, two first fixtures respectively installed on the left and right edges of the margin detection device, and two second fixtures respectively installed on the upper and lower edges of the margin detection device. Step 34: The margin detection service program obtains the image data, invokes an OCR recognition algorithm to identify the SN in the image data, and compares the character format of the SN in the image data with the SN reference format of the margin detection device preset in the final configuration parameter information. If they are consistent, it is determined that the SN is recognized, and the process proceeds to step 35; if they are inconsistent, it is determined that the SN is not recognized, and the process returns to step 34. Step 35: The margin detection service program sends a margin detection request carrying the SN number to the user interface program configured on the margin detection device.

5. The margin detection method based on AI recognition according to claim 4, characterized in that: The step 4 specifically includes: Step 41: The margin detection device starts a user interface program and creates a message queue, which is used to receive messages from the margin detection service program. Step 42: The user interface program receives a margin detection request sent by the margin detection service program through a message queue; Step 43: Parse the margin detection request, obtain the SN of the margin detection device, and display it on the display screen; Step 44: Compare the SN number displayed on the display screen with the SN number on the margin detection device. If they are consistent, the user interface program sends feedback information of agreeing to perform the test to the margin detection service program and proceeds to step 5. If they are inconsistent, proceed to step 45. Step 45: Manually correct the SN number on the display screen through the user interface and return to step 44.

6. The margin detection method based on AI recognition according to claim 5, characterized in that: In step 5, the first fixture and the second fixture are analyzed and identified in the image data using an AI recognition algorithm, and the X-axis unit distance of each pixel point in each pixel row of the first fixture and the Y-axis unit distance of each pixel point in each pixel column of the second fixture are calculated based on the final configuration parameter information and the image pixel size. Specifically, the calculation includes: Step 51: The margin detection service program starts the detection task thread and enters the margin detection process; Step 52: The margin detection service program analyzes and identifies the first fixture and the second fixture in the image data through an AI recognition algorithm. The known fixed width distance between the left edge of the margin detection device and the edge of the first fixture on the left, and the known fixed width distance between the right edge of the margin detection device and the edge of the first fixture on the right are both first reference margins. The known fixed height distance between the upper edge of the margin detection device and the edge of the second fixture on the upper side, and the known fixed height distance between the lower edge of the margin detection device and the edge of the second fixture on the lower side are both second reference margins. The values ​​of the first reference margin and the second reference margin are both equal to the actual values ​​of the reference margins. Step 53: Obtain the actual value of the reference margin, the number of pixel rows of the first fixture, and the number of pixel columns of the second fixture in the final configuration parameter information. Calculate the X-axis unit distance of each pixel point in each pixel row of the first fixture based on the actual value of the reference margin and the number of pixels in each pixel row of the first fixture, and store the calculated value in the corresponding array CKX[]. The calculation formula is: X-axis unit distance of pixels in the current pixel row = actual value of the reference margin / number of pixels in the current pixel row. Step 54: Calculate the Y-axis unit distance of each pixel point in each pixel column of the second fixture based on the actual value of the reference margin and the number of pixels in each pixel column of the second fixture, and store it in the corresponding array CKY[]. The calculation formula is: Y-axis unit distance of pixel points in the current pixel column = actual value of the reference margin ÷ number of pixels in the current pixel column.

7. The margin detection method based on AI recognition according to claim 6, characterized in that: The step 6 specifically includes: Step 61: Analyze and identify an area to be detected in the image data using an AI recognition algorithm. The area to be detected is the area formed between the edge line where the first and second clamps contact the margin detection device and the edge of the display screen. The area to be detected includes a first area, a second area, a third area, and a fourth area. The first area is an area close to the first clamp on the left, the second area is an area close to the first clamp on the right, the third area is an area close to the second clamp on the top, and the fourth area is an area close to the second clamp on the bottom. Step 62: Identify the number of pixel rows and the number of pixels in each pixel row in the first region, and obtain the X-axis unit distance of the pixel row at the corresponding position from the array CKX[]. Calculate and generate X-axis margin measurement data for the corresponding pixel row in the first region based on the number of pixels in each pixel row and the X-axis unit distance. The calculation formula is: X-axis margin measurement data corresponding to the current pixel row in the first region = X-axis unit distance of the current pixel row × number of pixels in the current pixel row. Step 63: Identify the number of pixel rows and the number of pixels in each pixel row in the second region, and obtain the X-axis unit distance of the pixel row at the corresponding position from the array CKX[]. Calculate and generate X-axis margin measurement data for the corresponding pixel row in the second region based on the number of pixels in each pixel row and the X-axis unit distance. The calculation formula is: X-axis margin measurement data corresponding to the current pixel row in the second region = X-axis unit distance of the current pixel row × number of pixels in the current pixel row. All X-axis margin measurement data calculated for the first and second regions constitute an X-axis margin measurement data set Val_xl[]. Step 64: Identify the number of pixel columns and the number of pixels in each pixel column in the third region, and obtain the Y-axis unit distance of the pixel column at the corresponding position from the array CKY[]. Calculate and generate Y-axis margin measurement data for the corresponding pixel column in the third region based on the number of pixels and the Y-axis unit distance of each pixel column. The calculation formula is: Y-axis margin measurement data corresponding to the current pixel column in the third region = Y-axis unit distance of the current pixel column × number of pixels in the current pixel column. Step 65: Identify the number of pixel columns and the number of pixels in each pixel column in the fourth region, and obtain the Y-axis unit distance of the pixel column at the corresponding position from the array CKY[]. Calculate and generate Y-axis margin measurement data for the corresponding pixel column in the fourth region based on the number of pixels and the Y-axis unit distance in each pixel column. The calculation formula is: Y-axis margin measurement data corresponding to the current pixel column in the fourth region = Y-axis unit distance of the current pixel column × number of pixels in the current pixel column. All Y-axis margin measurement data calculated for the third and fourth regions constitute a Y-axis margin measurement data group Val_yl[]. Step 66: Merge the two X-axis margin measurement data calculated from adjacent pixel rows in the X-axis margin measurement data group Val_x1[] to obtain an average value for data compression, thereby obtaining a compressed X-axis margin measurement data group Val_x2[]. Simultaneously, merge the two Y-axis margin measurement data calculated from adjacent pixel columns in the Y-axis margin measurement data group Val_yl[] to obtain an average value for data compression, thereby obtaining a compressed Y-axis margin measurement data group Val_y2[].

8. The margin detection method based on AI recognition according to claim 7, characterized in that: The step 7 specifically includes: Step 71: The standard values ​​of the margins to be detected in the configuration parameter information include an X-axis standard value x_val and a Y-axis standard value y_val; the width of the first area or the second area is a first margin to be detected, and the height of the third area or the fourth area is a second margin to be detected; Step 72: extract the largest m1 values ​​in the X-axis margin measurement data set Val_x2[] and store them in the max1[m1] array, and the smallest n1 values ​​in the min1[n1] array; the values ​​of m1 and n1 are set according to user needs; Step 73: Calculate the difference between the m1 values ​​in the max1[m1] array and the X-axis standard value x_val to obtain m1 first differences. Compare each of the m1 first differences with the allowable error range. If at least one first difference is larger than the allowable error range, it is determined that the margin detection device has a positive deviation that exceeds the allowable error range. The positive deviation rate of the X-axis = the number of positive deviations that exceed the allowable error range / m1. Step 74: Calculate the difference between the X-axis standard value x_val and the n1 values ​​in the min1[n1] array to obtain n1 second difference values. Compare each of the n1 second difference values ​​with the allowable error range. If at least one second difference value is greater than the allowable error range, it is determined that the margin detection device has a negative deviation that exceeds the allowable error range. The negative deviation rate of the X-axis = the number of negative deviations that exceed the allowable error range / n1. Step 75: extract the largest m2 values ​​in the Y-axis margin measurement data set Val_y2[] and store them in the max2[m2] array and the smallest n2 values ​​in the min2[n2] array; the values ​​of m2 and n2 are set according to user needs; Step 76: Calculate the difference between the m2 values ​​in the max2[m2] array and the Y-axis standard value y_val to obtain m2 third differences. Compare the m2 third differences with the allowable error range. If at least one third difference is larger than the allowable error range, it is determined that the margin detection device has a positive deviation that exceeds the allowable error range. The positive deviation rate of the Y-axis = the number of positive deviations that exceed the allowable error range / m2; Step 77: Calculate the difference between the Y-axis standard value y_val and the n2 values ​​in the min2[n2] array to obtain n2 fourth differences, and compare the n2 fourth differences with the allowable error range. If at least one fourth difference is larger than the allowable error range, it is determined that the margin detection device has a negative deviation that exceeds the allowable error range. The negative deviation rate of the Y-axis = the number of negative deviations that exceed the allowable error range / n2; Step 78: If all the first differences and the second differences are not greater than the allowable error range, it is determined that the first margin to be detected does not exceed the allowable error range; if all the third differences and the fourth differences are not greater than the allowable error range, it is determined that the second margin to be detected does not exceed the allowable error range; if both the first margin to be detected and the second margin to be detected do not exceed the allowable error range, it is determined that the area to be detected does not exceed the allowable error range; if at least one of all the first differences and the second differences is greater than the allowable error range, it is determined that the first margin to be detected exceeds the allowable error range; if at least one of all the third differences and the fourth differences is greater than the allowable error range, it is determined that the second margin to be detected exceeds the allowable error range; if the first margin to be detected and / or the second margin to be detected exceeds the allowable error range, it is determined that the area to be detected exceeds the allowable error range; Step 79: Send the determined detection result to the user interface program.

9. The margin detection method based on AI recognition according to claim 8, characterized in that: The step 8 specifically includes: Step 81: The user interface program receives the test result; Step 82: If the test result shows that the area to be tested does not exceed the allowable error range, indicating that the margin detection equipment is qualified, the SN number of the margin detection equipment and the test result information are recorded and reported to the production management platform. The user interface then prompts that the margin detection equipment is qualified and enters the next equipment detection process after confirmation; Step 83: If the test result shows that the area to be tested exceeds the allowable error range, indicating that the margin detection equipment is unqualified, the test result will be reported to the production management platform, and then the user interface will display the data and ratio that exceed the value range, and prompt the equipment to be reworked. After the rework is confirmed, the SN number of the margin detection equipment and the analyzed information data will be recorded and the next equipment inspection process will be entered.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the margin detection method based on AI recognition as described in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Distance measuring method based on monocular camera and electronic equipment

    CN112033351A

  • Abnormal vein image detection method based on edge morphology

    CN116884048A