Industrial vision-based precision injection product surface defect online detection method and system

By generating illumination and observation directions at different angles, extracting angular domain and surface features, and combining them with benchmark image analysis, risk areas are delineated and dynamically scanned. This solves the problems of missed detection and misjudgment in the detection of defects in complex precision injection molded products in existing technologies, and improves the accuracy and efficiency of detection.

CN122368033APending Publication Date: 2026-07-10YINGTAI PRECISION MOULD TECH (HUIZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610681111.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-18
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing industrial vision-based methods for detecting surface defects in precision injection molded products are ineffective at capturing transient visible defects in transparent, semi-transparent, glossy black, or high-gloss plastic parts, as well as products with complex structures, leading to missed detections or misjudgments.

Method used

By generating candidate acquisition angles with different lighting and observation directions, the corner domain manifestation and concealment abrupt change features and surface specular occlusion coupling features are extracted. Combined with the benchmark image, a comprehensive analysis is performed to divide low-risk and high-risk areas, and dynamic scanning is performed on the high-risk areas to acquire target images.

Benefits of technology

It improves the reliability of detecting defects in complex curved surfaces and high-gloss injection molded parts, reduces missed detections and false judgments, and achieves a balance between the accuracy and efficiency of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122368033A_ABST
    Figure CN122368033A_ABST
Patent Text Reader

Abstract

This invention discloses an online detection method and system for surface defects of precision injection molded products based on industrial vision, belonging to the field of industrial vision inspection technology. It acquires a reference image and divides the area to be detected, then generates candidate acquisition angles for different lighting and observation directions. It extracts angular domain manifestation / concealment abrupt change features and surface highlight occlusion coupling features to comprehensively obtain the difficulty result of capturing transient visible defects, and accordingly divides low-risk and high-risk areas. Low-risk areas are identified using a combination of the reference image and some candidate images, while high-risk areas are dynamically scanned and target images are acquired. Finally, the detection results of each area are fused to output the online detection result of product surface defects. This invention can proactively adjust imaging conditions for areas that are truly prone to being missed, obtaining the clearest target image of the defect, achieving a balance between detection accuracy and online detection efficiency, and reducing misjudgments caused by structural reflections.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial vision inspection technology, specifically to an online detection method and system for surface defects in precision injection molded products based on industrial vision. Background Technology

[0002] With the widespread application of precision injection molded products in automotive electronics, medical devices, and consumer electronics, product surface quality has a significant impact on assembly accuracy, reliability, and appearance consistency. Existing online surface defect detection methods based on industrial vision typically involve setting up an industrial camera and light source at the inspection station, acquiring product images at a preset fixed shooting angle, and then using image processing algorithms to identify defects such as scratches, shrinkage, whitening, cracks, and black spots.

[0003] However, for transparent, semi-transparent, glossy black, or high-gloss plastic parts, as well as precision injection molded products with complex structures such as curved surfaces, steps, holes, and snap-fits, the visibility of surface defects is often affected by the combined effects of lighting direction, viewing angle, curvature changes, high-gloss reflection, and local occlusion. Some shallow scratches, stress whitening, or micro-cracks may only appear briefly within a specific angle range. Existing technologies mostly rely on fixed shooting angles or simple multi-angle reshoots, making it difficult to determine the difficulty of capturing transient visible defects in different inspection areas. They also cannot adaptively adjust the light source, camera, or product posture for high-risk areas, easily leading to missed detection of critical defects or misjudgment of compliance, affecting the accuracy and reliability of online inspection. Summary of the Invention

[0004] The purpose of this invention is to provide an online detection method and system for surface defects of precision injection molded products based on industrial vision, so as to overcome the shortcomings of the prior art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: an online detection method for surface defects of precision injection molded products based on industrial vision, comprising: The precision injection molded product to be inspected is sent to the inspection station, a reference image is acquired at a preset fixed shooting angle, and the area to be inspected is divided according to the product structure. Candidate acquisition angles with different lighting and observation directions are generated around each area to be detected, and corresponding candidate images are acquired; Based on the baseline image and candidate images, corner domain manifestation and concealment abrupt change features are extracted to characterize the degree of change in the appearance of defects within a narrow angle range. Based on the curvature change, specular distribution and occlusion state of the area to be detected, surface specular occlusion coupling features are extracted to characterize the degree of occlusion of defects by surface reflection. By comprehensively analyzing the apparent and hidden abrupt change features of the corner domain and the coupling features of the surface specular occlusion, the result of the difficulty of capturing transient visible defects is obtained, and the area to be detected is divided into low-risk area and high-risk area according to the capture difficulty result; For low-risk areas, a baseline image is combined with some candidate images to identify defects. For high-risk areas, the light source, camera or product posture is controlled to perform dynamic scanning, and target images are acquired when the defects are enhanced. The test results from different regions are merged to output the online test results for product surface defects.

[0006] Preferably, the testing area is divided according to the product structure, including: After the precision injection molded product to be inspected enters the inspection station, a positioning pre-image is first acquired at a preset fixed shooting angle. The outer contour of the product, parting line, gate residual position and snap-fit ​​edge are extracted from the positioning pre-image as structural reference features. According to the correspondence between the structural reference features and the preset product structural template, the posture deviation state of the precision injection molded product to be inspected is determined. The acquisition area of ​​the reference image is corrected according to the posture deviation state. The reference image is acquired in the corrected acquisition area, and the structural reference features are mapped to the reference image to form the structural boundary. The curved outer wall, stepped surface, orifice edge and snap-fit ​​area are divided according to the structural boundary.

[0007] Preferably, generating candidate acquisition angles with different lighting and observation directions around each area to be detected includes: determining the area centerline, boundary extension direction, and surface orientation category based on the structural boundary of the area to be detected, using a preset fixed shooting angle as an angle reference, setting light-avoiding observation angles on both sides of the angle reference to reduce specular reflection based on the area centerline, boundary extension direction, and surface orientation category, and setting grazing illumination angles to enhance shallow textures based on the boundary extension direction, so that the light-avoiding observation angles and grazing illumination angles together form the initial candidate acquisition angles.

[0008] Preferably, the corresponding candidate images are acquired, including: At the initial candidate acquisition angle, the observation direction is kept unchanged and the illumination direction is changed sequentially to acquire candidate images used to characterize the suspected texture brightness and darkness flip state; then, the illumination direction is kept unchanged and the observation direction is changed sequentially to acquire candidate images used to characterize the suspected abnormal position retention state; each frame of candidate image is associated with the area to be detected, surface orientation category, illumination direction, observation direction and acquisition order to form a candidate image group corresponding to the area to be detected.

[0009] Preferably, the corner-domain explicit / implicit abrupt change features used to characterize the degree of change in the manifestation of defects within a narrow angular range include: Align the pixel positions of the baseline image and candidate image group of the same detection area according to the structural boundary, and extract gray-level abrupt change points, thin line edge points and local texture interruption points in the aligned image to form a set of suspected defect response points; The display status of suspected defect response points is tracked along the change order of candidate acquisition angles, and response points that appear only in a few consecutive candidate images and are weakened or disappeared in the remaining candidate images are identified as narrow-angle display points. Based on the changes in brightness, edge sharpness, and texture continuity of the narrow-angle display point, the display peak image and display attenuation image are determined, and corner domain display-hidden abrupt change features are formed accordingly.

[0010] Preferably, the surface specular occlusion coupling features used to characterize the degree of defect occlusion by surface reflections are extracted, including: Based on the structural boundary of the area to be detected, the boundary direction change is extracted along the center line of the area, and the curvature change zone is determined by combining the continuous change state of the gray-level gradient direction within the area to be detected. Within the curvature variation zone, trace the continuous bright regions in the reference image and candidate image group to determine the movement state of the highlights relative to the center line and boundary extension direction of the region, thus forming the highlight migration region; Based on the overlap between the specular migration region and the set of suspected defect response points, suspected defect response points that are covered, truncated, or weakened are identified to form a masking response region. Based on the spatial correspondence between the curvature change zone, the specular migration region, and the masking response region, a surface specular masking coupling feature is formed.

[0011] Preferably, a comprehensive analysis of the apparent-to-hidden abrupt change characteristics of the corner domain and the coupling characteristics of surface specular occlusion is performed to obtain the results of the difficulty in capturing transient visible defects, including: Narrow-angle display points, display peak images, display attenuation images, curvature change bands, specular migration regions, and occlusion response regions are uniformly mapped to the structural boundary of the same detection region to form a co-domain feature association map. Based on the same-domain feature association map, the spatial relationship between the narrow-angle display point and the curvature change zone, the temporal relationship between the display peak image and the highlight migration area leaving the occlusion response area, and the temporal relationship between the display attenuation image and the highlight migration area re-covering the occlusion response area are identified. Based on the spatial and temporal relationships, the display-hidden occlusion association state is formed, and the result of the difficulty of capturing transient visible defects is determined based on the display-hidden occlusion association state.

[0012] Preferably, the area to be detected is divided into low-risk and high-risk areas based on the capture difficulty results, and defect identification is performed, including: The capture difficulty results are compared with the preset risk judgment criteria. The areas to be detected that meet the low-risk judgment criteria are classified as low-risk areas, and the areas to be detected that meet the high-risk judgment criteria are classified as high-risk areas. For low-risk areas, based on the peak image, attenuation image and reference image, select the candidate images that differ the most from the defect display state from the candidate image group, and form a low-risk identification image group with the reference image. Consistency comparison is performed on gray-scale abrupt change points, thin-line edge points, and local texture interruption points at the same location in the low-risk identification image group, and response points with consistent positions are identified as low-risk defect responses.

[0013] Preferably, the system dynamically scans the high-risk area using controlled light sources, cameras, or product posture, and outputs online detection results for product surface defects, including: Based on the high-light migration area, occlusion response area, and narrow-angle display point corresponding to the high-risk area, determine the starting observation direction, illumination switching direction, and product posture adjustment direction for dynamic scanning; During dynamic scanning, monitor the changes in brightness, edge sharpness, and texture continuity of the narrow-angle display point. When all three are enhanced simultaneously, acquire the target image and determine the response to high-risk defects based on the target image. Low-risk and high-risk defect responses are mapped to the same product coordinate plane. Defect responses that are continuous in position, extend in the same direction, and have the same defect type between adjacent areas to be detected are fused to output online detection results of product surface defects.

[0014] This invention also provides an online inspection system for surface defects of precision injection molded products based on industrial vision, comprising: The area division module sends the precision injection molded product to be inspected into the inspection station, acquires a reference image at a preset fixed shooting angle, and divides the area to be inspected according to the product structure. The candidate image acquisition module generates candidate acquisition angles with different lighting directions and observation directions around each region to be detected, and acquires the corresponding candidate images; The feature extraction module extracts angular domain manifestation-hidden abrupt change features to characterize the degree of change in the appearance of defects within a narrow angular range, based on the baseline image and candidate images, and extracts surface specular occlusion coupling features to characterize the degree of occlusion of defects by surface reflections, based on the curvature change, specular distribution and occlusion state of the area to be detected. The risk area division module comprehensively analyzes the corner domain explicit and implicit abrupt change characteristics and the surface specular occlusion coupling characteristics to obtain the result of the difficulty of capturing transient visible defects, and divides the area to be detected into low-risk areas and high-risk areas according to the capture difficulty result. The image processing module uses a baseline image combined with some candidate images to identify defects in low-risk areas, and controls the light source, camera or product posture to perform dynamic scanning in high-risk areas, and acquires target images when the defects are enhanced. The test result output module merges the test results from each region and outputs the online test results for product surface defects.

[0015] The technical effects and advantages provided by the present invention in the above technical solution are as follows: This invention does not simply increase the number of cameras or blindly take multiple shots. Instead, after dividing the target area into regions based on the reference image, it generates candidate acquisition angles around each region that provide both light-avoiding observation and grazing illumination. It then extracts angular domain manifestation / concealment features and surface specular occlusion coupling features from both the reference and candidate images. This technique enables the determination of whether defects such as shallow scratches, stress whitening, and microcracks are only visible within a narrow angular range, and whether they are affected by surface reflection, specular migration, or local occlusion. This solves the problem of missed detection in existing technologies due to defects being covered by specular highlights, surface compression, or mismatched observation angles at fixed shooting angles, thus improving the reliability of defect capture for complex curved surfaces and high-gloss injection molded parts.

[0016] This invention further divides the area to be detected into low-risk and high-risk regions based on the comprehensive analysis results of the angular domain manifestation / concealment abrupt change characteristics and the surface specular occlusion coupling characteristics, and employs different processing methods for each. Low-risk regions are identified using only a reference image combined with a subset of candidate images, while high-risk regions are dynamically scanned by controlling the light source, camera, or product orientation, and target images are acquired when defects become more apparent. Therefore, this invention avoids the increased cycle time caused by full-angle scanning of all regions, while proactively adjusting imaging conditions for areas that are truly prone to missed detection, obtaining the clearest target image of the defect, achieving a balance between detection accuracy and online detection efficiency, and reducing misjudgments caused by structural reflections. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0018] Figure 1 This is a flowchart of the online detection method for surface defects of precision injection molded products based on industrial vision, according to the present invention.

[0019] Figure 2 This is a flowchart of the online detection system for surface defects of precision injection molded products based on industrial vision, according to the present invention.

[0020] Figure 3 This is a flowchart of the corner domain explicit and implicit mutation feature extraction method of the present invention.

[0021] Figure 4This is a flowchart of the surface specular occlusion coupling feature extraction method of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] Example 1, please refer to Figure 1 As shown in this embodiment, the online detection method for surface defects of precision injection molded products based on industrial vision includes: The precision injection molded product to be inspected is sent to the inspection station, a reference image is acquired at a preset fixed shooting angle, and the inspection area is divided according to the product structure.

[0024] In one embodiment, after the precision injection molded product to be inspected is fed into the inspection station via a conveyor line, turntable or mechanical clamping device, the product bearing surface and the optical axis of the industrial camera maintain a preset relative position, and the industrial camera first acquires a positioning pre-image at a preset fixed shooting angle.

[0025] In other words, the pre-positioning image is not directly used for final defect identification, but is first used to confirm the actual placement of the product in the inspection station. After the pre-positioning image is acquired, it is converted to grayscale. The grayscale value is obtained by multiplying the red channel value by 0.299, the green channel value by 0.587, and the blue channel value by 0.114 and then summing them. Subsequently, brightness normalization processing is performed to create a recognizable grayscale difference between the product edges, parting lines, gate residue positions, and buckle edges and the background.

[0026] After grayscale conversion and brightness normalization, the grayscale changes of adjacent pixels are compared along the horizontal and vertical directions of the image. Continuous pixels whose grayscale changes reach the preset edge detection value are identified as candidate edge points. Connectivity analysis is then performed on these candidate edge points to filter out connected contours whose closure length, contour direction, and contour position all correspond to the preset product structure template, thus obtaining the product's outer contour. This process ensures the accurate positioning of the main product element, preventing subsequent reference image acquisition areas from deviating from the actual product location.

[0027] After the product's outer contour is determined, a parting line search zone is established at a preset distance along the inner side of the product's outer contour, and continuous linear grayscale abrupt change regions are extracted within the parting line search zone. Linear regions whose length, direction, and position correspond to the parting line records in the preset product structure template are defined as parting lines. Within the preset gate area, brightness abrupt change points or texture abrupt change points are extracted, and the geometric center of the abrupt change points is determined as the gate residual position.

[0028] Within the pre-defined snap-fit ​​area, edge segments with angled changes are extracted, and the vertices of the angles and their adjacent straight edges are defined as snap-fit ​​edges. Thus, the product's outer contour, parting line, gate residue location, and snap-fit ​​edges together constitute the structural reference features.

[0029] The preset product structure template records the standard product outline, standard parting line, standard gate residual position, and standard buckle edge in the template coordinate system.

[0030] During the matching process, the residual location of the gate is selected as the first corresponding point, the vertex of the snap-fit ​​edge corner is selected as the second corresponding point, and the two ends of the parting line are selected as the third and fourth corresponding points. Then, the coordinates of the four corresponding points in the pre-positioning image are compared with the four standard corresponding points in the preset product structure template. The lateral offset is obtained by averaging the differences in the abscissas of the four corresponding points, the longitudinal offset is obtained by averaging the differences in the ordinates of the four corresponding points, and the angular offset is obtained by the angle between the line connecting the first and second corresponding points in the pre-positioning image and the line connecting the first and second corresponding points in the preset product structure template. In this way, both the translational and rotational deviations of the product can be calculated.

[0031] After obtaining the attitude offset, the acquisition area of ​​the reference image is corrected based on the lateral, longitudinal, and angular offsets to ensure that the effective imaging range of the industrial camera covers the product's outer contour, parting line, gate residue location, and corresponding areas of the snap-fit ​​edge. After position correction, the industrial camera acquires the reference image at a preset fixed shooting angle, and the structural reference features extracted from the positioning pre-image are mapped onto the reference image according to the lateral, longitudinal, and angular offsets, forming a structural boundary consistent with the actual product's attitude. Simply put, the product is first located using the positioning pre-image, and then the located structural position is imported into the reference image to ensure that the subsequent detection area is not misaligned.

[0032] After the structural boundaries are formed, the reference image is divided into regions to be detected based on these boundaries. The arc-shaped outer wall region is defined by the boundary segment with continuously changing curvature in the outer contour of the product and its inner detection zone; the step surface region is defined by the closed regions on both sides of the parting line or height texture abrupt change line; the orifice edge region is formed by extending outward from the center of the hole in the preset product structure template after attitude offset correction; the snap-fit ​​region is enclosed by the corner vertices of the snap-fit ​​edge and adjacent edges. After the above processing, the arc-shaped outer wall, step surface, orifice edge, and snap-fit ​​region fall into independent regions to be detected, providing a consistent image basis for subsequent candidate image acquisition, corner domain explicit and implicit abrupt change feature extraction, and surface specular occlusion coupling feature extraction.

[0033] Candidate acquisition angles with different lighting and observation directions are generated around each area to be detected, and corresponding candidate images are acquired.

[0034] In one implementation, after each region to be detected has been defined by the structural boundaries in the reference image, the boundary point set of the corresponding region to be detected is first read in the coordinate system of the reference image. The boundary point set is denoted as P, and the coordinate of any boundary point in P is denoted as Pi, where Pi includes the horizontal coordinate xi and the vertical coordinate yi.

[0035] A minimum bounding rectangle is fitted to the boundary point set P to obtain the direction of the long side, the direction of the short side, and the geometric center point. The x-coordinate of the geometric center point is equal to the arithmetic mean of the x-coordinates of all boundary points, and the y-coordinate is equal to the arithmetic mean of the y-coordinates of all boundary points. The straight line passing through the geometric center point and parallel to the direction of the long side of the rectangle is determined as the region centerline, and the main extension direction of the boundary in the same direction as the region centerline is determined as the boundary extension direction. The purpose of this process is to fix the shape and orientation of each region to be detected in advance, avoiding reliance on manual experience for subsequent angle settings.

[0036] The surface orientation category is determined based on the positional relationship between the structural boundary and the product's outer contour, parting line, orifice edge, and snap-fit ​​edge in the reference image. When the area to be inspected is located inside the product's outer contour and its boundary curvature changes continuously, the surface orientation category is denoted as an arc-shaped outer wall; when the area to be inspected crosses a parting line or a height texture abrupt change line, the surface orientation category is denoted as a stepped surface; when the area to be inspected is distributed around the center of the orifice, the surface orientation category is denoted as an orifice edge; when the area to be inspected is enclosed by the apex of the snap-fit ​​edge and adjacent edges, the surface orientation category is denoted as a snap-fit ​​area. The preset fixed shooting angle is jointly represented by the angle between the camera's optical axis and the product's bearing surface, and the projection direction of the camera's optical axis onto the product's bearing surface, and serves as the angular reference for the area to be inspected.

[0037] After the angular reference is determined, initial candidate acquisition angles are set according to the region's centerline, boundary extension direction, and surface orientation category. The light-shielding observation angles are arranged along both sides of the angular reference, with their deflection directions intersecting the boundary extension direction to deflect the specular reflection band from the region's centerline. The preferred light-shielding observation angles for the curved outer wall are 8 degrees and 14 degrees deflected from the angular reference on each side; for the stepped surface, they are 6 degrees and 12 degrees deflected from the angular reference on each side; for the orifice edge, they are 10 degrees and 16 degrees deflected from the angular reference on each side; and for the snap-fit ​​area, they are 7 degrees and 13 degrees deflected from the angular reference on each side. The selection rule for the deflection direction is as follows: when the specular reflection band coincides with the region's centerline, the side that moves the band away from the region's centerline is preferred; when the specular reflection band is located on both sides of the region's centerline, both angles are retained.

[0038] The grazing illumination angle is set according to the boundary extension direction and surface orientation category.

[0039] The grazing illumination angle uses a low incident angle, and the projection direction of the light on the product bearing surface is maintained at one of 45 degrees, 90 degrees or 135 degrees between the direction of the light projection and the direction of the boundary extension. When the area to be inspected is a curved outer wall or a stepped surface, 45 degrees and 135 degrees are preferred to enhance the texture undulation of shallow scratches and slight shrinkage marks. When the area to be inspected is the edge of the orifice or the snap area, 90 degrees is preferred to enhance the shadow difference of the orifice burrs, snap fine cracks and edge whitening.

[0040] After establishing initial candidate acquisition angles, the observation direction is kept constant, and the illumination direction is sequentially changed in the order of left grazing illumination, right grazing illumination, upper grazing illumination, and lower grazing illumination, acquiring one candidate image for each illumination direction. Then, while keeping the illumination direction constant, the observation direction is sequentially changed in the order of angular reference, first light-avoidance observation angle, and second light-avoidance observation angle, acquiring one candidate image for each observation direction. The candidate images obtained during the illumination direction change stage are used to observe whether suspected textures undergo brightness reversal with the light direction, and the candidate images obtained during the observation direction change stage are used to observe whether suspected anomalies maintain consistent position with the observation direction. Real surface defects maintain consistent spatial position across multiple images and exhibit continuous edges or continuous grayscale changes under grazing illumination; structural reflections shift position or break in shape after the observation direction changes, thus providing distinguishable image evidence for subsequent extraction of angular domain visible and hidden abrupt change features.

[0041] When acquiring images according to the candidate acquisition angle sequence, each candidate image frame is accompanied by the region to be detected number, surface orientation category, illumination direction, viewing direction, acquisition order, and angular reference deflection. A one-to-one association is established between candidate images and corresponding regions to be detected, and candidate images of the same region to be detected are grouped into candidate image groups according to the acquisition order. Each frame in the candidate image group maintains the same cropping range and the same pixel coordinate reference, enabling subsequent corner domain explicit / implicit abrupt change features to directly compare the grayscale changes of the same pixel position under different illumination directions and viewing directions, and also enabling surface specular occlusion coupling features to analyze specular distribution and occlusion status based on the same structural boundary.

[0042] Please see Figure 3 and Figure 4 As shown, based on the baseline image and candidate images, corner domain manifestation-hidden abrupt change features are extracted to characterize the degree of change in the appearance of defects within a narrow angular range. Based on the curvature change, specular distribution and occlusion state of the area to be detected, surface specular occlusion coupling features are extracted to characterize the degree of occlusion of defects by surface reflection.

[0043] In one implementation, the reference image is denoted as I0, and the candidate images corresponding to the same detection area are denoted as I1 to IN in order of the candidate acquisition angle, where N is preferably 5 to 9.

[0044] First, using the structural boundary of the area to be detected as the positioning basis, pixel positions from I1 to IN are aligned. During alignment, the center point, endpoints of the center line, and endpoints of the boundary extension direction of the structural boundary are extracted in each candidate image frame and registered with the corresponding points in the reference image I0. The lateral correction is equal to the average difference of the corresponding point's abscissa, the longitudinal correction is equal to the average difference of the corresponding point's ordinate, and the angular correction is equal to the angle between the direction of the center line of the area in the candidate image and the direction of the center line of the area in the reference image. The candidate image is translated and rotated according to the lateral, longitudinal, and angular corrections to ensure that the same area to be detected has consistent pixel coordinate positions in each frame. After this processing, the same surface position can be directly compared in multiple frames without misjudgment caused by slight product offsets.

[0045] After pixel alignment, extract grayscale abrupt change points, fine-line edge points, and local texture break points from I0 to IN. Grayscale abrupt change points are extracted by calculating the absolute difference between the target pixel and the mean grayscale value of its 8 neighboring pixels. If this absolute difference is not less than 25 grayscale levels, and the standard deviation of the grayscale values ​​in the 3x3 neighborhood of the target pixel is not less than 18 grayscale levels, the target pixel is recorded as a grayscale abrupt change point. Fine-line edge points are extracted by calculating the grayscale changes of 5 consecutive pixels in the 0°, 45°, 90°, and 135° directions. If the grayscale change in one direction continuously increases, and the vertical response width does not exceed 3 pixels, the corresponding pixel is recorded as a fine-line edge point. Local texture break points are extracted by statistically analyzing the texture directions within a 15x15 pixel window around the target pixel. If the main texture direction is interrupted at the target pixel, and the interruption length is more than 4 pixels, the corresponding position is recorded as a local texture break point. Gray-scale abrupt change points, thin-line edge points, and local texture interruption points are merged to form a set of suspected defect response points.

[0046] Subsequently, the display status of suspected defect response points is tracked sequentially along the candidate acquisition angle. For any suspected defect response point, the presence of a response is checked within the same pixel position from I0 to IN and its two-pixel radius neighborhood. If the response point exists only in two or three consecutive candidate images, and in the remaining candidate images, the grayscale difference drops below 40% of the grayscale difference in the display frame, and the edge response drops below 45% of the edge response in the display frame, then the response point is identified as a narrow-angle display point. This method can eliminate persistent structural edges and reflective spots that drift with the observation direction.

[0047] The analysis focuses on the brightness variation, edge sharpness variation, and texture continuity variation of narrow-angle display points. The brightness variation value is equal to the absolute difference between the local average gray level of the narrow-angle display point in each frame and the average gray level of the neighboring background; the edge sharpness value is equal to the average gray level difference between pixels on both sides of the narrow-angle display point along the direction of maximum gray level variation; and the texture continuity value is equal to the number of consecutive pixels of the same-direction texture line segment within a 15x15 pixel window.

[0048] An image where the brightness variation, edge sharpness, and texture continuity disruption all reach their maximum values ​​simultaneously is defined as the peak image; adjacent images where all three values ​​drop to below 50% of their peak values ​​are defined as attenuated images. Based on the grayscale difference, edge response, and texture interruption changes between the peak and attenuated images, a corner-domain display-hidden abrupt change feature is formed. This feature includes the number of narrow-angle display points, the number of consecutive display frames, the position of the peak display, the position of the attenuation display, and the magnitude of the display intensity change.

[0049] When extracting the specular occlusion coupling features of curved surfaces, the boundary direction variation is first extracted along the centerline of the region based on the structural boundary of the area to be detected. The centerline of the region is divided into 20 equally spaced sampling points. At each sampling point, the direction change angle formed by three adjacent boundary points is calculated; sampling positions with a direction change angle of 5 degrees or more are recorded as curvature change positions. Then, combined with the continuous change state of the gray-level gradient direction within the region to be detected, if the gray-level gradient direction change of adjacent sampling points reaches 8 degrees or more, the sampling position is retained. The continuously retained sampling positions are connected to form a curvature change band.

[0050] Within the curvature variation zone, the position of the continuous highlight region from I0 to IN is tracked. The continuous highlight region is determined as follows: when the pixel grayscale value within the detection area reaches the average grayscale value of the area plus 1.5 times the grayscale standard deviation, and the connected area reaches 30 pixels or more, the connected area is recorded as a continuous highlight region. The vertical distance of each continuous highlight region relative to the region's center line, and its projected length relative to the boundary extension direction, are recorded. When the same continuous highlight region moves along one side of the region's center line in consecutive frames, and the moving distance reaches 5 pixels or more, a highlight migration region is formed.

[0051] After the specular migration region is formed, spatial overlap analysis is performed between the specular migration region and the set of suspected defective response points. If a suspected defective response point disappears during the coverage of a continuous highlight region and reappears after leaving the coverage area, the response point is recorded as a covered response point. If a thin-line edge point changes from a continuous line segment to two or more broken line segments within the specular migration region, it is recorded as a truncated response point. If the grayscale difference of a point with a sudden change in grayscale decreases to less than 50% of the original grayscale difference within the specular migration region, it is recorded as a weakened response point. The pixel regions containing the covered, truncated, and weakened response points are merged to form the occluded response region.

[0052] The curvature variation zone, specular migration region, and occlusion response region are spatially correlated. If the occlusion response region is located within the curvature variation zone and overlaps with the specular migration region, then the area to be detected forms a surface specular occlusion coupling feature. This feature includes the length of the curvature variation zone, the specular migration direction, the specular migration distance, the area of ​​the occlusion response region, the number of covered response points, the number of truncated response points, and the number of weakened response points. Through this processing, the degree to which surface reflections obscure shallow scratches, stress whitening, and microcracks can be characterized, providing a quantifiable basis for the subsequent results of capturing transient visible defects.

[0053] By comprehensively analyzing the apparent and hidden abrupt change features of the corner domain and the coupling features of the surface specular occlusion, the difficulty of capturing transient visible defects is obtained, and the area to be detected is divided into low-risk and high-risk areas based on the capture difficulty results.

[0054] In one implementation, when comprehensively analyzing the angular domain reveal-hidden abrupt change features and the surface specular occlusion coupling features, the structural boundary of the same detection region is used as a unified coordinate constraint. All previously obtained narrow-angle reveal points, reveal peak images, reveal attenuation images, curvature change bands, specular migration regions, and occlusion response regions are mapped to the same pixel coordinate plane. During mapping, using the structural boundary in the reference image as a reference, the feature points and feature regions that have already been aligned in each candidate image are directly written into the same detection region coordinate plane. If the same pixel position belongs to a narrow-angle reveal point, it is assigned a reveal-hidden label; if it belongs to a curvature change band, it is assigned a curvature label; if it belongs to a specular migration region, it is assigned a specular label; and if it belongs to an occlusion response region, it is assigned an occlusion label. After this processing, a co-domain feature association map is formed. This map is used to express the spatial overlap and temporal correspondence of features from different sources within the same detection region.

[0055] In the same-domain feature association map, the spatial relationship between narrow-angle display points and curvature change zones is first determined. The shortest pixel distance from each narrow-angle display point to the center line of the curvature change zone is calculated. If this distance does not exceed 3 pixels, the narrow-angle display point is recorded as a curvature-related display point; if the distance exceeds 3 pixels, it is recorded as a non-curvature-related display point. The rule for setting 3 pixels is: based on the actual size of a single pixel after industrial camera calibration, the actual length corresponding to 3 pixels does not exceed 1 / 2 of the minimum allowable defect width of the precision injection molded product to be inspected. This ensures that the display points entering subsequent analysis are indeed within the influence range of surface reflection, rather than ordinary texture noise.

[0056] Then, the temporal correspondence between the peak image and the attenuation image and the highlight migration region was determined.

[0057] For the same narrow-angle display point, its display intensity is read in each candidate image, and the coverage status of the highlight migration region at the same pixel position is also read. If the image with the maximum display intensity corresponds to the first or second frame after the highlight migration region leaves the occlusion response region, then this image is determined as a valid display peak image. If the image with the display intensity dropping to below 50% of the peak intensity corresponds to the first or second frame after the highlight migration region re-covers the occlusion response region, then this image is determined as a valid display attenuation image. Simply put, it's about seeing whether the defect appears after the highlight leaves and disappears after the highlight returns.

[0058] After determining the spatial and temporal relationships, a manifestation-concealment-occlusion association state is formed. The manifestation-concealment-occlusion association state includes at least the number of curvature-related manifestation points, the number of effective manifestation peak images, the number of effective manifestation attenuation images, the area of ​​the occlusion response region, the number of manifestation duration frames, and the number of specular coverage recovery frames.

[0059] The display duration frame count is the number of candidate images that continuously exist at the same narrow-angle display point, and the highlight coverage recovery frame count is the number of candidate images that the highlight migration area goes through to re-cover the narrow-angle display point.

[0060] The capture difficulty result is obtained through weighted normalization of the components. The spatial coupling component is obtained by dividing the number of curvature-related display points by the total number of narrow-angle display points; the temporal coupling component is obtained by dividing the sum of the number of effective display peak images and the number of effective display attenuation images by the total number of candidate images; the occlusion area component is obtained by dividing the occlusion response area by the area to be detected; and the narrow-angle display component is obtained by normalizing the reciprocal of the display duration frames. The preferred weights for the four components are 0.30, 0.25, 0.25, and 0.20, respectively. Each component is multiplied by its corresponding weight and then summed to obtain the transient visible defect capture difficulty result. The weight setting rule is as follows: the spatial coupling component weight is increased to 0.35 for curved outer walls and stepped surfaces; the occlusion area component weight is increased to 0.30 for hole edges and latching areas; and the remaining components are proportionally reduced while maintaining a total weight of 1.

[0061] In this embodiment, the risk assessment benchmark is preferably set to 0.55. When the capture difficulty result is less than 0.55, it indicates that the manifestation state of the suspected defect in the area to be detected is only slightly related to the highlight occlusion of the curved surface. A fixed shooting angle combined with some candidate images can meet the recognition requirements, and the corresponding area to be detected is classified as a low-risk area. When the capture difficulty result is not less than 0.55, it indicates that the suspected defect in the area to be detected is affected by narrow-angle manifestation, highlight migration, and curvature changes. Using a fixed shooting angle poses a risk of missed detection, and the corresponding area to be detected is classified as a high-risk area. This classification result directly serves as the input basis for subsequent differentiated defect identification and dynamic scanning.

[0062] For low-risk areas, a baseline image combined with some candidate images is used for defect identification. For high-risk areas, the light source, camera, or product posture is controlled for dynamic scanning, and target images are acquired when the defects are enhanced.

[0063] In one implementation, after a low-risk region is formed, a subset of candidate images for defect identification are selected from the candidate images corresponding to the low-risk region.

[0064] The reference image is denoted as I0, and the candidate images are denoted as I1 to IN according to the acquisition order. For any candidate image Ij, the brightness difference, edge difference, and texture difference values ​​between it and the reference image I0 are calculated respectively.

[0065] The brightness difference value is the average of the absolute values ​​of the grayscale differences of all corresponding pixels within the detection area; the edge difference value is the sum of the absolute values ​​of the differences in the number of grayscale abrupt change points and fine line edge points; the texture difference value is the absolute value of the difference in the number of local texture break points. The candidate image difference value Dj is obtained by multiplying the brightness difference value by 0.4, the edge difference value by 0.35, and the texture difference value by 0.25, and then adding them together.

[0066] Candidate images are sorted from highest to lowest according to Dj (discretionary frequency). The top two candidate images are selected, retaining both the peak and attenuation images. Duplicate images are retained only once. The selected candidate images, along with the baseline image, form a low-risk recognition image group. Simply put, low-risk areas are not scanned from all angles; only the images that best highlight the difference in the visibility of defects are selected for recognition.

[0067] After the low-risk identification image group is formed, consistency comparison is performed on gray-scale abrupt change points, thin line edge points, and local texture interruption points at the same pixel position.

[0068] For any response point, a neighborhood with a radius of 2 pixels is established centered on the coordinates in the reference image. Similar response points are then searched in a subset of candidate images. If the coordinate deviation of similar response points in the reference image and at least two frames of candidate images does not exceed 2 pixels, and the angle between the extension directions of the response points does not exceed 10 degrees, they are considered to have consistent positions. Gray-scale abrupt changes, thin-line edge points, and local texture interruptions that satisfy the requirement of consistent positions are merged into low-risk defect responses. Response points that do not satisfy the requirement of consistent positions are discarded as structural reflections or random noise. Through this process, low-risk areas can be stably identified without increasing the number of acquisitions.

[0069] When processing high-risk areas, the dynamic scanning path is determined based on the highlight migration area, the occlusion response area, and the narrow-angle display point. First, the movement direction of the highlight migration area in the candidate image is read, and the observation direction corresponding to when the highlight migration area leaves the occlusion response area is taken as the starting observation direction; then, the illumination direction corresponding to the display peak image is read, and this illumination direction is taken as the illumination switching direction; at the same time, the position of the narrow-angle display point relative to the center line of the area is read, and the rotation direction that can make the narrow-angle display point move away from the highlight migration area is taken as the product posture adjustment direction.

[0070] In this embodiment, the light source is preferably switched at an angle of 3 degrees each time, the camera observation direction is preferably adjusted at an angle of 2 degrees each time, and the product posture is preferably adjusted at an angle of 2 degrees each time. The rule for setting the above angles is that after a single adjustment, the displacement of the narrow angle display point in the image does not exceed 3 pixels, so as to prevent the defect response from losing its corresponding relationship in adjacent scanned images.

[0071] During dynamic scanning, scanned images are acquired sequentially according to the initial observation direction, the lighting switching direction, and the product posture adjustment direction. For each scanned image frame, the brightness variation value, edge sharpness value, and texture continuity disruption value of the narrow-angle display point are calculated. The brightness variation value is the absolute value of the difference between the local average gray level of the narrow-angle display point and the average gray level of the neighboring background; the edge sharpness value is the average gray level difference between pixels on both sides of the direction of maximum gray level variation; the texture continuity disruption value is the ratio of the length of the interrupted texture within a 15x15 pixel window to the total length of the texture in the same direction.

[0072] When the three values ​​of the current scanned image are higher than 15%, 12%, and 10% of the corresponding values ​​in the previous scanned image, respectively, and all three values ​​are simultaneously higher than the corresponding values ​​in the subsequent scanned image, the current scanned image is determined to be in a defect enhancement state, and the current image is acquired as the target image. The target image is then correlated with the narrow-angle display point, occlusion response area, and display peak position in the high-risk area for defect identification in the high-risk area. This method can stably capture shallow scratches, stress whitening, and micro-cracks that originally only appeared briefly at narrow angles.

[0073] The detection results from each region are fused to output the online detection results of product surface defects. After identifying defects in low-risk and high-risk areas, the detection results from each region are fused. Low-risk areas output low-risk defect responses, and high-risk areas output high-risk defect responses based on target image recognition. Each defect response records its corresponding detection area, pixel coordinates of the response point, area of ​​the response point set, response extension direction, defect length, defect width, grayscale change value, edge sharpness value, texture continuity disruption value, source image number, and corresponding candidate acquisition angle. In this way, each suspected defect is no longer just an isolated point in a single image, but a complete detection result with region, angle, and display status.

[0074] During fusion, the structural boundary in the reference image is first used as a unified coordinate reference, mapping all low-risk and high-risk defect responses onto the same product coordinate plane. During mapping, the origin of the structural boundary of the area to be detected is used as the coordinate origin, and the single-pixel calibration size is used as the conversion basis. The actual lateral position of a defect response point is equal to the lateral pixel coordinates of the response point minus the lateral pixel coordinates of the structural boundary origin, multiplied by the single-pixel calibration size. The actual longitudinal position of a defect response point is equal to the longitudinal pixel coordinates of the response point minus the longitudinal pixel coordinates of the structural boundary origin, multiplied by the single-pixel calibration size. For images with prior attitude offset corrections, reverse correction is also performed according to the obtained lateral, longitudinal, and angular offsets, ensuring that defect responses in different areas to be detected fall within the same actual product positional relationship.

[0075] After unifying the coordinates, the defect responses between adjacent areas to be detected are correlated and judged. If the actual distance between the endpoints of two defect responses does not exceed 0.08 mm, the angle between their extension directions does not exceed 12 degrees, and the defect types are consistent, then the two defect responses are merged into the same continuous defect. If the actual overlapping area of ​​two defect responses reaches more than 70% of the smaller area, then the defect response with higher intensity is retained, and duplicate responses are deleted. If both low-risk and high-risk defect responses appear at the same location, the target image result from the high-risk defect response is used first, and the low-risk defect response is used as an auxiliary record. This avoids splitting cross-regional cracks and also avoids counting the same reflective anomaly repeatedly.

[0076] After merging the defect responses, the size and category of each fused defect are calculated. The defect length is determined by the maximum extension distance of the fused defect response point set, the defect width is determined by the maximum distance perpendicular to the maximum extension direction, and the defect area is determined by multiplying the number of response points by the actual area of ​​a single pixel. The defect category is determined based on the defect morphology and image response state: continuous thin lines with clear edges and a length greater than 5 times the width are classified as scratches or cracks; those with localized abrupt changes in brightness and concentrated area distribution are classified as black spots, burn marks, or pits; those extending along the boundary and protruding outside the structural boundary are classified as burrs or rough edges; and those located within the curvature change zone and accompanied by a slow grayscale transition are classified as stress whitening or shrinkage marks.

[0077] Product-level inspection results are output based on product surface quality requirements. For curved outer walls, stepped surfaces, orifice edges, and snap-fit ​​areas, the corresponding defect tolerance standards are applied. If any area contains cracks, penetrating scratches, orifice burrs, or snap-fit ​​whitening, it is directly deemed unqualified. When the defect is a non-critical appearance defect, the judgment is based on the defect length, width, area, and quantity. For example, if a single shallow scratch is longer than 0.30 mm, or if the number of black spots in the same inspection area is more than 3, or if the width of the burr at the orifice edge is more than 0.05 mm, the corresponding precision injection molded product is deemed unqualified; if the above judgment standards are not met, it is deemed qualified.

[0078] Finally, the online detection results for product surface defects are output. These results include the product number, detection time, pass / fail conclusion, the area to be inspected where the defect belongs, the defect category, the actual coordinates of the defect, the defect length, the defect width, the defect area, the image of the defect source, the optimal display angle, and the corresponding target image. For non-conforming products, the detection results are sent to the rejection execution end, causing the product to be separated from the conveyor line; for conforming products, a release signal is output. Through this fusion process, the stable detection results of low-risk areas and the dynamic scanning results of high-risk areas can be unified under the same product coordinates. This reduces duplicate identification and restores true defects that cross regions, are displayed at narrow angles, or are obscured by high light, thereby improving the completeness and accuracy of the online detection results for surface defects in precision injection molded products.

[0079] Example 2, please refer to Figure 2 As shown in this embodiment, the online surface defect detection system for precision injection molded products based on industrial vision includes: The area division module sends the precision injection molded product to be inspected into the inspection station, acquires a reference image at a preset fixed shooting angle, and divides the area to be inspected according to the product structure. The candidate image acquisition module generates candidate acquisition angles with different lighting directions and viewing directions around each region to be detected, and acquires the corresponding candidate images. The feature extraction module extracts angular domain manifestation-hidden abrupt change features to characterize the degree of change in the appearance of defects within a narrow angular range, based on the baseline image and candidate images, and extracts surface specular occlusion coupling features to characterize the degree of occlusion of defects by surface reflections, based on the curvature change, specular distribution and occlusion state of the area to be detected. The risk area division module comprehensively analyzes the corner domain explicit and implicit abrupt change characteristics and the surface specular occlusion coupling characteristics to obtain the result of the difficulty of capturing transient visible defects, and divides the area to be detected into low-risk areas and high-risk areas according to the capture difficulty result. The image processing module uses a baseline image combined with some candidate images to identify defects in low-risk areas, and controls the light source, camera or product posture to perform dynamic scanning in high-risk areas, and acquires target images when the defects are enhanced. The test result output module merges the test results from each region and outputs the online test results for product surface defects.

[0080] Example 3. To verify the recognition effect of the online surface defect detection method for precision injection molded products based on industrial vision of this application on transient visible defects, a bright black vehicle camera bracket was selected as the precision injection molded product to be detected for online detection verification. This product includes an arc-shaped outer wall, a stepped surface, a hole edge, and a buckle area. The surface of the arc-shaped outer wall is a high-gloss plastic surface. The buckle area has a local corner structure, and there are chamfered structures with different depths at the hole edge. It is a precision injection molded product that is prone to mirror reflection, high-gloss shielding, and angle-dependent appearance defects.

[0081] In this example, a total of 1200 precision injection molded products to be detected were selected, among which 180 were defective products confirmed by manual microscopic review, and 1020 were qualified products. Among the 180 defective products, there were 62 shallow scratches, 43 stress whitening, 38 fine cracks, 21 slight shrinkage marks, and 16 burrs at the hole edge. Manual microscopic review was carried out using an industrial microscope with a magnification of 20 times for confirmation, and the review results were used as the basis for evaluating the detection results. As a comparative example, a fixed shooting angle detection method was used for detection. This method only collected a single-frame reference image at a preset fixed shooting angle and identified defects based on gray-scale mutation, edge response, and texture abnormality; as the method of this application, a detection was carried out using a reference image, candidate images, angular domain display and hidden mutation features, curved surface high-gloss shielding coupling features, capture difficulty results, and differential processing procedures for low-risk areas and high-risk areas.

[0082] During the detection process, the resolution of the industrial camera was 2448×2048 pixels, the calibration size of a single pixel was 0.012 mm, and the acquisition angle of the reference image was 65 degrees of the camera optical axis relative to the product bearing surface. For the arc-shaped outer wall, the light-avoiding observation angles were set to deflect 8 degrees and 14 degrees on both sides of the angle reference; for the stepped surface, the light-avoiding observation angles were set to deflect 6 degrees and 12 degrees on both sides of the angle reference; for the hole edge, the light-avoiding observation angles were set to deflect 10 degrees and 16 degrees on both sides of the angle reference; for the buckle area, the light-avoiding observation angles were set to deflect 7 degrees and 13 degrees on both sides of the angle reference. The grazing light angles were set at 45 degrees, 90 degrees, and 135 degrees, and 5 to 9 candidate images were collected for each area to be detected.

[0083] In this example, first, the reference image was divided into an arc-shaped outer wall, a stepped surface, a hole edge, and a buckle area according to the structural boundary, and then the angular domain display and hidden mutation features and the curved surface high-gloss shielding coupling features were extracted respectively. The feature extraction results of some areas are shown in Table 1 below.

[0084] Table 1 Area to be detected Number of narrow-angle display points / Curvature variation zone length / mm Specular shift distance / pixel Shielding response area area / mm² Capture difficulty results Regional division results curved outer wall 46 18.6 23 1.42 0.73 High-risk areas Step surface 28 11.4 16 0.86 0.61 High-risk areas edge of the orifice 19 6.2 18 0.52 0.58 High-risk areas Buckle area 13 4.8 9 0.21 0.47 low-risk areas flat exterior 7 2.5 4 0.08 0.32 low-risk areas As shown in Table 1, the capture difficulty scores for the curved outer wall, stepped surface, and orifice edge are all no less than 0.55, and therefore are classified as high-risk areas. The snap-fit ​​area and flat exterior surface are classified as low-risk areas due to their relatively limited specular migration distance, occlusion response area, and number of narrow-angle display points. This classification is consistent with the actual product structure, indicating that the capture difficulty score reflects the degree to which defects are affected by changes in shooting angle and specular occlusion on curved surfaces.

[0085] For low-risk areas, a baseline image combined with some candidate images is used for defect identification. For high-risk areas, the orientation of the light source, camera, or product is dynamically scanned according to the direction in which the highlight migration area leaves the occlusion response area, and the target image is acquired while the brightness change value, edge sharpness value, and texture continuity disruption value are simultaneously enhanced. The detection results of the comparison and the detection results of the method of this application are shown in Table 2 below.

[0086] Table 2 Testing items Number of defects manually checked / piece Comparative detection quantity / piece Quantity / pieces detected by this application method Comparative sample quantity of missed inspections / pieces Number of items missed in this application method / shallow scratches 62 48 60 14 2 Stress whitening 43 31 41 12 2 Micro cracks 38 27 37 11 1 slight shrinkage marks 21 15 20 6 1 Burrs at the orifice 16 14 16 2 0 total 180 135 174 45 6 As shown in Table 2, the comparative fixed-angle shooting method detected 135 defective items out of 180 items, with 45 missed, resulting in a defect detection rate of 75.0%. The method of this application detected 174 defective items out of 180 items, with 6 missed, resulting in a defect detection rate of 96.7%. Specifically, for transient visible defects such as shallow scratches, stress whitening, and microcracks, the number of missed defects by the method of this application was significantly reduced. This is because the method of this application can identify high-risk areas based on the correlation between narrow-angle display points, specular migration areas, and occlusion response areas, and perform dynamic scanning within these high-risk areas to capture defects that are occluded by specular highlights or compressed by curved surfaces under a fixed shooting angle.

[0087] Further analysis of misjudgments revealed that out of 1020 manually verified qualified products, the comparative method incorrectly classified 39 as unqualified, while the proposed method incorrectly classified 18 as unqualified. The misjudgment data is shown in Table 3 below.

[0088] Table 3 Detection methods Quantity of qualified products / pieces Quantity / piece misjudged as non-conforming False positive rate Fixed shooting angle detection method 1020 39 3.82% This application method 1020 18 1.76% As shown in Table 3, the method of this application not only improves the detection capability of transient visible defects but also reduces false positives caused by structural reflections, specular bright spots, and local shadows. This is because the method of this application does not simply increase the number of acquired images. Instead, it first uses angular domain manifestation / concealment abrupt change features to determine whether suspected defects only appear within a narrow angular range, and then uses surface specular occlusion coupling features to determine whether this manifestation state has spatial and temporal correlations with curvature change zones, specular migration regions, and occlusion response regions. For structural reflections that move with the observation direction, the method of this application can eliminate them during consistency comparison and co-domain feature correlation. For real defects with stable positions that intensify as the specular light leaves, the method of this application can retain them and output them as defect responses. Furthermore, the detection cycle time was statistically analyzed, and the results are shown in Table 4 below.

[0089] Table 4 Detection methods Average number of images captured per item / frames Average inspection time per item / s Does it meet the requirements for online testing? Fixed shooting angle detection method 1 0.42 satisfy Full-angle scanning detection method 18 2.85 Not satisfied This application method 6.4 0.96 satisfy As shown in Table 4, the average inspection time per piece using the method described in this application is 0.96 seconds. Although this is higher than the fixed-angle inspection method, it is significantly lower than the full-angle scanning inspection method, and it can meet the online inspection requirement of a production line cycle time of 1.2 seconds per piece. This result indicates that the method described in this application, by first dividing the area into low-risk and high-risk regions, then using a reference image combined with some candidate images to identify the low-risk region, and dynamically scanning the high-risk region, avoids performing full-angle scanning on all areas, thus balancing inspection accuracy and online inspection efficiency.

[0090] In summary, the data from this embodiment demonstrate that, compared to the fixed-angle shooting detection method, the method of this application can increase the defect detection rate from 75.0% to 96.7%, reduce the number of missed detections from 45 to 6, reduce the false positive rate of qualified products from 3.82% to 1.76%, and control the average detection time per piece to within 1 second. This proves that the method of this application can achieve more stable online capture and more accurate detection of transient visible defects such as shallow scratches, stress whitening, fine cracks, and slight shrinkage lines in transparent, semi-transparent, glossy black, or high-gloss plastic precision injection molded products. It has the beneficial effects of improving detection completeness, reducing the missed detection rate, reducing false positives, and meeting online cycle time requirements.

[0091] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. An online detection method for surface defects in precision injection molded products based on industrial vision, characterized in that, include: The precision injection molded product to be inspected is sent to the inspection station, a reference image is acquired at a preset fixed shooting angle, and the area to be inspected is divided according to the product structure. Candidate acquisition angles with different lighting and observation directions are generated around each area to be detected, and corresponding candidate images are acquired; Based on the baseline image and candidate images, corner domain manifestation and concealment abrupt change features are extracted to characterize the degree of change in the appearance of defects within a narrow angle range. Based on the curvature change, specular distribution and occlusion state of the area to be detected, surface specular occlusion coupling features are extracted to characterize the degree of occlusion of defects by surface reflection. By comprehensively analyzing the apparent and hidden abrupt change features of the corner domain and the coupling features of the surface specular occlusion, the result of the difficulty of capturing transient visible defects is obtained, and the area to be detected is divided into low-risk area and high-risk area according to the capture difficulty result; For low-risk areas, a baseline image is combined with some candidate images to identify defects. For high-risk areas, the light source, camera or product posture is controlled to perform dynamic scanning, and target images are acquired when the defects are enhanced. The test results from different regions are merged to output the online test results for product surface defects.

2. The online detection method for surface defects of precision injection molded products based on industrial vision according to claim 1, characterized in that, The areas to be tested are divided according to the product structure, including: After the precision injection molded product to be inspected enters the inspection station, a positioning pre-image is first acquired at a preset fixed shooting angle. The outer contour of the product, parting line, gate residual position and snap-fit ​​edge are extracted from the positioning pre-image as structural reference features. According to the correspondence between the structural reference features and the preset product structural template, the posture deviation state of the precision injection molded product to be inspected is determined. The acquisition area of ​​the reference image is corrected according to the posture deviation state. The reference image is acquired in the corrected acquisition area, and the structural reference features are mapped to the reference image to form the structural boundary. The curved outer wall, stepped surface, orifice edge and snap-fit ​​area are divided according to the structural boundary.

3. The online detection method for surface defects of precision injection molded products based on industrial vision according to claim 2, characterized in that, Candidate acquisition angles with different lighting and observation directions are generated around each area to be detected. This includes: determining the center line, boundary extension direction, and surface orientation category of the area based on the structural boundary of the area to be detected, and using a preset fixed shooting angle as the angle reference. Based on the center line, boundary extension direction, and surface orientation category, light-avoiding observation angles are set on both sides of the angle reference to reduce specular reflection. Grazing illumination angles are set based on the boundary extension direction to enhance shallow textures. The light-avoiding observation angle and the grazing illumination angle together form the initial candidate acquisition angles.

4. The online detection method for surface defects of precision injection molded products based on industrial vision according to claim 3, characterized in that, Acquire corresponding candidate images, including: At the initial candidate acquisition angle, the observation direction is kept unchanged and the illumination direction is changed sequentially to acquire candidate images used to characterize the suspected texture brightness and darkness flip state; then, the illumination direction is kept unchanged and the observation direction is changed sequentially to acquire candidate images used to characterize the suspected abnormal position retention state; each frame of candidate image is associated with the area to be detected, surface orientation category, illumination direction, observation direction and acquisition order to form a candidate image group corresponding to the area to be detected.

5. The online detection method for surface defects of precision injection molded products based on industrial vision according to claim 1, characterized in that, Extracting angular domain explicit / implicit abrupt change features to characterize the degree of change in defect manifestation within a narrow angular range, including: Align the pixel positions of the baseline image and candidate image group of the same detection area according to the structural boundary, and extract gray-level abrupt change points, thin line edge points and local texture interruption points in the aligned image to form a set of suspected defect response points; The display status of suspected defect response points is tracked along the change order of candidate acquisition angles, and response points that appear only in a few consecutive candidate images and are weakened or disappeared in the remaining candidate images are identified as narrow-angle display points. Based on the changes in brightness, edge sharpness, and texture continuity of the narrow-angle display point, the display peak image and display attenuation image are determined, and corner domain display-hidden abrupt change features are formed accordingly.

6. The online detection method for surface defects of precision injection molded products based on industrial vision according to claim 1, characterized in that, Extract surface specular occlusion coupling features to characterize the degree of defect occlusion by surface reflections, including: Based on the structural boundary of the area to be detected, the boundary direction change is extracted along the center line of the area, and the curvature change zone is determined by combining the continuous change state of the gray-level gradient direction within the area to be detected. Within the curvature variation zone, trace the continuous bright regions in the reference image and candidate image group to determine the movement state of the highlights relative to the center line and boundary extension direction of the region, thus forming the highlight migration region; Based on the overlap between the specular migration region and the set of suspected defect response points, suspected defect response points that are covered, truncated, or weakened are identified to form a masking response region. Based on the spatial correspondence between the curvature change zone, the specular migration region, and the masking response region, a surface specular masking coupling feature is formed.

7. The online detection method for surface defects of precision injection molded products based on industrial vision according to claim 6, characterized in that, A comprehensive analysis of the apparent-to-hidden abrupt change characteristics in the corner domain and the coupling characteristics of surface specular occlusion yields results on the difficulty of capturing transient visible defects, including: Narrow-angle display points, display peak images, display attenuation images, curvature change bands, specular migration regions, and occlusion response regions are uniformly mapped to the structural boundary of the same detection region to form a co-domain feature association map. Based on the same-domain feature association map, the spatial relationship between the narrow-angle display point and the curvature change zone, the temporal relationship between the display peak image and the highlight migration area leaving the occlusion response area, and the temporal relationship between the display attenuation image and the highlight migration area re-covering the occlusion response area are identified. Based on the spatial and temporal relationships, the display-hidden occlusion association state is formed, and the result of the difficulty of capturing transient visible defects is determined based on the display-hidden occlusion association state.

8. The online detection method for surface defects of precision injection molded products based on industrial vision according to claim 7, characterized in that, Based on the capture difficulty results, the area to be detected is divided into low-risk and high-risk areas, and defect identification is performed, including: The capture difficulty results are compared with the preset risk judgment criteria. The areas to be detected that meet the low-risk judgment criteria are classified as low-risk areas, and the areas to be detected that meet the high-risk judgment criteria are classified as high-risk areas. For low-risk areas, based on the peak image, attenuation image and reference image, select the candidate images that differ the most from the defect display state from the candidate image group, and form a low-risk identification image group with the reference image. Consistency comparison is performed on gray-scale abrupt change points, thin-line edge points, and local texture interruption points at the same location in the low-risk identification image group, and response points with consistent positions are identified as low-risk defect responses.

9. The online detection method for surface defects of precision injection molded products based on industrial vision according to claim 8, characterized in that, Dynamically scan high-risk areas using controlled light sources, cameras, or product orientation, and output online detection results for product surface defects, including: Based on the high-light migration area, occlusion response area, and narrow-angle display point corresponding to the high-risk area, determine the starting observation direction, illumination switching direction, and product posture adjustment direction for dynamic scanning; During dynamic scanning, monitor the changes in brightness, edge sharpness, and texture continuity of the narrow-angle display point. When all three are enhanced simultaneously, acquire the target image and determine the response to high-risk defects based on the target image. Low-risk and high-risk defect responses are mapped to the same product coordinate plane. Defect responses that are continuous in position, extend in the same direction, and have the same defect type between adjacent areas to be detected are fused to output online detection results of product surface defects.

10. An online detection system for surface defects of precision injection molded products based on industrial vision, used to implement the online detection method for surface defects of precision injection molded products based on industrial vision as described in any one of claims 1-9, characterized in that, include: The area division module sends the precision injection molded product to be inspected into the inspection station, acquires a reference image at a preset fixed shooting angle, and divides the area to be inspected according to the product structure. The candidate image acquisition module generates candidate acquisition angles with different lighting directions and observation directions around each region to be detected, and acquires the corresponding candidate images; The feature extraction module extracts angular domain manifestation-hidden abrupt change features to characterize the degree of change in the appearance of defects within a narrow angular range, based on the baseline image and candidate images, and extracts surface specular occlusion coupling features to characterize the degree of occlusion of defects by surface reflections, based on the curvature change, specular distribution and occlusion state of the area to be detected. The risk area division module comprehensively analyzes the corner domain explicit and implicit abrupt change characteristics and the surface specular occlusion coupling characteristics to obtain the result of the difficulty of capturing transient visible defects, and divides the area to be detected into low-risk areas and high-risk areas according to the capture difficulty result. The image processing module uses a baseline image combined with some candidate images to identify defects in low-risk areas, and controls the light source, camera or product posture to perform dynamic scanning in high-risk areas, and acquires target images when the defects are enhanced. The test result output module merges the test results from each region and outputs the online test results for product surface defects.