A nonferrous metal forming die surface defect visual detection method

CN122901190APending Publication Date: 2026-10-13SHAANXI NORTHWEST PRECISION DIE FORGING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610937766.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-26
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

这类方式能够在一定程度上增强缺陷边缘或者抑制部分反光干扰,但在有色金属成型模具的实际检测场景中,成型表面通常具有较强反射特性,且局部加工纹理、历史抛光痕迹、油膜、脱模剂残留和粉尘附着容易与真实缺陷在图像上表现为相近的灰度突变和边界轮廓,尤其在型腔圆角、浇口邻近区、分型面和镶件边界处更容易出现疑似缺陷与反光边界、纹理边界、污染边界相互重叠的情况

Benefits of technology

1、通过按型腔圆角、浇口邻近区、分型面、镶件边界建立区域光学基准档,并在斜向光、同轴光、交叉偏振光条件下形成区域光学响应栈,再将候选缺陷链同历史纹理边界、反光位置、污染位置进行重合校验,能够在候选缺陷进入最终判定前区分表面真实缺陷、稳定加工纹理、局部反光边界和污染残留边界,从而达到降低有色金属成型模具高反光区域、纹理重合区域和污染残留区域中疑似缺陷误判的效果。2、通过按照候选缺陷态生成局部补拍条件,对候选缺陷所在区域采集局部验证图像组,并依据位置偏移、轮廓保持、亮边迁移确定缺陷验证结果,再将缺陷验证结果回写至区域光学基准档以更新反光状态、纹理掩膜、污染状态和缺陷判定边界,能够使同一检测区域的干扰状态和缺陷判定边界随验证结果持续修正,从而达到避免同一区域在下一轮检测中重复出现同类疑似缺陷误判或者高光遮蔽漏判的效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122901190A_ABST
    Figure CN122901190A_ABST
Patent Text Reader

Abstract

The application discloses a kind of non-ferrous metal forming die surface defect visual detection method, specifically related to non-ferrous metal die optical detection technical field, for solving the problem that existing non-ferrous metal forming die surface defect detection, defect is easily confused with reflection, processing texture and pollution residue, leading to misjudgment, missing judgment, and lack of local replay verification and detection boundary write-back problem.Through the region optical reference file is established by the fillet of cavity, gate adjacent area, parting surface, insert boundary, and the region optical response stack is formed under the condition of oblique light, coaxial light, cross-polarized light, then the candidate defect chain is coincided with historical texture boundary, reflection position, pollution position for verification, which can distinguish surface real defect, stable processing texture, local reflection boundary and pollution residue boundary before candidate defect enters final determination area, so as to achieve the effect of reducing the misjudgment of suspected defects in high reflection area, texture coincidence area and pollution residue area of non-ferrous metal forming die.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical inspection technology for non-ferrous metal molds, specifically a visual inspection method for surface defects in non-ferrous metal forming molds. Background Technology

[0002] During die casting, stamping, extrusion, or compression molding, non-ferrous metal forming molds are susceptible to damage from metal flow, mold closing friction, mold release agent residue, local polishing, and mold repair. This can result in scratches, indentations, pitting, melting marks, or localized residues on the surface. To prevent the mold surface condition from affecting the quality of subsequent parts, production lines typically use industrial cameras with oblique, coaxial, or polarized lighting conditions to capture images of the mold's forming surface during shutdowns for maintenance, batch changes, or post-mold repair inspections. The presence of surface defects is then assessed based on grayscale abrupt changes, edge contours, brightness variations, and texture continuity within the images.

[0003] Existing methods for detecting surface defects in molds primarily focus on improving image acquisition quality or enhancing image recognition accuracy. These methods include adjusting the light source angle, increasing exposure times, employing multi-light source fusion, introducing polarization imaging, or using image recognition models to extract suspected defect areas. While these methods can enhance defect edges or suppress some reflective interference to a certain extent, in actual inspection scenarios for non-ferrous metal forming molds, the forming surface typically exhibits strong reflective properties. Furthermore, localized processing textures, historical polishing marks, oil films, mold release agent residues, and dust adhesion can easily resemble actual defects in terms of grayscale abrupt changes and boundary contours in the image. This is especially true at cavity fillets, gate adjacency areas, parting surfaces, and insert boundaries, where suspected defects are more likely to overlap with reflective boundaries, texture boundaries, and contamination boundaries.

[0004] Therefore, the main problem with existing detection methods is that the detection process usually makes a judgment on suspected defects directly based on the currently acquired image. It lacks a regional benchmark for unified comparison between the area where the candidate defect is located and the historical texture boundary, stable reflective position and contamination residue position. It also lacks a mechanism for local re-examination and verification for different candidate defect states and for writing the verification results back to the subsequent detection boundary. This leads to the same mold area being prone to repeated misjudgments of the same suspected defects in subsequent detections, or to missed judgments due to highlight occlusion, texture overlap, and contamination residue. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a visual inspection method for surface defects in non-ferrous metal forming dies, thereby solving the problems mentioned in the background section.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a visual inspection method for surface defects in non-ferrous metal forming dies, comprising: S1. Divide the inspection area according to the cavity fillet, gate adjacent area, parting surface, and insert boundary, and establish an area optical reference file including historical texture boundary, reflection position, contamination position, and defect judgment boundary; S2. Based on the regional optical reference, acquire the first regional image group of each detection area under oblique light, coaxial light, and cross-polarized light conditions to form a regional optical response stack. S3. Extract candidate defect chains based on the regional optical response stack, and record the candidate positions, edge directions, morphological contours, gray-scale abrupt changes, and cross-optical condition offsets. S4. Verify the overlap between the candidate defect chain and the historical texture boundary, reflection position, and contamination position to determine the candidate defect state; S5. Generate local reshooting conditions according to the candidate defect state, collect local verification image groups in the area where the candidate defect is located, and determine the defect verification result based on position offset, contour preservation, and bright edge migration. S6. Write the defect verification results back to the regional optical reference file, update the reflection status, texture mask, contamination status, and defect judgment boundary, and use them to limit the next round of inspection of the same area.

[0007] Furthermore, establishing regional optical reference profiles includes: Under the condition that inspection is allowed, the mold coordinate system is established with the mold reference hole as the reference. Align the coordinates of the design drawings, the coordinates of the 3D surface, and the coordinates of the historical images to the same mold coordinate system; Remove records earlier than the most recent mold revision and areas that extend beyond the molded surface; Historical texture boundaries, reflection locations, contamination locations, and defect determination boundaries are written into the regional optical reference file.

[0008] Furthermore, forming a regional optical response stack includes: locking the version identifier, mold number, most recent mold revision version, and detection area name based on the currently effective version of the regional optical reference file; The detection area is located based on the region's contour coordinates; The first set of regional images was acquired in the order of oblique light, coaxial light, and cross-polarized light. If any effective image is missing, a regional optical response stack is not formed. After all three effective images are acquired, a regional optical response stack is formed in the order of acquisition.

[0009] Furthermore, the extraction of candidate defect chains includes: Lock the mold number, most recent mold revision version, detection area name, acquisition batch number, and regional optical reference file version identifier of the optical response stack in the locked area; The oblique light image, coaxial light image, and cross-polarized light image are cropped into the same detection area. Convert the region contour coordinates to mold coordinates; Remove traces outside the region outline and traces that touch the image cropping boundary and have incomplete outer boundaries; Suspected traces whose center location is no more than the preset merging distance are merged into candidate defect chains, and the candidate location, edge direction, morphological contour, grayscale abrupt change and cross-optical condition offset are recorded.

[0010] Furthermore, identifying candidate defective states includes: Lock the mold number, the most recent mold revision version, the name of the inspection area, the batch number of the sample collection, the candidate chain number, and the version identifier of the area's optical reference file; Using mold coordinates as the criterion for coincidence verification, candidate positions, edge directions, and shape contours are retrieved. The candidate defect chain is sequentially overlapped with the historical texture boundary, reflection position, and contamination position for verification. Based on the overlap verification results, suspected overlap states of texture, reflection, contamination, and non-overlapping are identified. Furthermore, the conditions for generating local re-enhancing images include: Lock the mold number, the most recent mold repair version, the name of the inspection area, the batch number of the data collection, the candidate chain number, the candidate defect state version, and the version identifier of the area optical reference file; Based on the candidate defect state, candidate location, edge direction, shape contour, grayscale abrupt change, and cross-optical condition offset, local reshoot conditions are formed, including the region where the candidate defect is located, the light source direction, the exposure level, the polarization component status, and the acquisition sequence.

[0011] Furthermore, the determination of defect verification results includes: Based on the local re-shooting conditions, a set of local verification images of the candidate defect area is collected; The position offset is determined based on the candidate position; The bounding shape of the local verification image group is compared with the morphological contour to determine contour preservation; Bright edge migration is determined based on the record of how the displacement direction of the bright edge relative to the candidate position changes with the direction of the light source; The defect verification results are determined based on position offset, contour preservation, and bright edge migration.

[0012] Furthermore, the write-back defect verification results include: Lock the mold number, the most recent mold repair version, the name of the inspection area, the batch number of the data collection, the candidate chain number, the version of the defect verification result, and the version identifier of the regional optical reference file; Copy the currently effective regional optical reference file to form a version to be effective; based on the defect verification results, candidate defect chains, and local verification image groups, update the reflection state, texture mask, contamination state, and defect judgment boundary.

[0013] Furthermore, a new regional optical reference file version will be generated after the effective version is updated; The next round of detection in the same area will utilize the latest effective version of the reflection status, texture mask, contamination status, and defect determination boundaries. The exclusion boundaries corresponding to reflective state, texture mask, and contamination state are used as the basis for excluding the bright migration area, stable texture boundary, and contamination influence range, respectively.

[0014] Compared with the prior art, the present invention has the following beneficial effects: 1. By establishing regional optical reference files based on cavity fillet radius, gate proximity area, parting surface, and insert boundary, and forming regional optical response stacks under oblique, coaxial, and cross-polarized light conditions, the candidate defect chain is then overlapped and verified with historical texture boundaries, reflective positions, and contamination positions. This allows for the differentiation of real surface defects, stable processing textures, local reflective boundaries, and contamination residue boundaries before candidate defects enter the final judgment, thereby reducing the misjudgment of suspected defects in highly reflective areas, texture overlap areas, and contamination residue areas of non-ferrous metal forming molds. 2. By generating local re-shooting conditions according to the candidate defect state, local verification image groups are acquired for the candidate defect area. The defect verification results are determined based on positional offset, contour preservation, and bright edge migration. The defect verification results are then written back to the regional optical reference file to update the reflective state, texture mask, contamination state, and defect judgment boundary. This allows the interference state and defect judgment boundary of the same detection area to be continuously corrected with the verification results, thereby avoiding repeated misjudgments of similar suspected defects or missed detections due to high-light occlusion in the next round of detection. Attached Figure Description

[0015] Figure 1 A schematic diagram of a visual inspection method for surface defects in non-ferrous metal forming dies; Figure 2 A schematic diagram for dividing the detection area and establishing regional optical reference files; Figure 3 A schematic diagram of the initial regional image group acquisition and the formation of the regional optical response stack; Figure 4 A schematic diagram of candidate defect chain extraction and feature recording; Figure 5 A schematic diagram for coincidence verification and candidate defect state determination; Figure 6 This diagram illustrates the generation of local reshoot conditions and the acquisition of local verification image groups. Detailed Implementation

[0016] 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, and 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.

[0017] Example: Combined with Appendix Figures 1-6 This embodiment provides a visual inspection method for surface defects in non-ferrous metal forming dies, including: S1. Divide the inspection area according to the cavity fillet, gate adjacent area, parting surface, and insert boundary, and establish an area optical reference file including historical texture boundary, reflection position, contamination position, and defect judgment boundary. The specific implementation is as follows: After the non-ferrous metal forming mold has cooled to a permissible inspection state, the inspection equipment performs area cleaning on the forming surface of the mold to be inspected and establishes an area optical reference file. The permissible inspection state is when the temperature of the forming surface, surface moisture, residual smoke, and fixed posture of the mold all meet the requirements for optical imaging. This is confirmed on-site by temperature records, cleaning confirmation records, and mold clamping confirmation records. If clamping confirmation is not completed, visible moisture is present on the forming surface, or cleaning confirmation records are missing, area cleaning is not performed. This action is completed at the mold repair station, offline optical inspection station, or batch re-inspection station. The data sources are limited to the design drawings corresponding to the mold number, 3D surface files, the most recent mold repair record, the previous round of qualified inspection images, cleaning records, and existing defect records. Cavity fillets are the arc transition parts between adjacent forming surfaces within the cavity. They are confirmed by the fillet radius markings in the design drawings, the curvature continuity parts in the 3D surface files, and the arc contours in the previous round of qualified inspection images. Temporary arc marks formed only by polishing and not recorded in the mold repair record are not classified as cavity fillets.

[0018] The gate adjacency area is the local surface covered by scouring marks, melting marks and residual boundaries after the gate enters the cavity. It is determined by the gate coordinates, the end position of the runner and the gate trimming range in the most recent mold repair record. Areas that are more than the preset adjacent distance from the gate boundary and only have processing textures that have not met the conditions for writing historical texture boundaries are not included in the gate adjacency area.

[0019] The parting surface is the molding contact area that forms a fitting relationship when the mold is closed and corresponds to the parting line of the part. It is confirmed by marking the mold closing surface, recording the flash during mold trials, and the position of the parting line in the previous round of qualified inspection images; the mounting surface that does not participate in the molding contact is not included in the parting surface.

[0020] The insert boundary is the outline of the joint where the insert and the main body of the master mold meet, as well as the molding surface adjacent to the joint. It is confirmed by the stable joint line in the insert assembly drawing, insert number, disassembly and assembly record and the previous round of qualified inspection images. The installation area on the back of the insert is not included in the insert boundary.

[0021] During area organization, first establish a mold coordinate system using mold reference holes, reference edges, or locating pin holes, with coordinate units in millimeters. Then, align the design drawing coordinates, 3D surface coordinates, and historical image coordinates to the same mold coordinate system. Next, remove records earlier than the most recent mold revision version, records with duplicate source numbers, and records where the area outline extends beyond the molding surface. Finally, only complete the area name, document number, and image batch number for areas with clear sources but missing formats. Mold number, most recent mold revision version, area outline coordinates, and area name must not be automatically completed; if any one of these is missing, the inspection area will not be written into the area optical reference file and will be moved to the pending completion stage.

[0022] Historical texture boundaries are the edges of machining marks, polishing marks, and discharge marks that exist stably in the detection area. The source is limited to the qualified inspection images and confirmation images after the most recent mold repair. When the same boundary appears in no less than two qualified image batches and the boundary position deviation does not exceed the preset coordinate deviation, it is recorded as a historical texture boundary. Boundaries that existed before cleaning but disappeared after cleaning and re-inspection are not written into historical texture boundaries.

[0023] The reflective position is the location of the bright area that appears repeatedly in the detection area under the corresponding light source direction, exposure level, and lens position in the historical qualified inspection image acquisition record. The record content includes the center of the bright area, the coverage area of ​​the bright area, and the corresponding light source record. When the same bright area appears in no less than 3 historical qualified inspection records, and the deviation of the center of the bright area does not exceed the preset coordinate deviation, it is written into the reflective position. Single bright spots caused by oil stains, water stains, or obstructions are not written into the reflective position.

[0024] The contamination location is the location where oil film, mold release agent residue, cleaning agent residue, or dust adhesion was previously recorded in the detection area. The source is limited to the residual boundary in cleaning records, downtime re-inspection remarks, and qualified inspection images. Locations that have been confirmed to have disappeared after cleaning and re-inspection are not recorded as contamination locations. Locations with cleaning records but lacking cleaning and re-inspection images are transferred to pending verification.

[0025] The defect judgment boundary is the boundary and exclusion boundary of the area within the inspection area that distinguishes surface defects, historical texture boundaries, reflective positions, and contamination positions. The priority order for forming the basis is quality release record, rework confirmation record, existing defect record, and historical qualified status record; a single manual note cannot form a defect judgment boundary on its own. The area optical reference file must record at least the mold number, the most recent mold repair version, the name of the inspection area, the area contour coordinates, the historical texture boundary, the reflective position, the contamination position, the defect judgment boundary, the data source, the version identifier, and the filing time, and write it into the local record library of the inspection equipment and synchronize it to the production line quality database; when writing, the mold number, the most recent mold repair version, and the name of the inspection area are used as the unique entry key. If the same entry key is submitted repeatedly, the existing record will be returned and the old version will not be overwritten; when the most recent mold repair version changes, a new version is created, and the old version is only retained as a chain of evidence. The chain of evidence records the source file number, image batch number, confirmation station, and entry time, but does not record personnel biometric information.

[0026] Once the regional optical reference file is completed, the next step only calls the detection region name, region contour coordinates, historical texture boundary, reflection position, contamination position, and defect judgment boundary from the currently effective version.

[0027] When discrepancies arise between the mold number on the drawing and the mold number on site, the recent mold repair record is missing, the area outline extends beyond the actual formed surface, the historical texture boundary and the defect judgment boundary conflict with each other, the reflective position lacks a corresponding light source record, or the contaminated position lacks a cleaning re-inspection basis, the corresponding inspection area will be transferred to pending verification and the reason for not being recorded will be recorded, without interrupting the filing of other inspection areas in the same batch. Preferably, in the batch re-inspection of aluminum alloy die-casting molds, the allowable deviation of the area contour coordinates is set to 0.05 mm, the gate proximity distance is set to 30 mm, the historical texture boundary comes from at least 2 qualified image batches, the reflective position comes from at least 3 historical qualified inspection records, the single mold filing submission delay does not exceed 60 seconds, the concurrent filing quantity is set to 8 detection areas, and after a failure to file, it is retried 2 times with a retry interval of 10 seconds; for example, if the rounded corner area of ​​a mold cavity has the same arc-shaped polishing texture in the 2 qualified image batches after the most recent mold repair, with a position deviation of 0.03 mm, and the same stable bright area appears in the 3 historical qualified inspection records, with a bright area center deviation of 0.04 mm and no effective contamination position, then the historical texture boundary, reflective position and defect judgment boundary of the detection area are written into the area optical reference file.

[0028] Alternatively, the detection area can be formed by combining the calibration image taken by a fixed camera with the position of the mold reference hole, without calling the three-dimensional surface file, but still maintaining the consistency of the area name, data source, version lock, and accounting caliber of the cavity fillet, gate adjacent area, parting surface, and insert boundary.

[0029] S2. Based on the regional optical reference file, the first regional image group of each detection area is acquired under oblique light, coaxial light, and cross-polarized light conditions to form a regional optical response stack. Specifically, after the inspection equipment reads the currently effective version of the regional optical reference file, it determines the acquisition range of the first regional image group according to the detection area name, regional contour coordinates, historical texture boundary, reflection position, contamination position, and defect judgment boundary recorded therein. This action is completed at the mold repair station, offline optical inspection station, or batch re-inspection station. The effective period is limited to after the regional optical reference file is established and before the candidate defect chain is extracted. The executing entity is the inspection equipment composed of an industrial camera, lens, controllable light source, polarization component, and motion positioning mechanism. The version identifier, mold number, most recent mold repair version, and detection area name of the regional optical reference file are first locked as the associated caliber of this acquisition record. If the on-site mold number, most recent mold repair version, or detection area name is inconsistent with the regional optical reference file, the detection area will not enter the acquisition queue and will be transferred to the pending verification.

[0030] Oblique lighting refers to illumination conditions where the light source's optical axis forms an angle with the normal to the formed surface of the detection area. This angle is determined by the mold coordinate system recorded by the motion positioning mechanism and the light source's installation angle. The light source number, orientation, intensity level, and positioning status are recorded on-site. During acquisition, the illuminated area covers the formed surface within the contour coordinates of the detection area; bright areas reflected from adjacent non-detection areas are not included in the image content of this detection area. Coaxial lighting refers to illumination conditions where the light source's optical axis and the camera's imaging optical axis are in the same observation direction. This is confirmed on-site through coaxial light source number, lens number, camera posture, and coaxial deviation recording. If the coaxial deviation exceeds a preset allowable value, it is not saved as a coaxial lighting image. During acquisition, the detection area contour is located within the center of the camera's field of view, and the area contour coordinates must not be misaligned due to lens offset.

[0031] Cross-polarized light is the illumination condition formed by setting the polarization direction on the illumination side and the polarization direction on the imaging side at an intersection. It is confirmed on-site by polarizer angle markings, light source numbering, and the status record of the polarization component at the lens end. If the polarization component does not reach the preset cross angle or the angle status is missing, the image will not be written into the first area image group.

[0032] The inspection equipment collects images of each inspection area in the order of oblique light, coaxial light, and cross-polarized light. One valid image is retained for each optical condition and its integrity is confirmed. Each acquisition uses the area contour coordinates as the positioning target and the historical texture boundary, reflection position, and contamination position in the area optical reference file as the field of view verification reference. The verification content is limited to confirming that the current field of view covers the same inspection area, and the defect attributes are not judged in this step.

[0033] The initial regional image set consists of three effective images of the same detection area under oblique light, coaxial light, and cross-polarized light conditions. Each image synchronously records the mold number, the most recent mold repair version, the name of the detection area, the name of the optical condition, the light source number, the camera number, the lens number, the exposure level, the polarization component status, the acquisition time, and the area contour coordinates. The image grayscale unit adopts the grayscale level acquired by the device, and the coordinate unit adopts the dual aperture of millimeters and image pixels in the regional optical reference file. Before acquisition, the motion positioning mechanism is positioned according to the regional optical reference setting. Then, the camera field of view is aligned with the regional contour coordinates. Subsequently, the light source status, exposure setting, and polarization component status are confirmed. Finally, the images are saved in a fixed order. After acquisition, only records with the following issues are removed: dark field not turned off, light source not in position, polarization component not in position, camera shake, missing regional contours, and incomplete image files. The light source not in position is defined as the light source status not reaching the set setting. Camera shake is defined as continuous positioning records exceeding the preset positioning deviation. Missing regional contours are defined as the region contour coordinates not being covered in the image. Incomplete image files are defined as missing image pixel count, file identifier, and acquisition time records. Missing optical condition images must not be automatically filled in, images of adjacent detection areas must not be used to replace the current detection area image, and historical images must not be used to replace the first regional image.

[0034] If any detection area lacks an effective image from oblique light, coaxial light, or cross-polarized light, that detection area is marked as to be acquired and recorded. Completed images are retained as ungrouped records and do not form a regional optical response stack. Other detection areas in the same batch continue to be acquired.

[0035] The regional optical response stack is a group record formed by arranging the first group of regional images of the same detection area in the order of oblique light, coaxial light, and cross-polarized light. When grouping, the original file, optical condition record, regional contour coordinates and acquisition time of each image are retained. Cross-regional merging is not performed, and the historical texture boundary, reflection position, contamination position and defect judgment boundary in the regional optical reference file are not changed. The regional optical response stack is written to the local record library of the inspection equipment with the mold number, the most recent mold repair version, the detection area name and the acquisition batch number as the entry key, and synchronized to the production line quality database. When the same entry key is submitted repeatedly, the existing group record is returned and the already effective regional optical response stack is not overwritten.

[0036] The next step only calls the currently effective regional optical response stack, the corresponding regional optical reference version identifier, and the detection area name, and does not call ungrouped records; the operator's biometric information is not written during the acquisition process, and the source number, device number, acquisition time, and recording time of the image file and optical condition record are retained as evidence chain. Preferably, in the batch re-inspection of aluminum alloy die-casting molds, the angle between the optical axis of the oblique light source and the normal of the forming surface of the detection area can be set to 45 degrees to 60 degrees, the optical axis deviation of the coaxial light can be set to no more than 2 degrees, the angle between the polarization directions of the illumination side and the imaging side of the cross-polarized light can be set to 90 degrees with an allowable deviation of 3 degrees, the acquisition of 3 effective images of a single detection area is completed within 5 seconds, the allowable deviation of the area positioning can be set to 0.05 mm, the image grayscale uses 8-bit grayscale, 8 detection areas of a single mold are allowed to be acquired sequentially, and if the acquisition of a single area fails, it will be retried twice with a retry interval of 5 seconds; for example, after calling the current effective version of the area optical reference file for a mold parting surface area, one oblique light image, one coaxial light image, and one cross-polarized light image are acquired in sequence, all three images cover the same parting surface area outline, the area positioning deviation is 0.03 mm, the acquisition time interval is less than 2 seconds, and the light source number and polarization component status are recorded completely, then the detection area forms one area optical response stack.

[0037] Alternatively, oblique light can be formed by an adjustable angle strip light source, coaxial light can be formed by a coaxial light source or a semi-transparent and semi-reflective illumination structure, and cross-polarized light can be formed by a rotatable polarization component, but the recording aperture remains consistent in acquiring the first regional image group of each detection area under oblique light, coaxial light, and cross-polarized light conditions and forming the regional optical response stack based on the regional optical reference.

[0038] S3. Extract candidate defect chains based on the regional optical response stack, and record the candidate positions, edge directions, morphological contours, grayscale abrupt changes, and cross-optical condition offsets. Specifically, after the regional optical response stack is formed, the inspection equipment organizes the oblique light images, coaxial light images, and cross-polarized light images within the same detection area and extracts candidate defect chains from them. This action is performed after the image recording at the offline optical inspection station or the batch re-inspection station is completed. The effective period is limited to after the regional optical response stack takes effect and before the candidate defect state is determined. The main body for execution is the image measurement unit of the inspection equipment. The mold number, most recent mold repair version, detection area name, acquisition batch number, and regional optical reference file version identifier of the regional optical response stack are locked first. If any field is inconsistent with the currently effective record, the detection area will not be subject to candidate defect chain extraction and will be transferred to pending verification.

[0039] The candidate defect chain is the set of corresponding records of suspected traces in the oblique light image, coaxial light image and cross-polarized light image within the same detection area. Suspected traces are defined as surface traces located within the region contour coordinates, with a coverage size that reaches the preset minimum record size, and exhibiting continuous gray-level changes, abrupt edge gray-level changes, or local contour discontinuities. Continuous gray-level changes are formed by the continuous increase or decrease of gray-level of adjacent pixels within the same trace along the same extension direction. Abrupt edge gray-level changes are formed by the gray-level difference on both sides of the trace boundary reaching the preset gray-level difference. Local contour discontinuities are formed by the interval between adjacent trace segments in the same extension direction being less than the preset discontinuity interval. During on-site extraction, the three images in the regional optical response stack are first cropped into the same detection area. Then, the image pixel positions are converted to mold coordinates based on the regional contour coordinates. Subsequently, traces outside the regional contour, traces that touch the image cropping boundary and have incomplete outer boundaries, missing blocks caused by image file corruption, and bright areas originating from reflections outside the detection area and whose center position falls outside the regional contour are removed. Finally, suspected traces located within the same detection area and whose center position distance does not exceed the preset merging distance are merged into the same candidate defect chain. Ungrouped records lacking any image with effective optical conditions are not allowed to participate in candidate defect chain extraction, and historical images are not allowed to replace the current regional optical response stack.

[0040] The candidate location is the center position and coverage area of ​​the candidate defect chain within the detection area. The recording aperture retains both mold coordinates and image pixel coordinates. The mold coordinates are in millimeters, and the image pixel coordinates are recorded using the acquisition equipment. On-site, the coverage area is determined by the outer boundary of the suspected trace, and the center of the coverage area is used as the candidate location. If the same suspected trace appears under multiple optical conditions, the candidate location is recorded by the common coverage area after merging the corresponding coverage areas in the images of each optical condition. If it appears only under one optical condition, the candidate location under that optical condition is recorded and the corresponding optical condition name is marked. The edge direction is the extension direction of the most continuous edge in the candidate defect chain within the detection area, recorded as the direction angle or direction category relative to the reference edge of the mold coordinate system. On-site, continuous boundary segments with a length reaching the preset minimum edge length are retained from each image, and their extension trends are organized according to the mold coordinate direction. When the direction difference of multiple boundary segments is within the preset angle difference, they are merged into the same edge direction. When the direction difference exceeds the preset angle difference, the main edge direction and the secondary edge direction are recorded. Isolated bright spots that do not reach the preset minimum edge length do not form an edge direction. When the boundary is truncated by the image cropping boundary and the extension trend cannot be confirmed, this field is converted to pending recording.

[0041] The morphological profile is the external boundary formed by the candidate defect chain within the detection area. It is recorded as a closed profile, an open profile, or a point profile, and the measurement results of the profile coverage area, length, and width are retained. On-site, the suspected traces are organized according to their outer perimeter boundaries. Traces with connected outer perimeter boundaries are recorded as closed profiles. Traces with unconnected outer perimeter boundaries but with a continuous extension direction are recorded as open profiles. Traces whose length and width do not reach the recording range of open profiles but whose coverage area reaches the preset minimum recording area are recorded as point profiles. When the profiles are in contact with each other but the interval between them is greater than the preset discontinuous interval, they are recorded separately. When the profiles overlap and the outer perimeter boundaries cannot be separated, they are retained as the same candidate defect chain, and the reason for the non-separation of the profiles is recorded.

[0042] The grayscale mutation is the magnitude of grayscale change on both sides of the candidate defect chain boundary in the same optical condition image. The grayscale unit is the grayscale level acquired by the device. On-site, adjacent measurement bands are set up inside and outside the candidate defect chain boundary. Saturated pixels that reach the full scale grayscale of the device and pixels below the dark field residual threshold are first removed. Then, the median grayscale of the remaining pixels in the inner and outer measurement bands are obtained as representative grayscales. The difference between the two representative grayscales is the grayscale mutation under this optical condition. If one side of the boundary falls outside the region outline, the number of remaining pixels after removal is lower than the preset effective pixel ratio, or the measurement band is continuously covered by saturated pixels, then the grayscale mutation under this optical condition is not written into the effective value and the reason for not writing is retained. The cross-optical condition offset is the displacement between candidate positions of the same candidate defect chain in oblique light, coaxial light, and cross-polarized light images, in millimeters. On-site, the candidate position centers of the same candidate defect chain in each optical condition image are compared, and the offsets between oblique light and coaxial light, coaxial light and cross-polarized light, and oblique light and cross-polarized light are recorded in the order of acquisition. If the candidate defect chain appears only under one optical condition, the cross-optical condition offset is recorded as not formed and the name of the optical condition in which it appears is retained.

[0043] The generated candidate defect chain is written to the local record library of the inspection equipment using the mold number, the most recent mold repair version, the inspection area name, the collection batch number, and the candidate chain sequence number as the entry key, and synchronized to the production line quality database. When the same entry key is submitted repeatedly, the existing record is returned and the effective candidate defect chain is not overwritten. The next step only calls the currently effective candidate defect chain and its candidate position, edge direction, shape contour, gray scale change and cross optical condition offset, and does not call the rejected traces.

[0044] Preferably, in the batch re-inspection of aluminum alloy die-casting molds, the preset minimum recording length of the candidate defect chain can be set to 0.2 mm, the preset minimum recording area can be set to 0.01 square millimeters, the preset merging distance can be set to 0.08 mm, the preset discontinuity interval can be set to 0.05 mm, the preset minimum edge length can be set to 0.15 mm, the preset angle difference can be set to 10 degrees, the measurement bandwidth of grayscale abrupt change can be set to 3 pixels, the saturation pixel threshold can be set to 250 gray levels, the dark field residual threshold can be set to 5 gray levels, the preset effective pixel ratio can be set to 50%, the allowable deviation of region contour alignment can be set to 0.05 mm, and the edge direction angle... The recording accuracy can be set to 1 degree, and the extraction delay for candidate defect chains in a single detection area can be set to no more than 10 seconds. After extraction failure, two retries are performed with a retry interval of 5 seconds. For example, in the optical response stack of a mold gate's adjacent area, a 1.6 mm long linear mark appears in the oblique light image, a 1.4 mm long linear mark appears at the corresponding position in the coaxial light image, and a 1.5 mm long linear mark still exists at the corresponding position in the cross-polarized light image. The maximum offset of the center position under the three optical conditions is 0.04 mm, thus forming a candidate defect chain. The candidate position, edge direction, shape contour, grayscale abrupt change, and offset across optical conditions are recorded. Alternatively, the candidate defect chain can be formed by the image measurement unit built into the inspection equipment, or by the production line quality calculation terminal connected to the inspection equipment, but it still uses the regional optical response stack as the source and maintains consistent recording standards for candidate position, edge direction, shape contour, grayscale abrupt change, and offset across optical conditions.

[0045] S4. Verify the overlap between the candidate defect chain and the historical texture boundary, reflection position, and contamination position to determine the candidate defect state. The specific implementation is as follows: After a candidate defect chain is formed, the inspection equipment reads the currently effective version of the regional optical reference file for the same detection area. It then performs overlap verification on the candidate defect chain with historical texture boundaries, reflection positions, and contamination positions, and determines the candidate defect status. This action is completed at the offline optical inspection station or the batch re-inspection station. The effective period is limited to after the candidate defect chain is recorded and before the local re-shooting conditions are generated. The executing entity is the image measurement unit of the inspection equipment or the production line quality calculation terminal connected to the inspection equipment. Before verification, the mold number, the most recent mold repair version, the detection area name, the acquisition batch number, the candidate chain sequence number, and the regional optical reference file version identifier are locked. If the detection area to which the candidate defect chain belongs is inconsistent with the detection area name in the regional optical reference file, or the most recent mold repair version is inconsistent, or the regional optical reference file version identifier is missing, then the candidate defect chain will not enter the overlap verification and will be transferred to pending verification.

[0046] The overlap verification uses mold coordinates as a unified standard. First, the candidate positions, edge directions, and morphological contours in the candidate defect chain are retrieved. Then, they are compared according to the recorded order of historical texture boundaries, reflection positions, and contamination positions in the regional optical reference file. Image pixel coordinates are only used as a source for backtracking and are not used as the final overlap verification standard. During the verification process, the candidate positions, edge directions, morphological contours, grayscale abrupt changes, and cross-optical condition offsets in the candidate defect chain are not changed, nor are the historical texture boundaries, reflection positions, and contamination positions in the regional optical reference file. When verifying the overlap between the candidate defect chain and the historical texture boundary, the historical texture boundary is the edge record of the processing tool marks, polishing marks, and discharge marks that have already taken effect in the regional optical reference file of the current detection area. On-site, a historical texture proximity zone is formed at a preset distance on both sides of the historical texture boundary. The outer perimeter boundary and edge direction of the candidate defect chain are compared with the historical texture proximity zone in terms of position proximity and direction consistency. When the effective boundary length of the candidate defect chain falling into the historical texture proximity zone reaches the preset texture overlap ratio, and the difference between the edge direction and the historical texture boundary direction does not exceed the preset direction difference, the historical texture boundary overlap result is recorded. When the candidate defect chain only crosses the historical texture boundary but the direction difference exceeds the preset direction difference, or the candidate position is outside the historical texture proximity zone, or the historical texture boundary lacks a source image batch, or the historical texture boundary has been excluded by the most recent model repair version, it is recorded as not overlapping with the historical texture boundary.

[0047] When verifying the overlap between the candidate defect chain and the reflective position, the reflective position is the stable, high-brightness area that has already taken effect in the regional optical reference file. On-site, the candidate position and shape contour of the candidate defect chain are compared with the bright area center and bright area coverage of the reflective position. When the candidate position falls within the coverage of the reflective position, or when the overlap area between the shape contour of the candidate defect chain and the coverage area of ​​the reflective position reaches the preset reflective coverage ratio, the reflection position overlap result is recorded. When the candidate defect chain is only close to the reflective position but does not enter the coverage of the reflective position, or when the reflective position lacks a corresponding light source record, or when the reflective position has been excluded by the most recent model revision version, it is recorded as not overlapping with the reflective position.

[0048] When verifying the overlap between candidate defect chains and contamination locations, the contamination location is defined as the location where oil film, mold release agent residue, cleaning agent residue, or dust adhesion has already taken effect in the regional optical reference file. On-site, a contamination proximity zone is formed at a preset distance on both sides of the residual boundary of the contamination location. The candidate location and morphological outline of the candidate defect chain are compared with the contamination proximity zone and the contamination impact range. When the candidate location falls within the contamination impact range, or when the overlap area between the morphological outline of the candidate defect chain and the contamination proximity zone reaches the preset contamination coverage ratio, the contamination location overlap result is recorded. Contamination locations that have been confirmed to have disappeared after cleaning and re-inspection, contamination locations lacking cleaning and re-inspection evidence, and contamination locations that have been excluded by the most recent mold revision version are not included in this overlap verification and are recorded as not overlapping with the contamination location.

[0049] If the regional optical reference file does not contain any effective historical texture boundaries, reflective locations, or contamination locations, the corresponding project record will be marked as "no valid coincident reference," and will not be automatically filled in or replaced by historical failure records. Candidate defect states are status records formed after candidate defect chains undergo coincidence verification. A state is determined as a suspected texture coincidence state when it meets the historical texture boundary coincidence result, as a suspected reflective coincidence state when it meets the reflective location coincidence result, and as a suspected contamination coincidence state when it meets the contamination location coincidence result. If the same candidate defect chain meets multiple coincidence results simultaneously, the primary candidate defect state is determined according to the order of contamination location, reflective location, and historical texture boundary, and the remaining coincidence results are retained as subordinate coincidence records. If none of the coincidence results are met, it is determined as a suspected non-coincident state.

[0050] Candidate defect states are written to the local record library of the inspection equipment and synchronized to the production line quality database using the mold number, the most recent mold repair version, the inspection area name, the collection batch number, the candidate chain number, and the candidate defect state version as the entry key. When the same entry key is submitted repeatedly, the existing record is returned and the already effective candidate defect state is not overwritten. The next step only calls the currently effective candidate defect state and the corresponding candidate defect chain, and does not call the records that have been transferred to the pending verification.

[0051] Preferably, in the batch re-inspection of aluminum alloy die-casting molds, the historical texture adjacent zone can be set to 0.06 mm, the preset texture overlap ratio can be set to 40%, the preset direction difference can be set to 12 degrees, the preset reflective coverage ratio can be set to 30%, the contamination adjacent zone can be set to 0.08 mm, the preset contamination coverage ratio can be set to 25%, the candidate defect state determination delay in a single detection area can be set to no more than 8 seconds, and after verification failure, it can be retried twice, with a retry interval of 5 seconds; for example, there is a candidate defect chain at the boundary of a mold insert, and the effective boundary length of its outer perimeter boundary falling into the historical texture adjacent zone accounts for 45% of the effective boundary length of the candidate defect chain, the edge direction difference is 6 degrees, and it does not fall into the reflective position coverage range and the contamination influence range, then the candidate defect chain is determined to be a texture overlap suspected state.

[0052] Alternatively, overlap verification can be performed locally on the inspection equipment or on the production line quality calculation terminal, but the order and recording criteria for verifying the overlap of the candidate defect chain with historical texture boundaries, reflective positions, and contamination positions to determine the candidate defect state must remain consistent. S5. Based on the conditions for generating local reshoots according to the candidate defect state, acquire a group of local verification images of the area where the candidate defect is located, and determine the defect verification result based on positional offset, contour preservation, and bright edge migration. Specifically, the implementation is as follows: After a candidate defect state is formed, the inspection equipment generates local re-shooting conditions based on the currently effective candidate defect state and the corresponding candidate defect chain. This action is completed at the offline optical inspection station or the batch re-inspection station. The effective period is limited to after the candidate defect state is recorded and before the defect verification result is formed. The executing entities are the industrial camera, lens, controllable light source, polarization component, motion positioning mechanism, and image measurement unit of the inspection equipment. Before execution, the mold number, the most recent mold repair version, the inspection area name, the acquisition batch number, the candidate chain sequence number, the candidate defect state version, and the regional optical reference file version identifier are locked. If any field is missing or the version is inconsistent, the candidate defect chain will not generate local re-shooting conditions and will be transferred to pending verification.

[0053] Local re-imaging conditions are the local area range, light source direction, exposure level, polarization component status, and acquisition sequence recorded when re-imaging the area where the candidate defect is located. These conditions are based on the candidate defect state, candidate location, edge direction, shape contour, grayscale abrupt changes, and cross-optical condition offset. Inactive candidate defect chains and invalid regional optical reference files are not invoked. When the candidate defect state is a suspected texture overlap state, the local re-imaging conditions include oblique light images with the light source projection direction parallel to the edge direction and oblique light images with the light source projection direction perpendicular to the edge direction. The light source projection direction is determined by the light source orientation recorded in the mold coordinate system. When the candidate defect state is a suspected reflection overlap state, the local reshooting conditions include an oblique light image with the light source projection direction deviating from the center line of the reflection position by a preset avoidance angle, a coaxial light image with a reduced exposure level relative to the initial regional image group, and a cross-polarized light image. When the candidate defect state is a suspected contamination overlap state, the local reshooting conditions include a cross-polarized light image and a low-angle oblique light image with an angle greater than the angle of the initial oblique light relative to the normal of the formed surface of the detection area. When the candidate defect state is a suspected non-overlap state, the local reshooting conditions include an optical condition image forming a candidate defect chain in the initial regional image group and an oblique light image with the light source projection direction offset by a preset adjacent angle relative to the optical condition. The area where the candidate defect is located is a local formed surface range surrounding the candidate position and covering the shape contour. On-site, a preset reshooting boundary is formed by expanding outward according to the shape contour. After expansion, the range must not exceed the regional contour coordinates of the detection area to which it belongs, and must not cross into the adjacent detection area. When the expanded range touches the boundary of the detection area, the boundary of the detection area is used as the local reshooting boundary, and the reason for the boundary limitation is recorded.

[0054] The inspection equipment acquires a set of local verification images of the candidate defect area based on local reshoot conditions. The local verification image set is a group of images obtained under all local reshoot conditions for the same candidate defect chain. Each image synchronously records the mold number, the most recent mold repair version, the name of the inspection area, the candidate chain number, the local reshoot condition version, the light source direction, the exposure level, the polarization component status, the acquisition time, and the coordinates of the candidate defect area. Before acquisition, the motion positioning mechanism is positioned to the candidate defect area, and then it is confirmed that the camera field of view covers the area. Then, the image is saved according to the local reshoot conditions. If the light source is not in place, the polarization component is not in place, the candidate defect area is not completely covered, or the image file is missing, the corresponding image is not written into the local verification image set. If any local reshoot condition image is missing, the candidate defect chain is transferred to acquisition pending reshoot, and the completed images are only retained as ungrouped records.

[0055] Position offset is the displacement of the center position of the candidate defect chain in the local verification image group relative to the candidate position, in millimeters. On-site, the candidate position is used as a reference. The center position of the same suspected trace is reorganized in each local verification image and compared item by item. If the center position cannot be confirmed in any local verification image, the position offset does not form an effective value and the reason for not forming is recorded.

[0056] Contour preservation refers to the recording of the shape boundary, length direction, and coverage of the candidate defect chain in the local verification image group. On-site, the shape boundary obtained by reorganizing the local verification image is compared with the shape contour of the candidate defect chain. If the proportion of the overlapping part to the coverage area of ​​the candidate defect chain shape contour reaches the preset contour preservation ratio and the difference in the main extension direction does not exceed the preset direction difference, it is recorded as contour preservation. If the preset contour preservation ratio is not reached, the difference in the main extension direction exceeds the preset direction difference, the contour disappears, or the contour spreads outside the area where the candidate defect is located, it is recorded as contour not preserved.

[0057] Bright edge migration is recorded as the change in position of the bright boundary in the local verification image group due to changes in local reshooting conditions. On-site, the position of the bright boundary is organized in each local verification image and compared with the candidate position and edge direction. When the displacement of the center of the bright boundary relative to the candidate position exceeds the preset bright edge migration distance and the displacement direction changes with the light source direction, it is recorded as bright edge migration; when the displacement of the center of the bright boundary relative to the candidate position does not exceed the preset bright edge migration distance, it is recorded as bright edge not migrated; when image saturation makes it impossible to confirm the bright boundary, it is recorded as bright edge cannot be confirmed. Defect verification results are recorded based on the results determined by position offset, contour preservation, and bright edge migration. When the position offset is within the preset position offset range, the contour is preserved, and the bright edge has not migrated, it is recorded as a valid defect result; when the position offset exceeds the preset position offset range, the contour is not preserved, or the bright edge has migrated, it is recorded as a invalid defect result; when any of the position offset, contour preservation, and bright edge migration cannot form an effective record, it is recorded as a result pending review.

[0058] The defect verification results are written to the local record library of the inspection equipment and synchronized to the production line quality database using the mold number, the most recent mold repair version, the inspection area name, the collection batch number, the candidate chain number, and the defect verification result version as the posting key. When the same posting key is submitted repeatedly, the existing record is returned and the already effective defect verification results are not overwritten. The next step only calls the currently effective defect verification results, the corresponding candidate defect chains, and the local verification image groups, and does not call records that are not grouped.

[0059] Preferably, in the batch re-inspection of aluminum alloy die-casting molds, the preset re-sampling boundary extending outward from the candidate defect area can be set to 0.5 mm, the position offset range can be set to 0.06 mm, the preset contour retention ratio can be set to 60%, the preset direction difference can be set to 12 degrees, the preset bright edge migration distance can be set to 0.08 mm, the preset avoidance angle can be set to 20 degrees, the preset adjacent angle can be set to 15 degrees, and the angle between the low-angle oblique light and the normal of the forming surface of the inspection area can be set to 60 to 75 degrees. The local area of ​​a single candidate defect chain... The image acquisition time for the verification image set can be set to within 6 seconds, and the delay in forming the defect verification result can be set to no more than 10 seconds. If acquisition fails, two retries will be made, with a retry interval of 5 seconds. For example, if a candidate defect chain in the parting surface area of ​​a mold is in a reflective overlap state, and the area where the candidate defect is located extends outward by 0.5 mm without crossing the detection area contour, and the positional offset of the same suspected mark in the local verification image set is 0.03 mm, the contour overlap ratio is 72%, the difference in the main extension direction is 5 degrees, and the bright edge migration distance is 0.02 mm, then it is recorded as a valid defect. Alternatively, local re-shooting conditions can be generated locally by the inspection equipment, or generated by the production line quality calculation terminal and then sent to the inspection equipment for execution. However, the recording criteria remain consistent: generating local re-shooting conditions according to the candidate defect state, acquiring local verification image sets for the area where the candidate defect is located, and determining the defect verification result based on positional offset, contour preservation, and bright edge migration.

[0060] S6. Write the defect verification results back to the regional optical reference file, and update the reflection status, texture mask, contamination status, and defect judgment boundary to limit the next round of inspection of the same region. The specific implementation is as follows: After the defect verification results are generated, the inspection equipment writes the currently effective defect verification results back to the regional optical reference file of the same inspection area. This action is completed at the offline optical inspection station, batch re-inspection station, or production line quality database maintenance station. The effective period is limited to after the defect verification results are recorded and before the next round of inspection in the same area is started. The executing entity is the record management unit of the inspection equipment or the production line quality calculation terminal connected to the inspection equipment. Before writing back, the mold number, the most recent mold repair version, the inspection area name, the collection batch number, the candidate chain sequence number, the defect verification result version, and the regional optical reference file version identifier are locked. If any field is missing, the version is inconsistent, or the defect verification result is a result pending review, the effective version of the regional optical reference file is not changed, only the record to be checked is written and the reason for not writing back is retained.

[0061] During the write-back process, the currently effective regional optical reference file is first copied to form a version to be effective. Then, the reflective state, texture mask, contamination state, and defect judgment boundary in the version to be effective are updated according to the defect verification results. The old version must not be overwritten and is retained as an evidence chain. The evidence chain records the defect verification result version, the local verification image group version, the candidate chain number, the write-back time, and the write-back source. The source of the defect verification result is limited to the currently effective defect verification result, the corresponding candidate defect chain, and the local verification image group. Records that are not grouped, results pending review, and failed candidate defect chains must not participate in the write-back. The write-back scope is limited to the detection area to which the candidate defect chain belongs and does not cross detection areas.

[0062] The reflective state is a state field in the regional optical reference file that records the stable bright boundary, bright edge migration direction, and corresponding optical conditions of the same detection area. On-site, it is associated and organized through bright edge migration in the defect verification results, light source direction, and candidate positions in the local verification image group. When the defect verification result is a defect invalid result, and the defect invalid result is formed by bright edge migration, the area where the candidate defect is located is written into the reflective state, and the reflective coverage range, migration direction, light source direction, acquisition batch number, and candidate chain number are recorded. If the overlap area between the existing reflective state and the current reflective coverage range in the same detection area reaches the preset overlap and merging ratio of the current reflective coverage range, the same reflective state record is updated according to the union of coverage ranges. If the preset overlap and merging ratio of the same type of state is not reached, a new reflective state record is added. The reflective state is not updated for defect valid results and records where the bright edge cannot be confirmed. The texture mask is a boundary record in the regional optical reference file that restricts the participation of historical texture boundaries in the next round of detection of the same region. On-site, the edge direction, shape contour, and contour preservation record of the candidate defect chain are merged with the historical texture boundary. When the defect verification result is a defect invalid result, the candidate defect state is a texture overlap suspected state, and the defect invalid result is formed by the failure of contour preservation, the coverage area of ​​the candidate defect chain is written into the texture mask, and the texture direction, coverage area, corresponding historical texture boundary number, acquisition batch number, and candidate chain sequence number are recorded. If the overlap area between the existing texture mask and the current coverage area reaches the preset overlap and merging ratio of the same state, the same texture mask record is updated according to the union of the coverage areas. If the preset overlap and merging ratio of the same state is not reached, a new texture mask record is added. Defect valid results are not written into the texture mask.

[0063] The contamination status is a field in the regional optical reference file that records the range of influence of oil film, mold release agent residue, cleaning agent residue, or dust adhesion. On-site, it is linked and organized by candidate defect status, polarization component status in local verification image group, and defect verification results. When the defect verification result is a defect invalidation result, the candidate defect status is a suspected contamination overlap state, and the defect invalidation result is formed by contour diffusion, contour disappearance, or positional offset exceeding the preset positional offset range, the area where the candidate defect is located is written into the contamination status, recording the contamination influence range, corresponding local re-shooting conditions, polarization component status, acquisition batch number, and candidate chain sequence number. If the overlap area between the existing contamination status and the current contamination influence range reaches the preset overlap and merging ratio of the same type of status, the same contamination status record is updated according to the union of influence ranges. If the preset overlap and merging ratio of the same type of status is not reached, a new contamination status record is added. Contamination records that have been confirmed to have disappeared after cleaning and re-inspection shall not be reactivated. The defect determination boundary is a boundary record in the regional optical reference file used to distinguish the defect-established area from the non-defect interference area during the next round of detection in the same area. When writing back the defect-established result, the defect-established boundary is updated according to the morphological contour of the candidate defect chain and the shape boundary maintained in the local verification image group, and the candidate position, morphological contour, position offset, contour preservation, bright edge migration and candidate chain number are recorded. When writing back the defect-invalid result, the corresponding exclusion boundary is updated according to the updated reflection state, texture mask or contamination state. When reflection state, texture mask and contamination state exist in the same area at the same time, the main source of the exclusion boundary is determined in the order of contamination state, reflection state and texture mask, and the records of other sources are retained. The result to be reviewed only generates the record to be reviewed, and the effective defect determination boundary is not updated.

[0064] After the updated version is completed, a new regional optical reference file will be generated. In the next round of detection of the same region, only the reflection state, texture mask, contamination state, and defect judgment boundary in the latest updated version will be used. Among them, the exclusion boundary corresponding to the reflection state will be used as the basis for excluding the bright migration region in the next round of detection of the same region, the exclusion boundary corresponding to the texture mask will be used as the basis for excluding the stable texture boundary in the next round of detection of the same region, the exclusion boundary corresponding to the contamination state will be used as the basis for excluding the contamination influence range in the next round of detection of the same region, and the defect establishment boundary will be used as the review boundary in the next round of detection of the same region. Versions that have not been updated, records pending verification, and records that are not grouped will not be used in the next round of detection of the same region.

[0065] Preferably, in the batch re-inspection of aluminum alloy die-casting molds, the bright edge migration distance for reflective states can be set to greater than 0.08 mm, the minimum writing area of ​​the texture mask can be set to 0.01 square millimeters, the minimum influence range of contamination states can be set to 0.02 square millimeters, the overlap and merging ratio of similar states can be set to 20%, the write-back delay of the regional optical reference file can be set to no more than 5 seconds, and two retries can be made after a write-back failure, with a retries interval of 5 seconds. For example, if the defect verification result of a mold parting surface area is that the defect is not valid, the candidate defect state is a suspected reflective overlap state, the bright edge migration distance is 0.12 mm, the displacement direction changes with the direction of the light source, and the overlap ratio between the current reflective coverage area and the existing reflective state is 35%, then the area where the candidate defect is located is merged into the existing reflective state, and the reflective exclusion boundary in the defect judgment boundary is updated simultaneously. Alternatively, the write-back action can be completed locally on the inspection equipment or in the production line quality database, but the defect verification results are still written back to the regional optical reference file to update the reflection status, texture mask, contamination status, defect judgment boundary, and to ensure that the recording caliber of the next round of inspection of the same area is consistent.

[0066] In the operating scenario shown in this embodiment: After completing one batch of production, an aluminum alloy die-casting mold enters the batch change and re-inspection stage. The inspection equipment is set up at the offline optical inspection station. After the mold is cooled down by shutdown, it is fixed by the clamping fixture. The on-site temperature record, cleaning confirmation record and mold clamping confirmation record all meet the requirements of the allowable inspection status.

[0067] The inspection equipment reads the design drawings, 3D surface files, the most recent mold repair record, the previous round of qualified inspection images, cleaning records, and existing defect records corresponding to the mold number. First, it establishes a mold coordinate system based on the mold positioning pin holes and reference edges. Then, it aligns the design drawing coordinates, 3D surface coordinates, and historical image coordinates to the same mold coordinate system.

[0068] The mold is divided into four inspection areas: cavity fillet, gate adjacent area, parting surface, and insert boundary. Among them, the outline coordinates of a certain parting surface area are complete. Historical records show that this area has stable polishing textures in the same direction in the two qualified image batches after the most recent mold repair, with a boundary position deviation of 0.03 mm. At the same time, the same bright area exists in three historical qualified inspection records, with a bright area center deviation of 0.04 mm. The cleaning re-inspection record does not show any effective contamination location. Based on this, the inspection equipment writes the historical texture boundary, reflection position, and defect judgment boundary of the parting surface area into the area optical reference file, and saves the current effective version with the mold number, the most recent mold repair version, and the inspection area name as the unique entry key.

[0069] Subsequently, the inspection equipment retrieved the regional contour coordinates of the parting surface area based on the optical reference file of the area, and sequentially acquired the first set of regional images under oblique light, coaxial light, and cross-polarized light conditions. The angle between the optical axis of the oblique light source and the normal of the forming surface of the detection area was set to 50 degrees, the optical axis deviation of the coaxial light was 1.5 degrees, and the angle between the polarization directions of the illumination side and the imaging side of the cross-polarized light was 90 degrees with a deviation of 2 degrees. All three images covered the same parting surface area contour, the regional positioning deviation was 0.03 mm, and the light source number, exposure level, polarization component status, and acquisition time were recorded completely, thus forming the regional optical response stack of the parting surface area.

[0070] The inspection equipment then extracts candidate defect chains based on the regional optical response stack. In the oblique light image of the parting surface area, a suspected linear mark with a length of 1.8 mm is found. In the coaxial light image, a suspected linear mark with a length of 1.6 mm appears at the corresponding position. In the cross-polarized light image, a suspected linear mark with a length of 1.7 mm still exists at the corresponding position. The maximum offset of the center position under the three optical conditions is 0.04 mm. After removing saturated pixels and pixels below the dark field residual threshold during grayscale change measurement, the number of remaining pixels in the inner and outer measurement zones both reach the preset effective pixel ratio. Based on this, the inspection equipment records the candidate position, edge direction, shape contour, grayscale change, and offset across optical conditions, and forms a candidate defect chain. Subsequently, the inspection equipment reads the current effective version of the regional optical reference file for the same parting surface area and verifies the overlap of the candidate defect chain with the historical texture boundary, reflective position, and contamination position. The effective boundary length of the candidate defect chain falling into the adjacent zone of the historical texture accounts for 18% of the effective boundary length of the candidate defect chain, which does not reach the preset texture overlap ratio. The candidate position falls within the coverage area of ​​the reflective position, and the overlap area between the shape contour and the coverage area of ​​the reflective position accounts for 36% of the coverage area of ​​the shape contour of the candidate defect chain, which reaches the preset reflective coverage ratio. There is no effective contamination position in this area, so the candidate defect chain is determined to be a suspected reflective overlap state.

[0071] The inspection equipment generates local re-image conditions based on the suspected reflective overlap state. These conditions include an oblique light image (20 degrees off-center from the line connecting the center of the reflective position), a coaxial light image with a reduced exposure level compared to the initial regional image set, and a cross-polarized light image. The equipment then expands outwards by 0.5 mm from the candidate position to form the region containing the candidate defect. The expanded region does not cross the parting line area. The inspection equipment acquires a local verification image set based on these re-image conditions. Within this set, it re-organizes the center position, outline, and highlight boundary positions of the same suspected mark. The result shows a positional offset of 0.11 mm, an outline overlap ratio of 38%, a main extension direction difference of 18 degrees, and a highlight boundary center displacement of 0.12 mm relative to the candidate position, with the displacement direction changing with the light source direction. Because the positional offset exceeds the preset offset range, the outline is not maintained, and the highlight edge migration is confirmed, the inspection equipment records the defect verification result of this candidate defect chain as "defect not confirmed."

[0072] Finally, the inspection equipment writes the defect verification result back to the regional optical reference file of the same parting surface area. First, it copies the current effective version to form the version to be effective. Then, based on the result that the defect is invalid, it updates the reflection status by the record formed by the migration of the bright edge. The area where the candidate defect is located is written into the reflection status, and the reflection coverage, migration direction, light source direction, collection batch number and candidate chain number are recorded. Since the overlapping area of ​​the current reflection coverage and the existing reflection status accounts for 35% of the current reflection coverage area, the preset overlap and merging ratio of the same type of status is reached. The inspection equipment updates the same reflection status record according to the union of the coverage area and updates the reflection exclusion boundary in the defect judgment boundary at the same time, generating a new regional optical reference file version.

[0073] When the next round of inspection of the same area is started, the inspection equipment will only call the reflection status, texture mask, contamination status and defect judgment boundary in the latest effective version. Among them, the reflection status corresponding to the exclusion boundary in this update is used as the basis for excluding the bright migration area, so as to avoid the same reflection migration area in the same parting surface area being directly judged as a defect area again.

[0074] All calculations involved in the embodiments are dimensionless numerical calculations, and the preset parameters and thresholds in the calculations are set by those skilled in the art according to the actual situation.

[0075] It should be noted that this invention can be deployed on the device itself to realize embedded applications, or it can run on a PC or other terminal with a user interface, thereby meeting various hardware environments and usage requirements.

[0076] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wireless or wired transmission; wired transmission methods include optical fiber, twisted pair, coaxial cable, etc.; wireless transmission includes infrared, microwave, etc. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center containing one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive. Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0077] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0078] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0079] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0080] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0081] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations 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. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0082] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for visually inspecting surface defects in non-ferrous metal forming dies, characterized in that, include: S1. Divide the inspection area according to the cavity fillet, gate adjacent area, parting surface, and insert boundary, and establish an area optical reference file including historical texture boundary, reflection position, contamination position, and defect judgment boundary; S2. Based on the regional optical reference, acquire the first regional image group of each detection area under oblique light, coaxial light, and cross-polarized light conditions to form a regional optical response stack. S3. Extract candidate defect chains based on the regional optical response stack, and record the candidate positions, edge directions, morphological contours, gray-scale abrupt changes, and cross-optical condition offsets. S4. Verify the overlap between the candidate defect chain and the historical texture boundary, reflection position, and contamination position to determine the candidate defect state; S5. Generate local reshooting conditions according to the candidate defect state, collect local verification image groups in the area where the candidate defect is located, and determine the defect verification result based on position offset, contour preservation, and bright edge migration. S6. Write the defect verification results back to the regional optical reference file, update the reflection status, texture mask, contamination status, and defect judgment boundary, and use them to limit the next round of inspection of the same area.

2. The visual inspection method for surface defects of non-ferrous metal forming dies according to claim 1, characterized in that, Establishing regional optical reference files includes: Under the condition that inspection is allowed, the mold coordinate system is established with the mold reference hole as the reference. Align the coordinates of the design drawings, the coordinates of the 3D surface, and the coordinates of the historical images to the same mold coordinate system; Remove records earlier than the most recent mold revision and areas that extend beyond the molded surface; Historical texture boundaries, reflection locations, contamination locations, and defect determination boundaries are written into the regional optical reference file.

3. The method for visual inspection of surface defects in non-ferrous metal forming dies according to claim 1, characterized in that, The formation of the regional optical response stack includes: Based on the currently effective regional optical reference file, lock the version identifier, mold number, most recent mold revision version, and inspection area name; The detection area is located based on the region's contour coordinates; The first set of regional images was acquired in the order of oblique light, coaxial light, and cross-polarized light. If any effective image is missing, a regional optical response stack is not formed. After all three effective images are acquired, a regional optical response stack is formed in the order of acquisition.

4. The method for visual inspection of surface defects in non-ferrous metal forming dies according to claim 1, characterized in that, Extracting candidate defect chains includes: Lock the mold number, most recent mold revision version, detection area name, acquisition batch number, and regional optical reference file version identifier of the optical response stack in the locked area; The oblique light image, coaxial light image, and cross-polarized light image are cropped into the same detection area. Convert the region contour coordinates to mold coordinates; Remove traces outside the region outline and traces that touch the image cropping boundary and have incomplete outer boundaries; Suspected traces whose center location is no more than the preset merging distance are merged into candidate defect chains, and the candidate location, edge direction, morphological contour, grayscale abrupt change and cross-optical condition offset are recorded.

5. The method for visual inspection of surface defects in non-ferrous metal forming dies according to claim 1, characterized in that, Determining candidate defect states includes: Lock the mold number, the most recent mold revision version, the name of the inspection area, the batch number of the sample collection, the candidate chain number, and the version identifier of the area's optical reference file; Using mold coordinates as the criterion for coincidence verification, candidate positions, edge directions, and shape contours are retrieved. The candidate defect chain is sequentially overlapped with the historical texture boundary, reflection position, and contamination position for verification. Based on the overlap verification results, suspected states of texture overlap, suspected states of reflection overlap, suspected states of contamination overlap, and suspected states of non-overlap are determined.

6. The method for visual inspection of surface defects in non-ferrous metal forming dies according to claim 1, characterized in that, The conditions for generating partial reshoots include: Lock the mold number, the most recent mold repair version, the name of the inspection area, the batch number of the data collection, the candidate chain number, the candidate defect state version, and the version identifier of the area optical reference file; Based on the candidate defect state, candidate location, edge direction, shape contour, grayscale abrupt change, and cross-optical condition offset, local reshoot conditions are formed, including the region where the candidate defect is located, the light source direction, the exposure level, the polarization component status, and the acquisition sequence.

7. The method for visual inspection of surface defects in non-ferrous metal forming dies according to claim 6, characterized in that, The results of defect verification include: Based on the local re-shooting conditions, a set of local verification images of the candidate defect area is collected; The position offset is determined based on the candidate position; The bounding shape of the local verification image group is compared with the morphological contour to determine contour preservation; Bright edge migration is determined based on the record of how the displacement direction of the bright edge relative to the candidate position changes with the direction of the light source; The defect verification results are determined based on position offset, contour preservation, and bright edge migration.

8. The method for visual inspection of surface defects in non-ferrous metal forming dies according to claim 1, characterized in that, The write-back defect verification results include: Lock the mold number, the most recent mold repair version, the name of the inspection area, the batch number of the data collection, the candidate chain number, the version of the defect verification result, and the version identifier of the regional optical reference file; Copy the currently effective regional optical reference file to create a version that will take effect later; Based on the defect verification results, candidate defect chains, and local verification image groups, update the reflection state, texture mask, contamination state, and defect judgment boundary.

9. The method for visual inspection of surface defects in non-ferrous metal forming dies according to claim 8, characterized in that: A new regional optical reference file version will be generated after the updated version is completed. The next round of detection in the same area will utilize the latest effective version of the reflection status, texture mask, contamination status, and defect determination boundaries. The exclusion boundaries corresponding to reflective state, texture mask, and contamination state are used as the basis for excluding the bright migration area, stable texture boundary, and contamination influence range, respectively.