Intelligent lantern appearance defect automatic detection method and system combined with image recognition

Through multi-degree-of-freedom vision devices and image recognition technology, a preset fan-shaped search area and an ideal equiangular spiral path are constructed for comparison, which solves the key defect identification problem in lantern structural integrity detection and realizes efficient and accurate automated detection.

CN120831370AActive Publication Date: 2025-10-24SHAOYANG XINDA TECH CO LTD

Patent Information

Application Number
CN202511315997.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-16
Publication Date
2025-10-24
Estimated Expiration
2045-09-16

AI Technical Summary

Technical Problem

Existing image detection technology has difficulty in effectively identifying key defects in the structural integrity of lanterns, such as the identification of the starting segment of the bone fragment, the verification of the complete bone fragment groove trajectory, and the evaluation of the end connection status, which may lead to quality problems such as loosening, deformation or breakage during product use.

Method used

A panoramic image of the lantern is acquired through a multi-degree-of-freedom vision device, and stitching and geometric correction are performed. The top plate bayonet array is identified, and a preset fan-shaped search area based on the extension direction of the bone fragment is constructed to search for the starting segment of the bone fragment groove. The complete bone fragment groove trajectory is extracted and compared with the ideal equiangular spiral path. The terminal connection status is evaluated in combination with the symmetry mapping relationship of the lantern.

Benefits of technology

It significantly improves the accuracy and efficiency of defect detection, and can systematically identify structural starting point missing, trajectory distortion and connection failure defects, ensuring that product quality meets design standards and avoiding misjudgment and calculation redundancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120831370A_ABST
    Figure CN120831370A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent lantern appearance defect automatic detection method and system combined with image recognition, and relates to the technical field of defect detection, and the method comprises the steps: searching an effective bone sheet starting section of a bone sheet groove in a preset fan-shaped search region; if the effective bone sheet starting section of the bone sheet groove cannot be searched in the preset fan-shaped search area, it is judged that the starting point of the bone sheet groove at the current top plate bayonet position is missing, the structural starting point missing defect exists, and detection is ended; performing consistency check based on the accumulated deviation, and if the check is not passed, ending the detection; identifying the actual bottom plate bayonet position corresponding to the top plate bayonet position in the bottom plate area, determining the distance between the actual bottom plate bayonet position and the tail end of the complete bone sheet groove track, and determining the detection result of the lantern based on the distance. Based on three-level linkage detection logic, systematic quality control from local to global and from form to function is realized by following a physical structure rule of a lantern, and linkage errors caused by starting point misjudgment or trajectory drift are effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of defect detection, and in particular to an intelligent lantern appearance defect automatic detection method and system combined with image recognition. BACKGROUND

[0002] With the deep integration of industrial automation and intelligent manufacturing technology, the detection requirements for product appearance quality and structural integrity of high-end lantern manufacturing industry are increasingly stringent. In a typical production process, customers usually complete the molding of the lantern skeleton through high-precision molds first, and then enter the assembly and surface treatment links. In order to ensure that the final product meets the design standards in terms of shape, symmetry and connection reliability, manufacturers urgently need an efficient, objective and repeatable automatic detection method. However, the traditional detection methods mostly rely on manual visual inspection or basic image comparison, which is difficult to systematically identify key defects affecting the structural integrity of the lantern, especially the three core problems related to the bone piece groove: whether the effective bone piece starting segment exists, whether the complete bone piece groove track conforms to the design rule, and whether the bone piece end is accurately connected to the bottom plate socket. These problems are directly related to the structural stability and aesthetic consistency of the lantern, and if not discovered in time, it will lead to serious quality problems such as skeleton loosening, deformation and even breakage of the product during use.

[0003] The existing image detection technology has obvious limitations when applied to such complex curved surface structures. First, in the identification of the effective bone piece starting segment, although traditional edge detection algorithms (such as Canny, Sobel) can extract the contour information in the image, they cannot distinguish between noise, texture interference and the true bone piece starting point, and lack the ability to make causal judgments on the rationality of the starting direction. For example, if the bone piece does not extend correctly from the top plate socket, or the starting direction deviates significantly from the design axis, ordinary algorithms cannot automatically identify such structural starting point missing defects. Second, for the extraction and verification of the complete bone piece groove track, existing methods mostly use simple curve fitting or template matching, but do not combine the unique geometric rules of the lantern (such as equiangular spiral distribution), resulting in a lack of sensitivity to slight distortions, local deviations and other non-rigid deformations, and a high false positive rate. More importantly, in the evaluation of the end connection state, most systems only roughly judge whether the bone piece reaches the bottom plate area, without accurately quantifying the spatial distance between the actual bottom plate socket position and the end of the complete bone piece groove track, and without establishing a mapping relationship between the top and bottom sockets to judge whether they are connected in place. This detection method lacks structural semantic understanding and cannot effectively identify hidden defects such as misinsertion or virtual connection. SUMMARY

[0004] The present application aims to at least partially solve one of the technical problems in the related art.

[0005] To achieve the above purpose, the embodiment of the present application provides an intelligent lantern appearance defect automatic detection method combined with image recognition, which comprises the following steps:

[0006] Step 1, panoramic images of the lantern are acquired by a multi-degree-of-freedom vision device, and are spliced and geometrically corrected to generate a standardized lantern surface development map;

[0007] Step 2, a top plate contour is identified in the standardized lantern surface development map, and a plurality of top plate socket positions uniformly distributed in the circumferential direction of the top plate contour are extracted to form a top plate socket array;

[0008] Step 3, for each top plate socket position in the top plate socket array, a preset fan-shaped search region based on the extension direction of the bone piece is constructed, and an effective bone piece starting segment of the bone piece groove is searched in the preset fan-shaped search region; if the effective bone piece starting segment of the bone piece groove cannot be searched in the preset fan-shaped search region, it is determined that the starting point of the bone piece groove of the current top plate socket position is missing, and there is a structural starting point missing defect, the detection is ended, and the unqualified product is output; if the effective bone piece starting segment of the bone piece groove is searched in the preset fan-shaped search region, step 4 is performed;

[0009] Step 4, based on the effective bone piece starting segment, a complete bone piece groove trajectory is extracted, and a cumulative deviation from an ideal equiangular spiral path is determined, a consistency test is performed based on the cumulative deviation, if the test passes, step 5 is performed, if the test fails, the detection is ended, it is determined that the bone piece has a structural trajectory distortion defect, and the unqualified product is output;

[0010] Step 5, for the complete bone piece groove trajectory that passes the test, an actual bottom plate socket position corresponding to the top plate socket position in the bottom plate region is identified, a distance between the actual bottom plate socket position and the end of the complete bone piece groove trajectory is determined, and a detection result of the lantern is determined based on the distance.

[0011] In another embodiment, searching for the effective bone piece starting segment of the bone piece groove in the preset fan-shaped search region comprises:

[0012] Step 31, the gradient of each pixel point in the preset fan-shaped search region is determined to obtain a gradient direction and a gradient amplitude;

[0013] Step 32, a first threshold value is preset, a first pixel point is selected, and it is determined whether the gradient amplitude of the first pixel point is greater than the first threshold value, if yes, the first pixel point is taken as a path starting point;

[0014] Step 33, a second threshold value is preset, a next pixel point is selected, and it is determined whether the gradient direction deviation between the current pixel point and the previous pixel point is less than the second threshold value and the gradient amplitude is greater than the first threshold value, if yes, the current pixel point is taken as a path node, if not, the current pixel point is removed; until all pixel points are selected and it is determined whether to be a path node or to be removed.

[0015] Step 34, connecting the path start point and all path nodes to form a gradient path, determining whether the continuously connected path start point and / or path node in the gradient path is greater than a third threshold value, if yes, defining the gradient path as a gradient effective path; if no, eliminating it;

[0016] Step 35, determining whether the deviation of the gradient direction of the path start point or path node of the gradient effective path from the extension direction of the bone piece is less than a direction tolerance, if yes, defining the gradient effective path as an effective bone piece starting segment.

[0017] In another embodiment, the third threshold value is 3-10 pixel units, and the direction tolerance is ±5°.

[0018] In another embodiment, a preset fan-shaped search region is included: taking the top plate socket position as a starting point, and constructing a fan-shaped search range with an opening angle of ±15° along the extension direction of the bone piece.

[0019] In another embodiment, based on the effective bone piece starting segment, a complete bone piece groove trajectory is extracted and a cumulative deviation from an ideal equiangular spiral path is determined, and a consistency test is performed based on the cumulative deviation, including:

[0020] Step 41, taking the end of the effective bone piece starting segment as a starting point, extracting a complete bone piece groove trajectory downward along the side wall to obtain a set of measured trajectory points;

[0021] Step 42, using an ideal equiangular spiral path model to obtain an ideal equiangular spiral path and obtain a set of ideal trajectory points;

[0022] Step 43, determining the cumulative deviation between the set of measured trajectory points and the set of ideal trajectory points;

[0023] Step 44, presetting a fourth threshold value, determining whether the cumulative deviation is greater than the fourth threshold value, if yes, representing that the test fails, determining that the bone piece has a structural trajectory distortion defect and outputting an unqualified product; if no, representing that the test passes.

[0024] In another embodiment, the actual bottom plate socket position corresponding to the top plate socket position in the bottom plate region is identified, the distance between the actual bottom plate socket position and the end of the complete bone piece groove trajectory is determined, and the detection result of the lantern is determined based on the distance, including:

[0025] Step 51, based on the symmetry of the lantern, defining a mapping relationship between the top plate socket position and the bottom plate socket position;

[0026] Step 52, in the standardized lantern surface development diagram, identifying the bottom plate contour, and extracting a plurality of bottom plate socket positions uniformly distributed in the circumferential direction of the bottom plate contour to form a bottom plate socket array;

[0027] Step 53, based on the mapping relationship, identifying the actual bottom plate socket position corresponding to the top plate socket position in the bottom plate contour;

[0028] Step 54, determining the distance between the actual bottom plate socket position and the end of the complete bone piece groove track, presetting a target tolerance threshold, judging whether the distance is greater than the target tolerance threshold, if yes, judging that the bone piece has a connection failure defect with the actual bottom plate socket position and outputting unqualified products, if not, outputting qualified products.

[0029] In another embodiment, the end of the complete bone piece groove track is determined by spatial correlation analysis of the end part of the complete bone piece groove track and the bottom plate socket position.

[0030] In another embodiment, the end of the complete bone piece groove track is determined by spatial correlation analysis of the end part of the complete bone piece groove track and the bottom plate socket position, comprising:

[0031] Detecting whether the end point of the complete bone piece groove track is located at the bottom plate socket position of the bottom plate contour, if yes, taking the actual end point of the complete bone piece groove track as the end of the complete bone piece groove track, if the complete bone piece groove track is interrupted in advance outside the bottom plate contour, extending to the intersection with the bottom plate contour in the direction of the end of the complete bone piece groove track, and taking the intersection point as the end of the complete bone piece groove track, if the complete bone piece groove track is bifurcated within the bottom plate socket contour, performing connected component analysis on each branch, and selecting the end point of the longest branch as the end of the complete bone piece groove track.

[0032] In another embodiment, if the complete bone piece groove track is divergent or blurred, the centroid of the high response region is taken as the end of the complete bone piece groove track in combination with the brightness and edge strength weighting of the bottom plate socket contour.

[0033] The application also discloses an intelligent lantern appearance defect automatic detection system combined with image recognition, comprising the following modules:

[0034] Image acquisition module: used for acquiring panoramic images of the lantern through a multi-degree-of-freedom vision device, and performing splicing and geometric correction to generate a standardized lantern surface development map;

[0035] Socket identification module: used for identifying the top plate contour in the standardized lantern surface development map, and extracting a plurality of top plate socket positions uniformly distributed in the circumferential direction of the top plate contour to form a top plate socket array;

[0036] An effective bone fragment starting segment detection module: for each roof socket position in the roof socket array, a preset sector search area based on the extension direction of the bone fragment is constructed, and the effective bone fragment starting segment of the bone fragment groove is searched in the preset sector search area; if the effective bone fragment starting segment of the bone fragment groove cannot be searched in the preset sector search area, it is determined that the starting point of the bone fragment groove of the current roof socket position is missing, there is a structural starting point missing defect, the detection is ended, and the unqualified product is output;

[0037] A complete bone fragment groove track detection module: based on the effective bone fragment starting segment, a complete bone fragment groove track is extracted and a cumulative deviation from an ideal equiangular spiral path is determined, a consistency test is performed based on the cumulative deviation, if the test fails, the detection is ended, it is determined that the bone fragment has a structural track distortion defect, and an unqualified product is output;

[0038] A socket detection module: for testing the complete bone fragment groove track that passes the test, identifying the actual bottom plate socket position corresponding to the roof socket position in the bottom plate area, determining the distance between the actual bottom plate socket position and the end of the complete bone fragment groove track, and determining the detection result of the lantern based on the distance.

[0039] Compared with the prior art, the application provides an intelligent lantern appearance defect automatic detection method combined with image recognition. By constructing a preset fan-shaped search area based on the extension direction of the bone piece, the effective starting section of the bone piece groove in the limited area is actively searched, the layered progression and step-by-step screening logic of defect detection are realized, and the accuracy, efficiency and interpretability of detection are significantly improved. The method first focuses on the existence verification of the starting section: if the effective bone piece starting section that meets the requirements of gradient amplitude, direction continuity and length cannot be detected in the preset fan-shaped search area, it is immediately determined that there is a structural starting point missing defect at this position, the subsequent process is terminated, and the unqualified product is output, avoiding the invalid tracking of invalid paths, greatly reducing the calculation redundancy and misjudgment risk. After confirming the existence of the effective starting section, the complete bone piece groove trajectory is extracted along the side wall downward taking the section as the trusted starting point, and is compared with the ideal equiangular spiral path generated based on the lantern design parameters to calculate the cumulative deviation. If the deviation exceeds the preset fourth threshold, it is determined that there is a structural trajectory distortion defect, and the process is terminated and the unqualified product is output, ensuring that only the bone piece with geometric shape conforming to the design rule can enter the next stage. Finally, for the bone piece that passes the inspection in the previous two stages, further end connection state evaluation is performed: based on the symmetry mapping relationship of the lantern, the actual bottom plate socket position corresponding to the top plate socket is accurately positioned, and the spatial distance between the complete bone piece groove trajectory end and the actual bottom plate socket position is measured; if the distance exceeds the target tolerance threshold, it is determined that there is a connection failure defect, and the unqualified product is output; otherwise, it is determined that the product is qualified. The three-level linkage detection logic based on the starting point-trajectory-connection not only strictly follows the physical structure rule of the lantern, but also realizes the systematic quality control from local to global and from shape to function, effectively avoids the chain error caused by starting point misjudgment or trajectory drift in the traditional method, and significantly improves the accuracy of defect identification and the engineering practicability of the detection system.

[0040] The application realizes intelligent judgment of the end of the track by spatial correlation analysis of the end part of the complete bone piece groove track and the bottom plate bayonet position, and significantly improves the accuracy and robustness of end positioning. According to different working conditions that may occur in actual detection, the method designs a multi-mode adaptive recognition mechanism: when the track end point accurately falls into the bottom plate bayonet area, the actual end point is directly used as the end of the track to ensure high-precision positioning under normal conditions; when the track is interrupted in advance outside the bottom plate contour due to image blur, obstruction or edge breakage, the end direction is extended and intersected with the bottom plate contour to restore the theoretical insertion point, effectively compensating for the error caused by local information loss; when the track bifurcates in the bayonet area, the end point of the longest branch is selected through connected component analysis to preferentially retain the path that is most likely to continue the main trend, avoiding connection deviation caused by misjudgment of short branches. This end determination strategy based on the combination of physical logic and image features not only overcomes the positioning inaccuracy of traditional edge detection methods when the end is blurred or broken, but also fully considers the actual interference factors in the lampshade manufacturing process, ensuring that the real termination position of the bone piece groove can be determined stably and reliably in complex industrial scenes, providing a high-confidence geometric basis for subsequent judgment of whether the bone piece is accurately inserted into the bottom plate bayonet, and greatly improving the intelligent level and detection reliability of the connection state detection. BRIEF DESCRIPTION OF DRAWINGS

[0041] The above and / or additional aspects and advantages of the present application will become apparent and more readily appreciated from the following description of embodiments, taken in conjunction with the accompanying drawings, in which:

[0042] Figure 1 A flowchart of an intelligent lampshade appearance defect automatic detection method provided by an embodiment of the present application combined with image recognition;

[0043] Figure 2 A structural diagram of an intelligent lampshade appearance defect automatic detection system provided by an embodiment of the present application combined with image recognition;

[0044] Figure 3 A block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0045] The embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings, in which the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as a limitation of the present application.

[0046] The intelligent lampshade appearance defect automatic detection method of an embodiment of the present application combined with image recognition is described below with reference to the accompanying drawings.

[0047] It should be noted that the execution subject of the intelligent lantern appearance defect automatic detection method combined with image recognition in the embodiment of the application is an intelligent lantern appearance defect automatic detection system combined with image recognition in the embodiment of the application. The intelligent lantern appearance defect automatic detection system combined with image recognition can be configured in an electronic device, so that the electronic device can perform the function of automatic detection of lantern appearance defects.

[0048] As shown in Figure 1 The intelligent lantern appearance defect automatic detection method combined with image recognition comprises the following steps:

[0049] Step 1: Obtain the panoramic image of the lantern through the multi-degree-of-freedom vision device, and perform splicing and geometric correction to generate a standardized lantern surface development map.

[0050] The lantern is usually molded or pressed by a high-precision mold to complete the skeleton injection or pressing, so as to ensure that the basic geometric structure of the top plate, the bottom plate and the bone piece meets the design requirements. However, during demolding, handling or subsequent assembly, structural defects such as initial offset of the bone piece, trajectory distortion or end connection out of place may still occur. Therefore, after the mold forming is completed, the lantern needs to be detected for appearance defects to ensure the quality of the product. When the detection starts, the lantern to be detected is fixed on a rotating workbench, and a multi-degree-of-freedom vision device (including multiple adjustable angle industrial cameras) is arranged around the lantern to synchronously collect the surface images of the lantern from different angles. After multiple local high-resolution images are obtained by each camera in a pre-calibrated coordinate system, the fragmented views are fused into a complete panoramic image through an image splicing algorithm (a registration method based on feature points SIFT or ORB). Then, the panoramic image is corrected for geometric distortion, and is developed into a two-dimensional plane image, i.e. a standardized lantern surface development map, according to the cylindrical or conical surface model of the lantern. The development map retains the spatial continuity and relative position relationship of the bone piece groove, and lays a foundation for subsequent accurate identification of the top plate socket, tracking of the bone piece trajectory and positioning of the bottom plate socket in a unified coordinate system.

[0051] Step 2: Identify the top plate contour in the standardized lantern surface development map, and extract multiple top plate socket positions uniformly distributed in the circumferential direction of the top plate contour to form a top plate socket array.

[0052] The edge detection algorithm (such as Canny operator) is used to process the normalized unwrapped image to determine the approximate boundary of the top plate profile. Since the lantern top plate usually has a relatively regular geometric shape (for example, circular), the specific profile of the top plate can be further extracted from the detected edge information using techniques such as Hough transform. Once the top plate profile is accurately identified, the evenly distributed top plate socket positions in the circumferential direction can be analyzed based on it. Specifically, by calculating the center point of the top plate profile as the reference origin, and according to the known number and distribution of the sockets of the top plate design parameters, a number of equal-area regions can be divided along the circumferential direction of the top plate profile. In each region, template matching or feature descriptor-based methods can be used to accurately locate the position of the top plate socket. Considering the manufacturing errors or material deformation that may occur in the actual production process, local binary patterns (LBP) or other texture analysis techniques can also be used to enhance the accuracy and robustness of socket identification. Finally, all identified top plate sockets are arranged in order according to their sequence in the circumferential direction to form an ordered top plate socket array.

[0053] Step 3, for each top plate socket position in the top plate socket array, a preset fan-shaped search region based on the extension direction of the bone piece is constructed, and the effective bone piece starting segment of the bone piece groove is searched in the preset fan-shaped search region; if the effective bone piece starting segment of the bone piece groove cannot be searched in the preset fan-shaped search region, it is determined that the bone piece groove starting point of the current top plate socket position is missing, there is a structural starting point missing defect, the detection is ended and the unqualified product is output; if the effective bone piece starting segment of the bone piece groove is searched in the preset fan-shaped search region, step 4 is executed;

[0054] The preset fan-shaped search region comprises: taking the top plate socket position as a starting point, and constructing a fan-shaped search range with an opening angle of ±15° along the extension direction of the bone piece.

[0055] Wherein, searching for the effective bone piece starting segment of the bone piece groove in the preset fan-shaped search region comprises:

[0056] Step 31, determine the gradient of each pixel point in the preset fan-shaped search region to obtain the gradient direction and gradient amplitude.

[0057] First, the normalized lantern surface unwrapped image needs to be grayed to simplify subsequent calculations. Then, the gradient operator (such as Sobel operator) is used to perform convolution operation on the image to calculate the gradient component Gx in the horizontal direction and the gradient component Gy in the vertical direction of each pixel point.

[0058] Based on the above two components, the gradient amplitude and gradient direction of the pixel point can be further calculated:

[0059] The gradient amplitude represents the edge strength, and the calculation formula is: , is the gradient magnitude.

[0060] The gradient direction represents the orientation of the edge, and the calculation formula is: , is the gradient direction value, which is expressed in the form of angle (such as 0°-360° or -180°-180°), and can be quantized to 8 or 4 main directions (such as 0°, 45°, 90°, etc.) according to needs, which is convenient for subsequent direction consistency judgment.

[0061] In this embodiment, each pixel point in the preset fan-shaped search area is traversed, and the gradient magnitude and the gradient direction are calculated one by one, and the results are stored as a gradient vector field. The gradient vector field not only reflects the edge intensity of each point in the image, but also provides edge orientation information, which lays a foundation for subsequent tracking of continuous and direction-consistent starting segments of bone piece grooves from high gradient areas. Especially for lantern bone pieces and other linear structures with clear extension direction, the consistency of the gradient direction becomes the key basis for identifying effective starting segments.

[0062] Step 32, a first threshold is preset, a first pixel point is selected, and it is judged whether the gradient magnitude of the first pixel point is greater than the first threshold, if yes, the first pixel point is taken as the path starting point.

[0063] A set of known defect-free lantern samples are used for testing, the minimum gradient magnitude of the bone piece starting segment area is counted, and 80% of the value is taken as the first threshold to ensure high recall rate for normal structures.

[0064] After determining the first threshold, the pixel points in the fan-shaped search area are traversed, and the first pixel point with a gradient magnitude greater than the threshold is found in row priority or spiral order. This point is selected as the first pixel point and is taken as the path starting point for tracking the bone piece groove trajectory. The theoretical basis for selecting the first high gradient point as the starting point is that:

[0065] Physical rationality: the starting position of the bone piece should have obvious edge characteristics and high gradient magnitude, as the bone piece extends from the top plate socket;

[0066] Noise resistance: low gradient areas are mostly flat background or noise, and have no structural significance;

[0067] Uniqueness and repeatability: the first high gradient point is searched in a fixed order to avoid inconsistency caused by random selection.

[0068] Therefore, taking the first pixel point with a gradient magnitude greater than the first threshold as the path starting point not only conforms to the basic principle of image edge detection (such as the double-threshold idea in Canny edge detection), but also provides a stable and reliable initial condition for subsequent continuous tracking of bone piece trajectories along the gradient direction, which is a key step to realize accurate starting segment identification.

[0069] Step 33, presetting a second threshold value, selecting a next pixel point and judging whether the gradient direction deviation of the current pixel point and the last pixel point is less than the second threshold value and the gradient amplitude is greater than the first threshold value, if yes, the current pixel point is taken as a path node, if not, it is rejected; until all pixel points are selected and it is determined whether it is a path node or rejected.

[0070] The gradient direction deviation refers to the absolute value of the difference between the gradient direction values of adjacent pixel points.

[0071] The second threshold value is used as an index to judge whether the gradient direction deviation of adjacent pixel points reaches the standard, therefore, the second threshold value is determined by the historical qualified lantern parameters in the embodiment. Specifically, the surface development diagram of 20-50 historical qualified lanterns is collected and the effective bone piece starting segment is extracted, the gradient direction difference of each pair of adjacent pixel points is recorded, the standard deviation and mean value of all gradient direction differences are counted, and the sum of the mean value and twice the standard deviation is taken as the second threshold value of the embodiment.

[0072] From the path starting point, the next possible path node is searched in the eight-neighborhood search mode. That is, for the current pixel point, the eight adjacent pixels (up, down, left, right and diagonal directions) around it are checked, and the candidate points are selected in descending order of gradient amplitude or in the order of the closest direction to the current path trend.

[0073] Only when the following two conditions are met, the current pixel point is accepted as a path node:

[0074] (a) The gradient direction deviation is less than the second threshold value: to ensure the smoothness of the path extension direction, to conform to the geometric law of the bone piece, and to exclude noise or cross texture with sudden direction change;

[0075] (b) The gradient amplitude is greater than the first threshold value: to ensure that the point belongs to the strong edge region and has sufficient structural saliency, and to avoid misincluding weak response regions (such as shadows and gradients) into the path.

[0076] If either condition is not met, the point is rejected and not included in the path. This double-condition constraint mechanism draws on the idea of the hysteresis threshold in Canny edge detection, which can not only maintain the continuity of the path, but also effectively suppress the propagation of noise.

[0077] Step 34, connecting the path starting point and all path nodes to form a gradient path, judging whether the continuously connected path starting point and / or path node in the gradient path is greater than a third threshold value, if yes, the gradient path is defined as a gradient effective path; if not, it is rejected.

[0078] The path start point and all reserved path nodes are sequentially connected in the order of their connection in the tracking process to form a continuous gradient path. Subsequently, it is judged whether the total length of the continuously connected path start point and / or path nodes in the path (i.e. the number of pixel points contained in the path) is greater than a preset third threshold value. If the path length is greater than the third threshold value, the path is defined as a valid gradient path; otherwise, it is regarded as an invalid path and is removed. The core role of this step is to reasonably verify the candidate path obtained by preliminary tracking from the geometric length dimension to distinguish the real bone piece starting segment from the short noise edge, texture interference or local broken fragment.

[0079] The setting of the third threshold value needs to be determined comprehensively in combination with the image resolution, bone piece structure characteristics and actual detection requirements. Although the bone piece groove may be long in physical scale (for example, the starting segment corresponds to several millimeters), in the image preprocessing stage, due to factors such as uneven lighting, edge blur or local occlusion, the continuously high gradient segment that can be stably detected may be short. Therefore, this embodiment does not rely on the complete physical length, but focuses on whether there is a continuously edge with consistent direction, stable intensity and length sufficient to represent the existence of the structure. Setting the third threshold value to be at least 3 pixels and setting the upper limit to be 10 pixels (3-10 pixel units) can effectively filter out single-point noise or double-point false triggering, and takes into account the local continuity and anti-interference ability of the starting segment in the image. The threshold range is verified by a large number of experiments, which significantly reduces the false judgment caused by surface flaws or imaging noise while ensuring a high recall rate for real starting segments. The real bone piece groove, as a key structure to bear the lantern skeleton, has a clear extension length and spatial continuity, and its starting segment cannot be only a few isolated edge points; random noise, surface scratches or local reflections and other pseudo-edges usually appear as short and discrete fragments, which are difficult to form a coherent path with sufficient length. By introducing a length screening mechanism, such false positive responses can be effectively filtered out, significantly improving the robustness and reliability of the detection.

[0080] In step 35, it is judged whether the deviation of the gradient direction of the path start point or the path node of the gradient valid path from the extension direction of the bone piece is less than the direction tolerance. If yes, the gradient valid path is defined as a valid bone piece starting segment.

[0081] The bone pieces of the lantern are regularly arranged in the radial or spiral tangential direction from the top plate socket, and have high rotational symmetry. In an ideal design, the starting direction of each bone piece should strictly point to or cut a certain theoretical path (equiangular spiral). Therefore, the deviation of the gradient direction from the design direction should theoretically tend to 0°. The direction tolerance of ±5° is a reasonable engineering tolerance band introduced on the basis of the ideal design, which not only ensures a high recognition rate for the real structure, but also effectively excludes pseudo-edges with a significantly deviated direction.

[0082] In the lantern design, the bone piece extends from the top plate aperture in a radial or spiral tangential direction. This direction can be determined by geometric modeling. For example, if the top plate is a circular structure and the aperture is located on the circumference, the theoretical bone piece extension direction is the radial outward direction from the center of the top plate to the aperture position.

[0083] The deviation refers to the absolute value of the angle between the gradient direction of the path starting point or path node of the effective path and the extension direction of the bone piece. In this embodiment, the deviation between each path node on the gradient effective path and the extension direction of the bone piece is preferably less than the direction tolerance, and only then is the gradient effective path defined as the effective bone piece starting segment. This ensures that only paths that meet the design expectations in terms of spatial position and geometric direction are accepted, effectively excluding false positives caused by texture interference or structural misalignment.

[0084] Compared with traditional edge detection or template matching methods, the present application significantly improves the accuracy, robustness and physical interpretability of starting segment recognition through a multi-level cooperative mechanism of gradient analysis, direction constraint, length verification and design direction comparison. Existing technologies usually only rely on single edge strength information or global template matching, making it difficult to distinguish between true bone piece starting edges and background noise, texture interference or local defects, especially in complex working conditions such as uneven lighting, surface reflection or slight deformation, which are prone to false positives or false negatives. By introducing gradient amplitude and direction constraints, this scheme not only requires path nodes to have sufficient edge strength (first threshold), but also forces their gradient direction to remain continuous within a local range (second threshold), effectively suppressing the propagation of false edges with direction mutations, ensuring that the tracking path meets the geometric characteristics of smooth bone piece extension. Further, by setting a third threshold, short and discrete noise segments are excluded, and only candidate paths with structural continuity are retained, achieving a transition from pixel-level edges to structure-level line segments. Finally, by introducing deviation judgment from the theoretical bone piece extension direction, the image features are combined with the physical design rules of the lantern, ensuring that the identified starting segment not only has high continuity, strength and consistency in direction, but also meets the design expectations in spatial orientation, thereby fundamentally eliminating false positives with similar morphology but incorrect direction. Overall, this method builds a four-level verification chain of strength → direction → length → semantics, which is significantly superior to the simple matching pattern of strength → position in traditional methods, and can stably and reliably identify the true effective bone piece starting segment in high-noise, low-contrast and local deformation industrial scenarios, providing a high-confidence starting point for subsequent trajectory integrity detection and connection state evaluation, significantly improving the accuracy and automation level of defect detection.

[0085] Step 4: Based on the effective bone piece starting segment, the complete bone piece groove trajectory is extracted and the cumulative deviation from the ideal equiangular spiral path is determined. Based on the cumulative deviation, a consistency test is performed. If the test passes, step 5 is executed. If the test fails, the detection is ended and the bone piece is determined to be a structural trajectory distortion defect, and the unqualified product is output.

[0086] Step 41 , starting from the end of the starting segment of the effective bone fragment, extracting the complete bone fragment groove trajectory downward along the side wall to obtain a measured trajectory point set.

[0087] Taking the end of the starting segment of the effective bone fragment as the initial seed point, the complete bone fragment groove trajectory is extracted downward along the side wall of the lantern. In the standardized lantern surface expansion image, a local search window is set around the end point as the center, and adjacent pixels with high gradient response are detected within the window. Since the bone fragment groove appears as a continuous, smooth linear structure in the image, and its extension direction has a certain continuity, the pixel point with the smallest angle deviation from the current path direction and a gradient amplitude greater than the first threshold is preferentially selected as the next trajectory point. In the tracking process, an improved gradient tracking algorithm is used, combined with a direction prediction mechanism: the possible position of the next pixel is predicted based on the local tangent direction of the current path, and a focused search is performed in this direction to improve tracking efficiency and accuracy. At the same time, to address possible edge breaks or local blurring, a hysteresis connection mechanism is introduced: when the gradient amplitude of a pixel point falls below a first threshold, causing tracking to be interrupted, a high-response point with a gradient amplitude greater than the first threshold is searched within a certain range near the interruption point. The Euclidean distance between this point and the previous track point is determined to be less than a preset distance threshold (15 pixels), and the gradient direction deviation between the two is less than 15°. If these conditions are met, the point is considered a continuation of the original track and bridged, preventing the entire track from being broken due to local defects. Throughout the tracking process, all confirmed track points are recorded sequentially to form an ordered set of two-dimensional coordinates, namely the measured track point set.

[0088] Step 42: Use the ideal equiangular spiral path model to obtain the ideal equiangular spiral path and obtain an ideal trajectory point set.

[0089] The process of using an ideal equiangular spiral path model to obtain an ideal equiangular spiral path and generate an ideal trajectory point set is a conventional technique in the fields of image detection and geometric modeling, widely used in the modeling and quality comparison of industrial products with regular spiral structures. This process constructs an ideal equiangular spiral path model that conforms to the lantern's geometric regularity based on the structural design parameters of the lantern: the top plate radius, the bottom plate radius, the number of bone fragment turns, and the overall height. Because the equiangular spiral has a constant angle between the tangent and the radial at any point, it accurately reflects the design intent of a smooth and symmetrical extension of the bone fragment from the top plate to the bottom plate. After the model is established, the spiral path is discretized and sampled along the circumference at a preset angular resolution (e.g., every 0.1 radian or a fixed pixel step) starting at the top plate's latch position. This generates a series of theoretical trajectory points, which are then arranged in sequence to form the ideal trajectory point set.

[0090] Step 43, determine the cumulative deviation between the measured trajectory point set and the ideal trajectory point set.

[0091] The measured trajectory point set and the ideal trajectory point set are placed in the same image coordinate system and are spatially aligned, including translation, rotation and scale normalization, to eliminate the overall shift caused by image stitching errors or positioning deviations. Subsequently, to establish the correspondence between the two sets of points, the nearest neighbor search strategy is adopted: for each point in the measured trajectory point set, find the nearest corresponding point in the ideal trajectory point set in terms of Euclidean distance, or vice versa. Linear or spline interpolation can also be performed on the ideal trajectory point set to match the distribution density of the measured points. On this basis, the local deviation between each pair of corresponding points, i.e. the Euclidean distance between the two points, is calculated.

[0092] Step 44, a fourth threshold is preset to determine whether the cumulative deviation is greater than the fourth threshold. If yes, it means that the test fails and it is determined that the bone piece has a structural trajectory distortion defect and the unqualified product is output. If not, it means that the test passes.

[0093] A batch of historical qualified lamp samples are collected, and the measured trajectory point set is extracted from the bone piece groove of each sample, and the cumulative deviation between each sample and the corresponding ideal trajectory is calculated. By statistically analyzing the deviation data of this batch of qualified samples, the mean and standard deviation are obtained, and the sum of the mean and three times the standard deviation is taken as the fourth threshold. If the cumulative deviation exceeds this value, it can be considered that it deviates from the normal process level and there is significant trajectory distortion.

[0094] The prior art only focuses on local edge strength or overall shape similarity, and it is difficult to distinguish between real bone piece trajectories and noise, texture interference or local deformation, especially in uneven lighting, surface reflection or slightly deformed industrial site environment, false positives or false negatives are prone to occur. The present scheme realizes the transition from local feature recognition to global structure verification through the complete chain of starting from the effective starting segment → tracking direction continuity → constructing the measured trajectory point set → comparing with the ideal equiangular spiral path → quantifying the cumulative deviation. The lantern bone piece is a key component of the bearing structure function, and its groove trajectory follows strict geometric rules (equiangular spiral) in design, with direction continuity, length stability and path predictability. Therefore, any manufacturing deviation that causes the actual trajectory to deviate from the ideal model beyond the threshold constitutes a structural defect. The method ensures the physical reasonableness of the starting point (only extending from the verified effective starting segment), avoiding false judgment of the entire trajectory starting from a false edge; the ideal equiangular spiral path model is introduced as the design reference, which reflects the respect and quantitative reduction of the original design intention of the product; through point set matching and cumulative deviation calculation, the trajectory difference is converted into a measurable numerical index, overcoming the limitations of subjective judgment in traditional visual inspection; combined with the fourth threshold based on historical qualified sample statistical calibration, objective and repeatable automatic discrimination is realized. Overall, the embodiment not only can detect obvious fractures or deviations, but also can identify small but cumulative trajectory distortions, which is significantly better than the qualitative observation mode of traditional methods, and has stronger anti-interference ability, higher detection consistency and explainability in complex industrial scenes, and truly realizes the technical upgrade from experience-based quality inspection to data-driven intelligent detection.

[0095] Step 5, for the complete bone piece groove trajectory that passes the inspection, identifying the actual bottom plate card hole position corresponding to the top plate card hole position in the bottom plate area, determining the distance between the actual bottom plate card hole position and the end of the complete bone piece groove trajectory, and determining the detection result of the lantern based on the distance.

[0096] Step 51, based on the symmetry of the lantern, defining the mapping relationship between the top plate card hole position and the bottom plate card hole position.

[0097] Since most lanterns are designed with rotational symmetry (e.g. hexagonal, octagonal or circular structure), the top and bottom plate's bayonet holes are distributed in a one-to-one corresponding and axially aligned pattern. First, the top plate's bayonet hole array is extracted in Step 2, and the angular position of each top plate's bayonet hole in the normalized unfolded map is obtained (the polar angle of each bayonet hole is calculated with the center of the top plate as the origin). Assuming the lantern has N bones, the theoretical angular interval between adjacent bayonet holes is 360° / N. For example, for an octagonal lantern (N = 8), the bayonet holes are evenly distributed every 45°. On this basis, a mapping rule is established: for each top plate's bayonet hole, there should be a corresponding bottom plate's bayonet hole on the edge of the bottom plate directly below it, used to fix the end of the bone. This mapping relationship can be represented as a mathematical function M: θtop→ θbottom, where θtop is the polar angle of the top plate's bayonet hole, and θbottom is the polar angle of the theoretically corresponding bottom plate's bayonet hole, which is ideally equal to θtop. If the bottom plate's bayonet hole position deviates due to manufacturing bias, it is still considered to be aligned within an angular tolerance of ±2° to 3°.

[0098] Polar angle calculation by center determination is a conventional calculation method.

[0099] Step 52: In the normalized unfolded map of the lantern surface, identify the bottom plate contour and extract multiple bottom plate bayonet hole positions evenly distributed in the circumferential direction to form a bottom plate bayonet hole array.

[0100] The generation process of the bottom plate bayonet hole array is the same as that of the top plate bayonet hole array, and this embodiment will not be described in detail.

[0101] Step 53: Based on the mapping relationship, identify the actual bottom plate bayonet hole position corresponding to the top plate bayonet hole position in the bottom plate contour.

[0102] According to the rotational symmetry of the lantern, each bottom plate bayonet hole should be located on the edge of the bottom plate in the same or approximately polar angle direction as its corresponding top plate bayonet hole.

[0103] In another embodiment, a ray is injected from the center of the top plate along the polar angle direction of each top plate bayonet hole (e.g. 45°, 90°, 135°, etc.) towards the bottom plate area, and a local search window (e.g. a region with a width of 10 pixels extending along the contour arc length) is set near the intersection of the ray and the bottom plate contour. Within this window, template matching or edge feature analysis methods are used to identify the actual existing bottom plate bayonet hole. If a groove with shape features is detected within the expected angular direction search range, the center point of the groove is taken as the actual bottom plate bayonet hole position corresponding to the top plate bayonet hole.

[0104] Step 54, determine the distance between the actual bottom plate socket position and the end of the complete bone piece groove track, preset a target tolerance threshold, judge whether the distance is greater than the target tolerance threshold, if yes, judge that the bone piece and the actual bottom plate socket position exist connection failure defects and output unqualified products; if not, output qualified products.

[0105] The target tolerance threshold is preset based on design specifications and production standards to ensure the consistency of product quality. For example, for this type of lantern, the design requirements specify that the ideal distance from the end of the bone piece groove track to the corresponding bottom plate socket edge should be 10 mm, and considering the normal fluctuations in the manufacturing process, the maximum allowable deviation is set as the target tolerance threshold, such as ±2 mm. This means that any actual measurement value exceeding the range of 8 to 12 mm will be considered unqualified.

[0106] Using computer vision technology or three-dimensional scanning technology, the actual position coordinates of each bottom plate socket and the coordinates of the corresponding end of the bone piece groove track are accurately obtained. Through geometric calculation (such as the Euclidean distance formula), the straight-line distance between the two points can be obtained. Compare the distance with the target tolerance threshold. If the distance exceeds the range of 8 to 12 mm, it is determined that there is a connection failure defect.

[0107] The prior art usually only judges whether there is a socket through overall contour comparison or regional gray scale analysis, and it is difficult to establish an accurate correspondence between the top plate and the bottom plate socket, especially when the socket part is obscured, deformed, or there is manufacturing deviation, which is prone to false matching or missed detection. The present scheme establishes a geometric mapping relationship between the top plate socket and the bottom plate socket, fully utilizes the inherent rotational symmetry of the lantern, and converts the detection problem from unordered search to directional positioning, greatly reducing the search range and improving the recognition efficiency and reliability. The bottom plate socket array is extracted in the standardized development diagram, ensuring the integrity and position consistency of the bottom plate contour; based on the mapping relationship, the actual bottom plate socket position is accurately identified in the theoretically corresponding area, avoiding the calculation redundancy and false matching risk brought by global traversal; by quantifying the spatial distance between the end of the bone piece groove track and the corresponding bottom plate socket and comparing it with the preset target tolerance threshold, the objective and quantifiable automatic discrimination of the connection failure defect is realized. If the distance is out of limit, it means that the bone piece is not accurately inserted or the bottom plate socket is mispositioned, and there is a risk of structural looseness. This method not only can detect obvious missing or breakage, but also can identify small but function-affected assembly deviations, overcoming the drawbacks of relying on subjective experience and lacking physical correspondence in traditional visual detection. Overall, the present scheme establishes a closed-loop logic of symmetry guidance → array extraction → mapping positioning → distance verification, realizes the technical leap from rough observation to precise verification, and has stronger anti-interference ability, higher detection accuracy and repeatability in complex industrial scenarios, effectively ensuring the structural integrity and assembly reliability of the lantern product.

[0108] The end of the complete bone piece groove track is determined by spatial correlation analysis of the end part of the complete bone piece groove track and the bottom plate bayonet position, including:

[0109] Detecting whether the end of the complete bone piece groove track is located at the bottom plate bayonet position of the bottom plate contour; if so, the actual end of the complete bone piece groove track is taken as the end of the complete bone piece groove track;

[0110] If the complete bone piece groove track is interrupted in advance outside the bottom plate contour, the end of the complete bone piece groove track is extended to the intersection with the bottom plate contour, and the intersection point is taken as the end of the complete bone piece groove track.

[0111] Linear fitting is performed on several points (such as the last 5 points) at the end of the track to obtain a local extension direction vector; a ray is extended forward from the end of the track in this direction, and the intersection with the bottom plate contour curve is obtained. The intersection point is the theoretical insertion position. For example, a certain track is interrupted at a distance of 3 mm from the edge of the bottom plate, the direction is extended after fitting, and the intersection with the bottom plate contour near the bayonet center is taken as the end of the track. This method is based on the physical assumption that the bone piece tends to extend in a straight line or a smooth curve, and restores the incomplete information caused by local loss.

[0112] If the complete bone piece groove track is bifurcated within the bottom plate bayonet contour, connected domain analysis is performed on each branch, and the end point of the longest branch is selected as the end of the complete bone piece groove track.

[0113] In the bottom plate bayonet area, if the track appears bifurcation (such as double lines in parallel or Y-shaped branch) due to material wrinkles or imaging artifacts, a connected domain analysis strategy is adopted. First, all edge pixels connected to the main path within the bottom plate bayonet contour are extracted from the track interruption point, and divided into multiple branches according to connectivity. The pixel length of each branch is calculated, and the end point of the longest branch is selected as the final end of the track. For example, a certain track splits into two near the bottom plate, with lengths of 12 pixels and 7 pixels respectively, and the end point of the 12-pixel branch is selected as the effective end. This strategy preferentially retains the main path that is most likely to continue the original direction, avoiding positioning deviation caused by misselecting short branches.

[0114] If the complete bone piece groove track is divergent or blurred, the centroid of the high response area is taken as the end of the complete bone piece groove track in combination with the brightness and edge intensity weighting of the bottom plate bayonet contour.

[0115] When the end region of the bone piece is blurred due to uneven illumination or material transparency, it is difficult to determine the exact end point by simply relying on geometric tracking. At this time, the system combines the image features of the bottom plate socket profile for weighted positioning: the gray scale gradient amplitude and brightness contrast are calculated in the socket area to generate a response heat map; the high response area (such as pixels with a gradient amplitude greater than a first threshold value) is weighted, and the centroid coordinates are calculated as the end of the complete bone piece groove track.

[0116] It is worth noting that the present embodiment strictly follows the execution order of first detecting the effective bone piece starting segment, then verifying the consistency of the complete bone piece groove track with the ideal path, and finally judging the end connection state with the bottom plate socket. This logic has an irreversible dependence in technology. If no effective bone piece starting segment that meets the gradient, length and direction requirements is found in the preset sector search area, it is determined that the structural starting point is missing and the defective product is directly output, which reflects the leading and decisive role of starting point detection. Only after confirming the effectiveness of the starting segment, step 4 is entered, based on which the complete track is extracted and the cumulative deviation of the ideal equiangular spiral path is calculated; if the deviation exceeds the fourth threshold value, it is determined that the structural track is twisted and the detection is terminated. This design ensures that only the track with continuous shape and reasonable direction enters the final connection judgment, avoiding invalid analysis of obviously abnormal paths. Finally, in step 5, only for the bone pieces that pass the previous inspection, the corresponding bottom plate socket is identified based on the mapping relationship, and the connection is judged by the spatial distance. If the order is reversed, for example, the end connection is judged first, the defective product with an incorrect starting point or a severely twisted track that accidentally approaches the socket may be misjudged as qualified, resulting in missed detection. Therefore, this progressive and risk-preceding detection process not only conforms to the physical extension rule of the bone piece from the top plate to the bottom plate, but also guarantees the accuracy and efficiency of the detection results, and the execution order cannot be changed.

[0117] The present embodiment also discloses an intelligent lantern appearance defect automatic detection system combined with image recognition, including the following modules:

[0118] Image acquisition module: used for acquiring panoramic images of the lantern through a multi-degree-of-freedom vision device, and performing splicing and geometric correction to generate a standardized lantern surface development map;

[0119] Socket recognition module: used for identifying the top plate profile in the standardized lantern surface development map, and extracting a plurality of top plate socket positions uniformly distributed in the circumferential direction of the top plate profile to form a top plate socket array;

[0120] The effective bone piece starting segment detection module is configured to construct a preset fan-shaped search area based on the extension direction of the bone piece for each roof socket position in the roof socket array, search for an effective bone piece starting segment of the bone piece groove in the preset fan-shaped search area, and determine that the starting point of the bone piece groove of the current roof socket position is missing, structural starting point missing defects exist, end the detection, and output the unqualified product if the effective bone piece starting segment of the bone piece groove cannot be searched in the preset fan-shaped search area.

[0121] The complete bone piece groove track detection module is configured to extract a complete bone piece groove track based on the effective bone piece starting segment, determine a cumulative deviation from an ideal equiangular spiral path, perform consistency verification based on the cumulative deviation, end the detection if the verification fails, determine that the bone piece has structural track distortion defects, and output the unqualified product.

[0122] The socket detection module is configured to verify the complete bone piece groove track, identify an actual bottom plate socket position corresponding to the roof socket position in the bottom plate area, determine the distance between the actual bottom plate socket position and the end of the complete bone piece groove track, and determine the detection result of the lamp shade based on the distance.

[0123] To achieve the above-mentioned embodiments, the present application further provides an electronic device. Please refer to Figure 3 , Figure 3 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 3 , the electronic device 500 includes a processor 501 and a memory 502 connected to the processor 501 in communication; the memory 502 stores computer execution instructions; the processor 501 executes the computer execution instructions stored in the memory to implement the method provided by the foregoing embodiments.

[0124] To achieve the above-mentioned embodiments, the present application further provides a computer readable storage medium, which stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the method provided by the foregoing embodiments.

[0125] To achieve the above-mentioned embodiments, the present application further provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the method provided by the foregoing embodiments.

[0126] In the descriptions of the foregoing embodiments, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and features of different embodiments or examples, unless they are mutually inconsistent.

[0127] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0128] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0129] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of executable instructions stored in a computer readable medium, which can be executed by an instruction execution system, apparatus or device, such as a computer-based system, processor- based system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions, or a combination thereof. For the purposes of this specification, a "computer readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer readable medium can specifically include the following, which are non-exhaustive list: electrical connection (electrical device), portable computer diskette (magnetic device), Random Access Memory (RAM), Read-Only Memory (ROM), Erasable Programmable Read-Only Memory (EPROM or Flash memory), optical fiber device, and portable compact disc read-only memory (CDROM). Additionally, the computer readable medium can even be paper or other suitable medium upon which the program is printed, as the program can be electronically captured, for example, by optically scanning the paper or other suitable medium, then electronically converted into a form that can be further processed by a computer based system into an electronically accessible form in computer memory.

[0130] It should be understood that portions of the present application can be realized by hardware, software, firmware or a combination thereof. In the above embodiments, a plurality of steps or methods can be realized by software or firmware stored in a memory and executed by a suitable instruction execution system. As such, if realized by hardware, as in another embodiment, any one or a combination of the following technologies known in the art can be used: discrete logic circuit having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.

[0131] Those skilled in the art can understand that all or part of the steps carried out by the above-mentioned embodiment methods can be completed by programs instructing relevant hardware, and the programs can be stored in a computer readable storage medium. When the programs are executed, one or a combination of the steps of the method embodiments is included.

[0132] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0133] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.

Claims

1. An intelligent lantern appearance defect automatic detection method combined with image recognition, characterized in that, The method comprises the following steps: Step 1, panoramic images of the lantern are acquired by a multi-degree-of-freedom vision device, and are spliced and geometrically corrected to generate a standardized lantern surface development map; Step 2, a top plate contour is identified in the standardized lantern surface development map, and a plurality of top plate socket positions uniformly distributed in the circumferential direction of the top plate contour are extracted to form a top plate socket array; Step 3, for each top plate socket position in the top plate socket array, a preset sector search region based on the extension direction of the bone piece is constructed, and an effective bone piece starting segment of the bone piece groove is searched in the preset sector search region; if the effective bone piece starting segment of the bone piece groove cannot be searched in the preset sector search region, it is determined that the starting point of the bone piece groove of the current top plate socket position is missing, and there is a structural starting point missing defect, the detection is ended, and an unqualified product is output; if the effective bone piece starting segment of the bone piece groove is searched in the preset sector search region, step 4 is performed; Step 4, based on the effective bone piece starting segment, a complete bone piece groove track is extracted, and a cumulative deviation from an ideal equiangular spiral path is determined, a consistency test is performed based on the cumulative deviation, if the test passes, step 5 is performed, if the test fails, the detection is ended, it is determined that the bone piece has a structural track distortion defect, and an unqualified product is output; Step 5, for the complete bone piece groove track that passes the test, an actual bottom plate socket position corresponding to the top plate socket position in the bottom plate region is identified, a distance between the actual bottom plate socket position and the end of the complete bone piece groove track is determined, and a detection result of the lantern is determined based on the distance.

2. The method of claim 1, wherein, The searching of the effective bone piece starting segment of the bone piece groove in the preset sector search region comprises: Step 31, the gradient of each pixel point in the preset sector search region is determined to obtain the gradient direction and the gradient amplitude; Step 32, a first threshold value is preset, a first pixel point is selected, and it is determined whether the gradient amplitude of the first pixel point is greater than the first threshold value, if yes, the first pixel point is taken as a path starting point; Step 33, a second threshold value is preset, a next pixel point is selected, and it is determined whether the gradient direction deviation between the current pixel point and the previous pixel point is less than the second threshold value and the gradient amplitude is greater than the first threshold value, if yes, the current pixel point is taken as a path node, if not, the current pixel point is removed; until all pixel points are selected and it is determined whether to be a path node or to be removed; Step 34, the path starting point and all path nodes are connected to form a gradient path, and it is determined whether the continuously connected path starting point and / or path node in the gradient path is greater than a third threshold value, if yes, the gradient path is defined as a gradient effective path; if not, the gradient path is removed; Step 35, it is determined whether the gradient direction of the path starting point or the path node of the gradient effective path deviates from the extension direction of the bone piece by less than a direction tolerance, if yes, the gradient effective path is defined as the effective bone piece starting segment.

3. The method of claim 2, wherein, The third threshold value is 3-10 pixel units, and the direction tolerance is ±5°.

4. The method of claim 2, wherein, The preset sector search region comprises: taking the top plate socket position as a starting point, and constructing a sector search range with an opening angle of ±15° along the extension direction of the bone piece.

5. The method of claim 1, wherein, Based on the effective bone fragment starting segment, a complete bone fragment groove trajectory is extracted and a cumulative deviation from an ideal equiangular spiral path is determined, a consistency test is performed based on the cumulative deviation, including: Step 41, starting from the end of the effective bone fragment starting segment, the complete bone fragment groove trajectory is extracted downward along the side wall to obtain a set of measured trajectory points; Step 42, an ideal equiangular spiral path is obtained using an ideal equiangular spiral path model to obtain a set of ideal trajectory points; Step 43, the cumulative deviation between the set of measured trajectory points and the set of ideal trajectory points is determined; Step 44, a fourth threshold value is preset, and it is judged whether the cumulative deviation is greater than the fourth threshold value, if yes, it represents that the test fails, it is determined that the bone fragment has a structural trajectory distortion defect and an unqualified product is output; if not, it represents that the test passes.

6. The method of claim 1, wherein, The actual bottom plate socket position corresponding to the top plate socket position in the bottom plate region is identified, the distance between the actual bottom plate socket position and the end of the complete bone fragment groove trajectory is determined, and the detection result of the lantern is determined based on the distance, including: Step 51, based on the symmetry of the lantern, a mapping relationship between the top plate socket position and the bottom plate socket position is defined; Step 52, in the standardized lantern surface development diagram, the bottom plate contour is identified, and a plurality of bottom plate socket positions uniformly distributed in the circumferential direction of the bottom plate contour are extracted to form a bottom plate socket array; Step 53, based on the mapping relationship, the actual bottom plate socket position corresponding to the top plate socket position is identified in the bottom plate contour; Step 54, the distance between the actual bottom plate socket position and the end of the complete bone fragment groove trajectory is determined, a target tolerance threshold value is preset, and it is judged whether the distance is greater than the target tolerance threshold value, if yes, it is judged that the bone fragment has a connection failure defect with the actual bottom plate socket position and an unqualified product is output; if not, a qualified product is output.

7. The method of claim 6, wherein, The end of the complete bone fragment groove trajectory is determined by spatial correlation analysis of the end part of the complete bone fragment groove trajectory and the bottom plate socket position.

8. The method of claim 7, wherein, The end of the complete bone fragment groove trajectory is determined by spatial correlation analysis of the end part of the complete bone fragment groove trajectory and the bottom plate socket position, including: It is detected whether the end point of the complete bone fragment groove trajectory is located at the bottom plate socket position of the bottom plate contour; if yes, the actual end point of the complete bone fragment groove trajectory is taken as the end of the complete bone fragment groove trajectory; if the complete bone fragment groove trajectory is interrupted outside the bottom plate contour, it is extended to the intersection with the bottom plate contour in the direction of the end of the complete bone fragment groove trajectory, and the intersection point is taken as the end of the complete bone fragment groove trajectory; if the complete bone fragment groove trajectory branches in the bottom plate socket contour, connected domain analysis is performed on each branch, and the end point of the longest branch is selected as the end of the complete bone fragment groove trajectory.

9. The method of claim 5, wherein, If the complete bone fragment groove trajectory is divergent or blurred, the centroid of the high response region is taken as the end of the complete bone fragment groove trajectory in combination with the brightness and edge strength weighting of the bottom plate socket contour.

10. The system for automatically detecting appearance defects of a smart lantern with image recognition according to any one of claims 1-9, wherein, It includes the following modules: An image acquisition module is used to acquire panoramic images of the lantern through a multi-degree-of-freedom vision device, and to perform splicing and geometric correction to generate a standardized lantern surface development diagram; A socket identification module is used to identify the top plate contour in the standardized lantern surface development diagram, and to extract a plurality of top plate socket positions uniformly distributed in the circumferential direction of the top plate contour to form a top plate socket array; An effective bone fragment starting segment detection module: for each roof socket position in the roof socket array, a preset sector search area based on the extension direction of the bone fragment is constructed, and the effective bone fragment starting segment of the bone fragment groove is searched in the preset sector search area; if the effective bone fragment starting segment of the bone fragment groove cannot be searched in the preset sector search area, it is determined that the starting point of the bone fragment groove of the current roof socket position is missing, there is a structural starting point missing defect, the detection is ended, and the unqualified product is output; A complete bone fragment groove track detection module: based on the effective bone fragment starting segment, the complete bone fragment groove track is extracted and the cumulative deviation from the ideal equiangular spiral path is determined, the consistency test is carried out based on the cumulative deviation, if the test fails, the detection is ended, it is determined that the bone fragment has a structural track distortion defect, and the unqualified product is output; A socket detection module: for testing the complete bone fragment groove track, identifying the actual bottom plate socket position corresponding to the roof socket position in the bottom plate area, determining the distance between the actual bottom plate socket position and the end of the complete bone fragment groove track, and determining the detection result of the lantern based on the distance.

Citation Information

Patent Citations

  • Novel removable receipts lantern

    CN206803023U

  • Rainproof candle lantern device

    CN216010788U

  • Portable detection device for identifying appearance defects of bridge support

    CN220894155U

  • Lantern appearance integrity detection device

    CN222636149U

  • Lantern-shaped decorative lamp and lighting device

    DE202025103245U1

Cited By

  • Quality detection method and system for microwave baking tray

    CN120891007A