Detection and identification method for screw holes of mobile phone TP frame and screw locking device

Through the method of image segmentation and matching degree comparison, the problem of insufficient screw hole detection accuracy in traditional technology is solved, and efficient and accurate identification of screw holes in mobile phone TP frames is achieved, which is suitable for a variety of product types.

CN114418935BActive Publication Date: 2024-12-24QINGDAO HUICHENG IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111468242.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2024-12-24
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

The accuracy of the traditional automatic screw lock machine cannot be guaranteed in the detection of screw holes on mobile phone TP frames, and it is difficult to identify concave screw holes and interference hole positions. The existing circle detection and recognition algorithms are difficult to accurately identify the detection of special screw holes and interference hole positions characteristics. It cannot meet the production needs of small precision products for mobile phones.

Method used

Use photos to collect the TP frame images of the mobile phone. After preprocessing, the image segmentation algorithm is used to divide the suspected screw hole area, calculate the characteristic parameters and the preset threshold to remove the interference area, reduce the target area and compare the matching degree with the preset template, and determine whether it exists Screw hole.

Benefits of technology

It realizes high-precision identification of screw holes on mobile phone TP frames, has strong anti-interference and low computational complexity, improves detection rate, adapts to various product types, and is simple to operate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114418935B_ABST
    Figure CN114418935B_ABST
Patent Text Reader

Abstract

The present invention discloses a detection and identification method for screw holes of a mobile phone TP frame and a screw locking device, wherein the method comprises the following steps: S1, taking a photo to collect an image of a mobile phone TP frame, and preprocessing the image; S2, reading the preprocessed image, and segmenting the preprocessed image using an image segmentation algorithm to obtain a plurality of suspected target areas suspected to be screw holes; S3, for each image of the suspected target area segmented in step S2, calculating the characteristic parameters of the image and comparing them with a preset parameter threshold, thereby removing the interference area and screening out the target area; S4, for each target area screened out in step S3, reducing the target area to an area with the same size as that of a preset template with the center of a circle in the target area as the center point, and then comparing the matching degree between the reduced target area image and the preset template image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic screw locking, and in particular to a detection and identification method for screw holes of a mobile phone TP frame and a screw locking device. Background Art

[0002] At present, mobile phones have become the most sophisticated electronic consumables in the world. They are terminal devices that integrate a series of functions such as communication, photography, navigation, and entertainment. The current global production of mobile phones has reached one billion units, and my country accounts for nearly 40%. Therefore, the quality of mobile phone production and assembly directly affects the economic benefits of my country's mobile phone manufacturing industry, among which screw locking is one of the important processes in the assembly link. How to accurately identify the coordinate information of the positioning screw hole is the key to successfully locking the screw. Traditional automatic screw locking machines lock screws by manually setting the hole coordinate information. The locking process is cumbersome, the accuracy requirements cannot be guaranteed, and the product rules are single, which makes it difficult to meet the production needs of small precision mobile phones. The background of the mobile phone TP (Touch Panel, touch screen) frame is complex, and it is difficult to distinguish between the interference holes and the target holes (concave screw holes), which increases the difficulty of screw hole detection.

[0003] Common circle detection and recognition algorithms include: Hough transform, circularity detection, and circle fitting algorithm. The Hough transform circle detection algorithm mainly converts each pixel point to the polar coordinates of the corresponding circle and accumulates the intensity of the center polar coordinates to find the point with the largest intensity; the circularity detection algorithm mainly uses the Blob analysis algorithm to segment the area, calculate the circularity of each area, set the circularity threshold, and compare the threshold size to obtain the target circle; the circle fitting algorithm often uses the least squares method for fitting, which is a statistical-based detection method that can detect and identify well even if the edge of the circle is missing. The above-mentioned detection method has a good detection rate for circular areas or flat-mouth screw holes in the detection product, but the detection algorithm is relatively simple. It is difficult for such algorithms to achieve accurate recognition in the detection of special screw holes (concave screw holes) and interference holes with similar features, and it is difficult to meet actual needs. Summary of the invention

[0004] In order to overcome the above-mentioned deficiencies of the prior art, the present invention provides a method for detecting and identifying screw holes of a mobile phone TP frame, comprising the following steps:

[0005] S1, take photos to collect the image of the mobile phone TP frame and pre-process the image;

[0006] S2, reading the preprocessed image, and segmenting the preprocessed image using an image segmentation algorithm to obtain a plurality of suspected target areas that are suspected to be screw holes;

[0007] S3, for each image of the suspected target area obtained by segmentation in step S2, calculating the characteristic parameters of the image and comparing them with a preset parameter threshold to distinguish the target area and the interference area among the multiple suspected target areas, thereby removing the interference area and screening out the target area;

[0008] S4. For each target area screened out in step S3, the target area is reduced to an area with the same size as the preset template with the center of the circle in the target area as the center point, and then the reduced target area image is compared with the image of the preset template for matching, and it is determined whether there is a screw hole in the target area based on the matching result.

[0009] In some embodiments, in step S1, the light source used for taking photos is a red bar light source, and the image obtained by taking photos is a grayscale image. The step of preprocessing the image specifically includes:

[0010] The global threshold processing method is adopted to obtain the area where the mobile phone TP frame in the image is located as the region of interest through opening and closing operations. Then, the image of the region of interest is enhanced by denoising, filtering smoothing and contrast enhancement algorithms.

[0011] In some embodiments, step S2 specifically includes:

[0012] Read the preprocessed image, use the mean filter algorithm to smooth the image, and then use the local threshold segmentation algorithm to compare the local difference of the image before and after the mean filter algorithm is processed, so as to segment multiple areas whose differences are greater than the preset segmentation threshold as suspected target areas;

[0013] In the above-mentioned mean filter algorithm, the size of the mask is set to 0.02 times the size of the image before segmentation.

[0014] In some embodiments, step S3 specifically includes:

[0015] For each image of the suspected target area, the area, roundness and compactness of the image are calculated respectively, and the calculation results are compared with the preset threshold to remove the interference area and filter out the target area;

[0016] The roundness is calculated according to the following formula:

[0017]

[0018] In the formula, C1 represents the circularity, F represents the area of ​​the region, and max represents the maximum value of the distance between the pixel point in the region and the center of the region.

[0019] The compactness is calculated according to the following formula:

[0020]

[0021] In the formula, C2 represents compactness, F represents the area of ​​the region, and L represents the length of the shape contour in the region;

[0022] If the area of ​​the image is within the preset area threshold range, the roundness is greater than the preset roundness threshold, and the compactness is less than the preset compactness threshold, the suspected target area corresponding to the image is determined as the target area, otherwise it is determined as an interference area.

[0023] In some embodiments, before step S1, a step of establishing a preset template for the screw holes is also included, specifically including:

[0024] An image of a standard screw hole is obtained and preprocessed. The diameter of the circumscribed circle of the standard screw hole is used as the side length of the template area to crop the square template area of ​​the standard screw hole. A shape template is created according to the image clarity and feature contours of each level of the image pyramid of the template area to serve as a preset template for the screw hole. The number of layers of the image pyramid is set to four, and the images of each level are contours of several concentric circles with increasing diameters.

[0025] In some embodiments, step S4 specifically includes:

[0026] For each target area screened out in step S3, the target area is reduced to a square area with the same size as the preset template with the center of the circle in the target area as the center point, and then the reduced target area image is compared with the image pyramid of the preset template from top to bottom for matching. If the matching degree is greater than a preset matching threshold and the contrast change trend of the target area image and the preset template is the same, it is determined that there is a screw hole in the corresponding target area; otherwise, it is determined that there is no screw hole in the corresponding target area.

[0027] On the other hand, the present invention provides a screw locking device, including a camera, a central control module and an operating part; the camera is used to take pictures and collect images of the TP frame of a mobile phone, and the central control module is used to realize screw hole recognition according to the above-mentioned detection and recognition method for screw holes of the TP frame of a mobile phone, and after realizing the screw hole recognition, control the operating part to operate the screw to complete the screw locking.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] The detection and identification method for the screw holes of the mobile phone TP frame provided by the present invention has the advantages of strong anti-interference, low calculation complexity, high accuracy, etc., can effectively identify and detect all screw hole positions, and improve the detection rate.

[0030] The screw locking device provided by the present invention applies machine vision technology to the field of screw locking. After the image of the mobile phone TP frame is captured by the camera, the above-mentioned detection and identification method for the screw holes of the mobile phone TP frame is used to detect and identify the coordinates of the screw holes, so that the screw holes to be locked can be identified quickly, efficiently and accurately, and then the screw locking is completed. It is suitable for a wide range of product types and is simple to operate. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A flow chart of a method for detecting and identifying screw holes of a mobile phone TP frame provided by the present invention;

[0032] Figure 2 The image of the mobile phone TP frame after preprocessing in step S1;

[0033] Figure 3 A map of the area determined to have screw holes in step S4;

[0034] Figure 4a and Figure 4b This is a diagram of the area where it is determined in step S4 that there are no screw holes. DETAILED DESCRIPTION

[0035] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the following further describes how the present invention is implemented in conjunction with the accompanying drawings and specific implementation methods.

[0036] Reference Figure 1 As shown, the present invention provides a method for detecting and identifying screw holes of a mobile phone TP frame, comprising the following steps:

[0037] S1, take photos to collect the image of the mobile phone TP frame and pre-process the image;

[0038] S2, reading the preprocessed image, and segmenting the preprocessed image using an image segmentation algorithm to obtain a plurality of suspected target areas that are suspected to be screw holes;

[0039] S3, for each image of the suspected target area obtained by segmentation in step S2, calculating the characteristic parameters of the image and comparing them with a preset parameter threshold to distinguish the target area and the interference area among the multiple suspected target areas, thereby removing the interference area and screening out the target area;

[0040] S4. For each target area screened out in step S3, the target area is reduced to an area with the same size as the preset template with the center of the circle in the target area as the center point, and then the reduced target area image is compared with the image of the preset template for matching, and it is determined whether there is a screw hole in the target area based on the matching result.

[0041] Preferably, in step S1, the light source used for taking photos is a red strip light source, the image obtained by taking photos is a grayscale image, and the step of preprocessing the image specifically includes:

[0042] The global threshold processing method is adopted, and the threshold can be set to 220. After opening and closing operations, the area where the mobile phone TP frame is located in the image is obtained as the region of interest, and then the image of the region of interest is subjected to image enhancement processing by using denoising, filtering smoothing and contrast enhancement algorithms. In a specific embodiment, the image obtained after preprocessing is as follows Figure 1 shown.

[0043] After the preprocessing operation, the difference between the edge information of the screw hole in the image and the image background does not change much, and the entire image cannot be segmented by a single high and low threshold. It is necessary to find a suitable threshold through its neighborhood for segmentation. Further, step S2 specifically includes:

[0044] Read the preprocessed image, use the mean filter algorithm to smooth the image, and then use the local threshold segmentation algorithm to compare the local differences of the image before and after the mean filter algorithm processing, so as to segment multiple areas with differences greater than the preset segmentation threshold (the segmentation threshold can be set to 10) as suspected target areas;

[0045] Preferably, in the above-mentioned mean filter algorithm, the size of the mask is set to 0.02 times the size of the image before segmentation.

[0046] After image preprocessing, there is a lot of salt and pepper noise in the background of the mobile phone TP frame, so the core is to use a mean filtering algorithm with a reasonable mask size. If the size is too large, the background will be blurred and the target holes in the edge area will be missed; if the size is too small, the denoising effect is not obvious, and the target hole area cannot be segmented. The above-mentioned mask size used in the present invention is moderate in size, which can achieve the separation of the target holes and avoid missed detection. The most important thing about image segmentation is to retain all the areas containing the target screw holes. The fixed segmentation threshold has weak adaptability. The present invention adopts dynamic threshold segmentation and dynamic mean filtering mask size to enhance the applicability of the algorithm and effectively segment the required area.

[0047] Furthermore, step S3 specifically includes:

[0048] For each image of the suspected target area, the area, roundness and compactness of the image are calculated respectively, and the calculation results are compared with the preset threshold to remove the interference area and filter out the target area;

[0049] The roundness is calculated according to the following formula:

[0050]

[0051] In the formula, C1 represents the circularity, F represents the area of ​​the region, and max represents the maximum value of the distance between the pixel point in the region and the center of the region.

[0052] The compactness is calculated according to the following formula:

[0053]

[0054] In the formula, C2 represents compactness, F represents the area of ​​the region, and L represents the length of the shape contour in the region;

[0055] If the area of ​​the image is within the preset area threshold range, the roundness is greater than the preset roundness threshold, and the compactness is less than the preset compactness threshold, the suspected target area corresponding to the image is determined as the target area, otherwise it is determined as an interference area.

[0056] It is understandable that after the processing of step S3, non-circular interference areas such as rectangles and lines can be excluded to obtain all circular areas. The area threshold, roundness threshold and compactness threshold in step S3 can be set and adjusted according to actual conditions. In general, each threshold can be set conservatively to preserve the target hole position information as much as possible and avoid missed detection, and further screening can be achieved after the processing of step S4.

[0057] Furthermore, before step S1, a step of establishing a preset template for the screw holes is also included, specifically including:

[0058] An image of a standard screw hole is obtained and preprocessed. The diameter of the circumscribed circle of the standard screw hole is used as the side length of the template area to crop the square template area of ​​the standard screw hole. A shape template is created according to the image clarity and feature contours of each level of the image pyramid of the template area to serve as a preset template for the screw hole. The number of layers of the image pyramid is set to four, and the images of each level are contours of several concentric circles with increasing diameters.

[0059] In a specific embodiment, the area where the screw hole is determined to exist is as follows: Figure 3 As shown; the area where it is determined that there is no screw hole is as shown Figure 4a and Figure 4b shown.

[0060] Preferably, step S4 specifically includes:

[0061] For each target area screened in step S3, the target area is reduced to a square area with the same size as the preset template with the center of the circle in the target area as the center point, and then the reduced target area image is compared with the image pyramid of the preset template from top to bottom for matching. If the matching degree is greater than a preset matching threshold (for example, it can be set to 0.8) and the contrast change trend of the target area image and the preset template is the same, it is determined that there is a screw hole in the corresponding target area, otherwise it is determined that there is no screw hole in the corresponding target area. For example, for Figure 3 The contrast of the threaded hole shown in the figure is gray-black-gray-black-white (gray)-black, and contains five circles. By comparing these feature information with the preset template, the interference circular holes and the target screw holes can be completely distinguished, and all the targets can be accurately detected and identified. After scanning, searching and comparing each target area one by one, all the target holes can be detected.

[0062] On the other hand, the present invention provides a screw locking device, including a camera, a central control module and an operating part; the camera is used to take pictures and collect images of the TP frame of a mobile phone, and the central control module is used to realize screw hole recognition according to the above-mentioned detection and recognition method for screw holes of the TP frame of a mobile phone, and after realizing the screw hole recognition, control the operating part to operate the screw to complete the screw locking.

[0063] In summary, the detection and identification method for the screw holes of the mobile phone TP frame provided by the present invention has the advantages of strong anti-interference, low calculation complexity, high accuracy, etc., and can effectively identify and detect all screw hole positions to improve the detection rate.

[0064] The screw locking device provided by the present invention applies machine vision technology to the field of screw locking. After the image of the mobile phone TP frame is captured by the camera, the above-mentioned detection and identification method for the screw holes of the mobile phone TP frame is used to detect and identify the coordinates of the screw holes, so that the screw holes to be locked can be identified quickly, efficiently and accurately, and then the screw locking is completed. It is suitable for a wide range of product types and is simple to operate.

[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

Claims

1. A method for detecting and identifying screw holes of a mobile phone TP frame, characterized in that: The steps include: S1, take photos to collect the image of the mobile phone TP frame and pre-process the image; S2, reading the preprocessed image, and segmenting the preprocessed image using an image segmentation algorithm to obtain a plurality of suspected target areas that are suspected to be screw holes; S3, for each image of the suspected target area obtained by segmentation in step S2, first calculate the characteristic parameters of the image, and then compare them with the preset parameter threshold to distinguish the target area and the interference area among the multiple suspected target areas, and then remove the interference area to screen out the target area; S4, for each target area screened in step S3, the target area is reduced to an area with the same size as the preset template with the center of the circle in the target area as the center point, and then the image of the reduced target area is compared with the image of the preset template for matching, and it is determined whether there is a screw hole in the target area according to the matching result; Wherein, step S3 specifically includes: For each image of the suspected target area, the area, roundness and compactness of the image are calculated respectively, and the calculation results are compared with the preset threshold to remove the interference area and filter out the target area; The roundness is calculated according to the following formula: In the formula, represents the circularity, F represents the area of ​​the region, and max represents the maximum value of the distance between the pixel points in the region and the center of the region; The compactness is calculated according to the following formula: In the formula, represents compactness, F represents the area of ​​the region, and L represents the length of the shape outline in the region; If the area of ​​the image is within the preset area threshold range, the roundness is greater than the preset roundness threshold, and the compactness is less than the preset compactness threshold, the suspected target area corresponding to the image is determined as the target area, otherwise it is determined as an interference area.

2. The method for detecting and identifying screw holes of a mobile phone TP frame according to claim 1, characterized in that: In step S1, the light source used for taking photos is a red strip light source, and the image obtained by taking photos is a grayscale image. The steps of preprocessing the image specifically include: First, the global threshold processing method is used, and after opening and closing operations, the area where the mobile phone TP frame is located in the image is obtained as the region of interest. Then, the image of the region of interest is enhanced by denoising, filtering smoothing and contrast enhancement algorithms.

3. The method for detecting and identifying screw holes of a mobile phone TP frame according to claim 1, characterized in that: Step S2 specifically includes: First, the pre-processed image is read, and the image is smoothed using the mean filter algorithm. Then, the local threshold segmentation algorithm is used to compare the local differences of the image before and after the mean filter algorithm is used, and multiple regions with differences greater than the preset segmentation threshold are segmented as suspected target regions. In the above-mentioned mean filter algorithm, the size of the mask is set to 0.02 times the size of the image before segmentation.

4. The method for detecting and identifying screw holes of a mobile phone TP frame according to claim 1, characterized in that: Before step S1, the method further includes the step of establishing a preset template for the screw holes, which specifically includes: An image of a standard screw hole is obtained and preprocessed. The diameter of the circumscribed circle of the standard screw hole is used as the side length of the template area to crop the square template area of ​​the standard screw hole. A shape template is created according to the image clarity and feature contours of each level of the image pyramid of the template area to serve as a preset template for the screw hole. The number of layers of the image pyramid is set to four, and the images of each level are contours of several concentric circles with increasing diameters.

5. The method for detecting and identifying screw holes of a mobile phone TP frame according to claim 4, characterized in that: Step S4 specifically includes: For each target area screened out in step S3, the target area is reduced to a square area with the same size as the preset template with the center of the circle in the target area as the center point, and then the reduced target area image is compared with the image pyramid of the preset template from top to bottom for matching. If the matching degree is greater than a preset matching threshold and the contrast change trend of the target area image and the preset template is the same, it is determined that there is a screw hole in the corresponding target area; otherwise, it is determined that there is no screw hole in the corresponding target area.

6. A screw locking device, characterized in that: It includes a camera, a central control module and an operating part; the camera is used to take pictures to collect images of the mobile phone TP frame, and the central control module is used to realize screw hole recognition according to the detection and recognition method for the screw holes of the mobile phone TP frame according to any one of claims 1-5, and after the screw hole recognition is realized, the operating part is controlled to operate the screw to complete the screw locking.