A method for testing the surface flatness of hot stamping on cultural and creative design products
By constructing a complex equilibrium angular displacement field and removing the overall attitude response, the slope and height fields of the hot stamping surface are restored, solving the accuracy problem of local geometric changes in hot stamping surface inspection and achieving high-precision flatness evaluation.
Patent Information
- Application Number
- CN202611628443.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies struggle to accurately distinguish the effects of local geometric changes on overall orientation, lighting direction, and reflection amplitude in hot stamping surface inspection, resulting in insufficient accuracy and reliability in hot stamping surface flatness testing.
By obtaining the difference in the equilibrium center between the areas to be inspected and the reference hot stamping area, the original equilibrium angular displacement field is constructed and the overall rigid attitude response component is removed to restore the surface slope field and height field. The least squares plane fitting is performed using the mirror reflection geometry to obtain the surface spatial undulation.
It significantly improves the accuracy and reliability of hot stamping surface flatness detection, realizes automated judgment and batch quality control, and eliminates the subjectivity of reference surface selection.
Smart Images

Figure CN123111149A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flatness testing technology, specifically to a method for testing the flatness of hot stamping surfaces on cultural and creative design products. Background Technology
[0002] Creative cultural products typically use hot stamping to create metallic-looking text, patterns, or decorative areas on the surfaces of paper, cards, packaging, and decorative items. The surface condition of the hot-stamped area directly affects its visual effect. When the hot-stamped surface has localized bulges, depressions, wrinkles, or continuous bends, uneven reflections can easily occur under specific viewing directions. Therefore, it is necessary to inspect the flatness of the hot-stamped surface.
[0003] For automated inspection of hot stamping surfaces, an imaging device can be used to acquire reflective images of the hot stamping area. Abnormal areas can be identified based on the distribution of brightness and darkness, grayscale differences, or differences between the image to be inspected and the image of a qualified sample. When using qualified samples to create reference images, the same pattern position in the product to be inspected can be compared with the corresponding position in the qualified sample to reduce the impact of differences in the shape of the hot stamping pattern itself on the inspection results.
[0004] However, hot stamping surfaces exhibit distinct directional reflectivity. Once the positions of the imaging and lighting devices are determined, the reflection response of a location within the hot stamping area in the image depends not only on the surface orientation at that location but also on factors such as the overall product orientation, the actual lighting direction, and the reflection amplitude of the hot stamping layer. When the product is tilted, even if the hot stamping surface itself does not have local unevenness, the reflection state of the entire hot stamping area will change; changes in the reflection amplitude of the hot stamping material or imaging conditions may also cause changes in image brightness. Therefore, for detection methods that directly evaluate the state of the hot stamping surface using reflectivity or image differences, changes in brightness in the image cannot uniquely correspond to local geometric changes on the hot stamping surface.
[0005] Therefore, under the combined influence of the overall product placement posture, lighting direction, and the reflection amplitude of the hot stamping layer, how to obtain geometric information that can reflect the actual spatial undulations of the hot stamping surface in order to improve the accuracy and reliability of the flatness detection of the hot stamping surface of cultural and creative design products has become an urgent technical problem to be solved. Summary of the Invention
[0006] To address the aforementioned problems, this invention provides a method for detecting the surface flatness of hot stamping on cultural and creative design products. The specific technical solution adopted is as follows: One embodiment of the present invention provides a method for detecting the surface flatness of hot stamping on cultural and creative design products, comprising the following steps: Obtain the reference balance center of each reference spatial position in each reference hot stamping area on the qualified hot stamping reference sample; Obtain the cultural and creative design product to be inspected and each hot stamping area on the product to be inspected. Obtain the center of gravity for each spatial position of the product to be inspected in the same way as obtaining the reference center of gravity. For each hot stamping area to be inspected, the difference between the center of gravity for each spatial position and the corresponding reference center of gravity is used to obtain the original angular displacement of each spatial position to be inspected, and an original angular displacement field is formed. Separate and remove the overall rigid attitude response component from the original angular displacement field to obtain the local residual angular displacement field. Based on the geometric relationship of mirror reflection, the slope field of the hot stamping area to be inspected is recovered from the local equilibrium residual angular displacement field, and the height field of the surface to be inspected is solved according to the slope field of the surface to be inspected. The reference fitting plane is obtained by performing least squares plane fitting on the height field of the surface to be inspected. The surface space undulation of each hot stamping area to be inspected is obtained based on the height deviation of the surface height at each spatial position to be inspected relative to the reference fitting plane.
[0007] Beneficial Effects: This invention constructs an original angular displacement field by comparing the difference between the angular displacement center of each inspected spatial location and the corresponding reference angular displacement center. Then, it separates and removes the overall rigid posture response component, effectively eliminating common interferences such as product placement posture and overall tilt. Only the residual angular displacement caused by real surface geometric changes such as local bulges, local depressions, wrinkles, and continuous bending is retained, thus significantly improving the purity and detection accuracy of the defect signal. Subsequently, based on the specular reflection geometry, the slope field of the inspected surface is inverted from the residual angular displacement component field, and the height field of the inspected surface is further solved, realizing the quantitative restoration from two-dimensional angle information to three-dimensional morphology. Finally, a reference fitting plane is obtained by least-squares plane fitting of the height field, and the surface spatial undulation is obtained based on the deviation of the height of each spatial location relative to the reference fitting plane. This eliminates the subjectivity of the reference plane selection, ensuring stable and comparable evaluation results, and enables each inspected hot stamping area to output a unified index, achieving automated judgment and batch quality control, thereby improving the accuracy and reliability of hot stamping surface flatness detection for cultural and creative design products. Attached Figure Description
[0008] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 This is a flowchart of a method for detecting the surface flatness of hot stamping on cultural and creative design products according to the present invention. Detailed Implementation
[0010] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the protection scope of the embodiments of the present invention.
[0011] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art.
[0012] This embodiment provides a method for detecting the surface flatness of hot stamping on cultural and creative design products, detailed as follows: like Figure 1 As shown, the method for testing the flatness of the hot stamping surface of this cultural and creative design product includes the following steps: Step S001: Obtain the reference balance center of each reference spatial position in each reference hot stamping area on the qualified hot stamping reference sample.
[0013] This embodiment provides a method for detecting the surface flatness of hot stamping on cultural and creative design products to improve the accuracy and reliability of the test. The method first obtains the reference surface morphology of a qualified hot stamping reference sample, which mainly includes the reference surface height field and the reference surface slope field. Then, by using the qualified hot stamping reference sample, reference equilibrium centers are established at each reference spatial position. The change between the equilibrium center to be tested and the reference equilibrium center formed by the cultural and creative design product under the same angular domain reflection conditions is used as the basis for surface direction change. This makes the test results no longer directly dependent on the magnitude of reflection brightness, thereby reducing the impact of changes in the reflection amplitude and imaging response of the hot stamping material on the surface flatness of the product. The influence of geometric judgment is then considered. Subsequently, the overall rigid attitude response component that can be explained by the overall tilt of the cultural and creative design product under inspection is separated from the original complex equilibrium angular displacement field. This allows the retained local complex equilibrium residual angular displacement to mainly reflect the local geometric changes of the hot stamping surface. Then, the slope field and height field of the surface under inspection are restored by combining the slope of the reference surface obtained independently from the qualified hot stamping reference sample. This preserves the actual surface undulations that are allowed to exist in the reference sample itself. Finally, the flatness of the hot stamping surface can be evaluated based on the spatial undulation of the hot stamping area under inspection relative to the overall reference fitting plane, thereby improving the reliability and accuracy of identifying surface unevenness such as local bulges, depressions, wrinkles, and continuous bends.
[0014] Based on the above analysis, this embodiment needs to first determine the cultural and creative design product to be inspected, and obtain the reference surface morphology of a qualified hot stamping reference sample. The specific acquisition process is as follows: First, the cultural and creative design products that need to be tested for the flatness of the hot stamping surface are marked as the cultural and creative design products to be tested; then, from the products with the same product specifications, the same hot stamping material type, the same hot stamping pattern and the same hot stamping process specifications as the cultural and creative design products to be tested, select the hot stamping products that have been judged to be qualified according to the current quality specifications of the product, and use them as qualified hot stamping reference samples; the qualified hot stamping reference samples serve as external geometric references under the known qualified state. It should also be noted that, in the product design data corresponding to all products with the same model as the cultural and creative design product to be inspected in this embodiment, there are four pre-numbered fixed positioning feature points, each with a unique design plane coordinate, and whose positions correspond one-to-one with the qualified hot stamping reference sample and the cultural and creative design product to be inspected, and which can be identified in the positioning image. Each of these M fixed positioning feature points has a unique design plane coordinate, meaning that each of these M fixed positioning feature points has one and only one set of definite horizontal and vertical coordinate values in the product's design reference plane coordinate system (XY axis plane). In specific applications, the implementer needs to set the value of M according to the actual situation, but it is required that M is not less than 3, and that any three fixed positioning feature points are not collinear. For example, in this embodiment, M is preferably set to 4, and these fixed positioning feature points are the product positioning reference. This means that all products of the same model as the cultural and creative design product to be inspected have these four fixed positioning feature points. These four points already exist in the original design data of the product (such as CAD drawings and design documents), and these four points will be pre-numbered, for example, point 1, point 2, point 3, and point 4. The numbering is fixed and will not change because of a different product. Each point has a definite coordinate value on the design plane of the product. For example, point 1 on the qualified hot stamping reference sample and point 1 on the cultural and creative design product to be inspected refer to the same physical location on the product. Furthermore, this embodiment requires that after the camera captures the image, the pixel positions of these four points must be accurately found in the image.
[0015] Then, using the product positioning datum and the qualified hot stamping reference sample, a product surface coordinate system is established. The specific establishment process is as follows: Select any two fixed positioning feature points on the qualified hot stamping reference sample, and record them as the first fixed positioning feature point and the second fixed positioning feature point, respectively. Take the first fixed positioning feature point as the origin of the coordinate system, take the design direction from the first fixed positioning feature point to the second fixed positioning feature point as the positive direction of the X (horizontal) axis, take the direction perpendicular to the design datum plane on the surface of the qualified hot stamping reference sample and pointing to the outside of the surface of the qualified hot stamping reference sample as the positive direction of the Z (vertical) axis, and determine the positive direction of the Y (vertical) axis according to the right-hand coordinate relationship. The design datum plane refers to the ideal geometric plane that is set by the designer during the product design stage and serves as the datum for dimensioning and shape tolerance.
[0016] Next, a reference surface slope field for a qualified hot stamping reference sample is constructed based on the measurement method. The specific construction process is as follows: Obtain the area corresponding to each hot stamping pattern on the surface of the qualified hot stamping reference sample and record it as a hot stamping sub-area. Since this embodiment adopts the strategy of processing hot stamping patterns that are not connected to each other separately, the area formed by all the hot stamping sub-areas that are connected to each other needs to be recorded as a reference hot stamping area. For individual hot stamping areas that are not connected to other hot stamping areas, each is also recorded as a reference hot stamping area. This embodiment can directly obtain all the hot stamping sub-areas on the surface of the qualified hot stamping reference sample based on the product design data, that is, read the design outline of the hot stamping pattern from the product design data, and the area enclosed by the projection of the design outline on the design reference plane is the hot stamping area.
[0017] A regular two-dimensional spatial grid is laid out on the reference hot stamping area of the qualified hot stamping reference sample. Each grid belonging to the reference hot stamping area is used as a reference spatial position, and the coordinate value of each reference spatial position in the product surface coordinate system is recorded. Using a three-dimensional surface topography measuring device, the hot stamping area on the qualified hot stamping reference sample is measured point by point, and the surface height of each reference spatial position is recorded as the reference surface height of the corresponding reference spatial position. The three-dimensional surface topography measuring device measures the surface height of each reference spatial position along the Z-axis direction of the product surface coordinate system. The reference surface height values of each reference spatial position in the same reference hot stamping area are arranged according to the corresponding position of each reference spatial position in the product surface coordinate system to obtain the reference surface height field of each reference hot stamping area. Among them, the row index of the reference surface height field corresponds to the reference spatial position (grid position) in the Y-axis direction of the product surface, and the column index corresponds to the reference spatial position (grid position) in the X-axis direction of the product surface.
[0018] In this embodiment, the three-dimensional surface topography measuring device adopts a confocal displacement measuring device. The rated minimum scanning step distance of the three-dimensional surface topography measuring device in the X-axis and Y-axis directions is set to the grid spacing in the corresponding directions. During offline measurement, the qualified hot stamping reference sample is installed on the measuring station of the three-dimensional surface topography measuring device according to the product positioning reference. The fixed support position and clamping area of the measuring station are used for support and clamping, and the position of the support position and clamping area in the product surface coordinate system is recorded. The product positioning reference consists of four fixed positioning feature points and the design reference plane.
[0019] Since the method for obtaining the reference surface slope at each reference spatial location on a qualified hot stamping reference sample is the same, for ease of analysis and understanding, this embodiment will describe the process of obtaining the reference surface slope at any reference spatial location P within any reference hot stamping area as an example. The reference surface slope includes the reference surface slope in the X-axis direction and the reference surface slope in the Y-axis direction; the specific process for obtaining the reference surface slope at reference spatial location P is as follows: The adjacent reference spatial positions along the positive X-axis and the adjacent reference spatial positions along the negative X-axis of reference spatial position P are denoted as positions P1+ and P1-, respectively. The result of subtracting the reference surface height of position P1- from the reference surface height of position P1+ and dividing by the difference in the horizontal coordinates between positions P1+ and P1- is denoted as the X-axis slope of reference spatial position P. The adjacent reference spatial positions along the positive Y-axis and the adjacent reference spatial positions along the negative Y-axis of reference spatial position P are denoted as positions P2+ and P2-, respectively. The result of subtracting the reference surface height of position P2- from the reference surface height of position P2+ and dividing by the difference in the vertical coordinates between positions P2+ and P2- is denoted as the vertical slope of reference spatial position P. In other words, the reference surface slope includes the X-axis slope and the Y-axis slope. In this embodiment, when calculating the slope of a reference surface at a certain reference spatial position, only the reference spatial positions within the same reference hot stamping area that are adjacent to it can be used. Reference spatial positions that cross the area or are separated by several reference spatial positions cannot be used for calculation. Therefore, there may be situations where a reference spatial position lacks the boundary position of a reference hot stamping area with one adjacent reference spatial position in a certain direction. To address this situation, this embodiment determines the slope of the reference surface based on its own reference surface height and coordinates and the reference surface height and coordinates of the existing adjacent reference spatial positions. That is, if a reference spatial position P is located at the boundary of a certain reference hot stamping area and lacks one adjacent reference spatial position in a certain direction, the slope is calculated using the reference spatial position P and the only adjacent reference spatial position in that direction that is located inside the reference hot stamping area. During the calculation, the reference surface height of the position with the larger coordinates is always subtracted from the reference surface height of the position with the smaller coordinates, and then divided by the positive coordinate difference between the two. Taking a grid spacing of 0.5mm as an example, assume that the reference spatial position P is located at the boundary of a certain reference hot stamping area. P has no adjacent reference spatial positions along the negative X-axis, but only an adjacent reference spatial position P+ along the positive X-axis. Assume that the X-coordinate of P is 3.4mm and the surface height is 2.4μm, and the X-coordinate of P+ is 3.9mm and the surface height is 2.6μm. In this case, the slope is calculated using P and the only adjacent P+ in this direction. The surface height value of the position with the larger coordinate is subtracted from the surface height value of the position with the smaller coordinate, and then divided by the corresponding positive coordinate difference. The result is (2.6μm-2.4μm)÷(3.9mm-3.4mm)=0.4μm / 0.5mm. It should be noted that in this embodiment, the positive and negative directions of the reference surface slope are uniformly defined according to the positive coordinate direction. That is, the positive and negative of the slope are consistent with the direction of the product surface coordinate system. The horizontal and vertical axes mentioned when obtaining the reference surface slope in this embodiment are the horizontal and vertical axes of the product surface coordinate system.
[0020] After obtaining the X and Y axis slopes of each reference spatial position within each reference hot stamping area of the qualified hot stamping reference sample, the X and Y axis slopes of each reference spatial position belonging to the same reference hot stamping area are arranged according to their corresponding positions in the product surface coordinate system to obtain the reference surface slope field of each reference hot stamping area. The reference surface slope field consists of two parts: the X-axis slope field and the Y-axis slope field. Its row index corresponds to the reference spatial position in the Y-axis direction of the product surface, and its column index corresponds to the reference spatial position in the X-axis direction of the product surface.
[0021] Therefore, based on the above, a reference surface morphology of a qualified hot stamping reference sample can be obtained. The reference surface morphology includes a reference surface height field and a reference surface slope field, and the minute surface undulations that are allowed to exist in the qualified hot stamping reference sample itself are preserved in the reference surface morphology (reference surface height field and reference surface slope field).
[0022] In this embodiment, after obtaining the reference surface morphology of a qualified hot stamping reference sample, the qualified hot stamping reference sample is mounted on the product positioning station of the angular reflectance surface inspection device. During installation, the sample is positioned according to the product positioning reference (four fixed positioning feature points), and supported and clamped at the same position in the product surface coordinate system according to the support position and clamping area recorded during offline measurement. This ensures that the angular reflectance measurement corresponds to the sample support state during offline surface morphology measurement. Furthermore, the product positioning station defines the position and orientation of the qualified hot stamping reference sample within the product design reference plane based on the product positioning reference, ensuring that the reference surface morphology data and the angular reflectance measurement data are aligned in the same coordinate system.
[0023] The angular reflective surface inspection device in this embodiment includes a fixed imaging device, a controllable directional illumination device, and a product positioning station. The fixed imaging device maintains the observation position unchanged during inspection and outputs a grayscale image, meaning that the fixed imaging device can acquire images of qualified hot stamping reference samples. The controllable directional illumination device outputs collimated directional illumination and changes the incident illumination direction through a two-dimensional angle adjustment mechanism. The controllable directional illumination device includes two angle adjustment axes. In this embodiment, the two adjustment axes of the angle adjustment mechanism are respectively denoted as the first angle adjustment axis and the second angle adjustment axis. The angular positions of the first angle adjustment axis and the second angle adjustment axis after rotation are respectively denoted as the first illumination angle and the second illumination angle. The rotation directions of the first angle adjustment axis and the second angle adjustment axis are respectively denoted as the first illumination angle direction and the second illumination angle direction. That is, the incident illumination direction is composed of two independent illumination angle directions, and the two illumination angle directions are not parallel to each other and remain unchanged after the inspection device is calibrated.
[0024] Next, this embodiment needs to determine the angular calibration relationship between the sampling illumination angle point and the actual illumination direction, the detection angular domain, etc. The specific determination process is as follows: perform camera calibration on the fixed imaging device, and use the camera coordinate system used for camera calibration as the detection device coordinate system; and after the camera calibration is completed, the observation direction in the detection device coordinate system can be obtained for each pixel position in the image, that is, the observation direction corresponding to each pixel in the image can be obtained.
[0025] The rated minimum control increment of each of the two adjustment axes of the two-dimensional angle adjustment mechanism is used as the preset rotation sampling step size for the first angle adjustment axis and the second angle adjustment axis, respectively. The first and second angle adjustment axes are rotated and sampled at their respective preset rotation sampling steps to obtain the sampled first illumination angles within the effective working range of the first angle adjustment axis and the sampled second illumination angles within the effective working range of the second angle adjustment axis. Then, all sampled first illumination angles and all sampled second illumination angles are combined in pairs to obtain all sampled illumination angle points. Each sampled illumination angle point consists of a sampled value of the first illumination angle and a sampled value of the second illumination angle. The effective working range of the two-dimensional angle adjustment mechanism refers to the two-dimensional angle range defined by the product of the reachable angular position interval of the first angle adjustment axis and the reachable angular position interval of the second angle adjustment axis. The two endpoints of each reachable angular position interval are determined by the mechanical limit of the corresponding angle adjustment axis. Subsequently, each sampling lighting angle point is individually calibrated to obtain an actual lighting direction corresponding to that sampling lighting angle point, thereby establishing the angle calibration relationship between the sampling lighting angle point and the actual lighting direction. An example of calibrating the sampling lighting angle point is as follows: For any sampling lighting angle point, when the first angle adjustment shaft rotates to the first lighting angle corresponding to that sampling lighting angle point and the second angle adjustment shaft rotates to the second lighting angle corresponding to that sampling lighting angle point, the propagation direction of the lighting beam relative to the product positioning station is measured using an angle measuring device. Following the convention that the lighting direction points from the measured surface position to the controllable direction lighting device, the opposite direction of this propagation direction is taken as the actual lighting direction corresponding to that sampling lighting angle point. In this embodiment, the two-dimensional angle range for which angle calibration has been completed is used as the detection angle domain. Since this embodiment completes angle calibration for all sampling lighting angle points within the effective working range of the two angle adjustment shafts, the detection angle domain is the two-dimensional angle range covered by the sampling lighting angle points sampled and calibrated according to a preset rotation sampling step size within the effective working range of the two-dimensional angle adjustment mechanism.
[0026] After camera calibration, the product surface coordinate system, determined by four fixed positioning feature points, and the camera calibration results can be used to establish a transformation relationship between the product surface coordinate system and the detection device coordinate system. This ensures that each reference spatial position in the reference surface height field corresponds to a specific position in the image plane of the fixed imaging device. Specifically, for each reference spatial position on the qualified hot stamping reference sample, through coordinate transformation and perspective projection, its precise corresponding pixel position can be found in the image output by the fixed imaging device. Furthermore, when a reference spatial position is projected onto a non-integer pixel position, the grayscale value of that reference spatial position can be calculated using a bilinear interpolation algorithm based on the grayscale values of the four adjacent pixels surrounding the projected position.
[0027] Therefore, in this embodiment, while the qualified hot stamping reference sample remains in its current installation state, a fixed imaging device is used to acquire images of the surface of the qualified hot stamping reference sample. The single image acquired at this time is recorded as the reference positioning image of the qualified hot stamping reference sample. Based on product design data, the image positions (i.e., pixel positions) of four fixed positioning feature points on the qualified hot stamping reference sample are determined in the reference positioning image. Pixels that are fixed positioning feature points in the reference positioning image are recorded as reference positioning pixels. This embodiment requires that the camera acquire all fixed positioning feature points on the product during parameter adjustment. The current installation state refers to the state when the qualified hot stamping reference sample is positioned and clamped according to the product positioning benchmark. The reference positioning image in this embodiment is mainly used to establish the image correspondence between the reference spatial positions of the same product after the subsequent installation of the cultural and creative design products to be inspected.
[0028] Since the brightness of a single image on a hot-stamped surface depends not only on the surface orientation but also on the material reflection amplitude, illumination output, and imaging response, this embodiment does not directly use the grayscale value under a single illumination direction as the surface geometric zero point, i.e., it cannot be directly used as the reference equilibrium center. This embodiment uses the equilibrium center as the representation of the surface geometric zero point; the surface geometric zero point refers to the reference position of the reflection response value when the geometric orientation of a certain location on the surface is in a reference state. To obtain a reference equilibrium center unaffected by factors such as material reflection amplitude, illumination output, and imaging response, this embodiment will next determine the reference equilibrium center by calculating the equilibrium differential response value. The specific process is as follows: The controllable directional illumination device sequentially changes the incident illumination direction according to the sampling illumination angle points. At each sampling illumination angle point, a fixed imaging device acquires a surface grayscale image. The surface grayscale image of the qualified hot stamping reference sample at each acquired sampling illumination angle point is recorded as a reference angular domain reflection image. All acquired reference angular domain reflection images are arranged in order according to the coordinates of the sampling illumination angle points to obtain a reference angular domain reflection image sequence. For example, in this embodiment, the reference angular domain reflection images can be arranged in ascending order of the first illumination angle. In other implementations, other sorting rules can be set, such as arranging the reference angular domain reflection images in ascending order of the second illumination angle. Furthermore, in this embodiment, the exposure and gain of the fixed imaging device and the output intensity of the controllable directional illumination device remain fixed during the acquisition of the reference angular domain reflection image sequence, keeping the primary mirror reflection response within the unsaturated response range of the fixed imaging device. This embodiment is used to detect ordinary metal hot stamping surfaces that have a single, stable, and repeatable angular displacement primary mirror response within the detection angular domain, adaptable to changes in local surface direction.
[0029] Since the grayscale values at each reference spatial location in each reference angular domain reflection image can reflect the reflection response values of each reference spatial location under different lighting conditions, one reference angular domain reflection image corresponds to one lighting condition, and one reference angular domain reflection image corresponds to one sampling lighting angle point; therefore, for any reference spatial location P within any reference hot stamping area, this embodiment can obtain the grayscale value of the reference spatial location P in each reference angular domain reflection image, and record the grayscale value of the reference spatial location P obtained in each reference angular domain reflection image as the reflection response value of the reference spatial location P under the corresponding reference angular domain reflection image; then, among the reflection response values of the reference spatial location P under all reference angular domain reflection images, the sampling lighting angle point corresponding to the reference angular domain reflection image with the largest reflection response value is selected as the principal specular response position of the reference spatial location P. In addition, when there are multiple reference angular domain reflection images with the largest reflection response values among all reference angular domain reflection images, the sampling lighting angle points corresponding to each reference angular domain reflection image with the largest value are used as candidate objects, and the principal specular response position of the reference spatial location P is determined according to the angle ascending priority rule. The angle ascending priority rule means: first compare the first illumination angles corresponding to each candidate object, select the candidate object with the smallest first illumination angle. If there are still multiple selected candidate objects, then continue to compare the second illumination angles corresponding to each of these candidate objects, select the candidate object with the smallest second illumination angle, and take the unique candidate object obtained in this way as the unique object determined.
[0030] A specific example is as follows: Assume that among the reflection response values of P under all reference angular domain reflection images, the reference angular domain reflection images with the largest reflection response values are the first reference angular domain reflection image, the second reference angular domain reflection image, and the third reference angular domain reflection image. If the first illumination angles of the sampling illumination angle points corresponding to the three are different, then the sampling illumination angle point with the smallest first illumination angle is selected as the principal mirror response position of P. If the first illumination angles of the sampling illumination angle points corresponding to the first and second reference angular domain reflection images are equal and both are smaller than the first illumination angle of the sampling illumination angle point corresponding to the third reference angular domain reflection image, then the sampling illumination angle point with the smallest second illumination angle is selected as the principal mirror response position of the reference spatial position P. Since there are no two completely equal sampling illumination angle points in this embodiment (i.e., any two sampling illumination angle points will not be equal at both the first and second illumination angles), the above comparison process will necessarily yield a unique sampling illumination angle point.
[0031] Subsequently, an n×n local window of sampling illumination angle points is constructed centered on the primary mirror response position of the reference spatial position, thereby obtaining the local window of sampling illumination angle points corresponding to each reference spatial position. The value of n is set by the implementer according to the actual situation; in this embodiment, n=3. To ensure that there are directly adjacent sampling states on both sides of each sampling illumination angle point in the 3×3 window along any illumination angle direction, the primary mirror response position is required to be at least two corresponding preset rotation sampling steps away from the boundary of the detection angle domain. In this embodiment, a local window is constructed centered on the main mirror response position of each reference spatial position within the reference hot stamping area only when all the main mirror response positions within the reference hot stamping area meet the preset construction conditions. The reference balance center of each reference spatial position within the corresponding reference hot stamping area is determined to be effective, forming a reference balance center field. The flatness detection of the cultural and creative design product under inspection continues. However, if there is a main mirror response position within a certain reference hot stamping area that does not meet the preset construction conditions, it is determined that the reference spatial position of the main mirror response position that does not meet the preset construction conditions cannot effectively determine the reference balance center. The reference reference establishment result of the reference hot stamping area will also be marked as invalid, and the flatness detection method provided in this embodiment will be stopped from being used for the flatness detection of the cultural and creative design product under inspection.
[0032] In this embodiment, the process of determining whether the primary mirror response position of a certain reference spatial location meets the preset construction conditions is as follows: if the distances from the first illumination angle coordinate value and the second illumination angle coordinate value of the primary mirror response position of the reference spatial location to the boundary of the detection angular domain are at least two corresponding preset rotation sampling steps, then the primary mirror response position of the reference spatial location is determined to meet the preset construction conditions; otherwise, it is determined not to meet the preset construction conditions. Taking the reference spatial location P as an example, assuming that the first illumination angle and the second illumination angle of its primary mirror response position are a1 and b1 respectively, that is, the coordinates of its primary mirror response position are (a1, b1), assuming that the preset rotation sampling steps corresponding to the first angle adjustment axis and the second angle adjustment axis are Δa and Δb respectively, assuming that the value range of the first illumination angle of the detection angular domain is [a1-2Δa, a1+10Δa] and the value range of the second illumination angle is [b1-2Δb, b1+10Δb], then it can be determined that... The distance from the first and second illumination angles at the primary mirror response position of fixed P to the boundary of the corresponding illumination angle range in the detection angular domain is not less than twice the corresponding preset rotation sampling step size. Therefore, the first illumination angles a1-Δa, a1, a1+Δa and the second illumination angles b1-Δb, b1, b1+Δb are combined in pairs to obtain 9 different sampling illumination angle points. These 9 sampling illumination angle points constitute a 3×3 sampling illumination angle point local window centered at (a1, b1). It should be noted that in this embodiment, the subsequent analysis and explanation will be based on the example that the primary mirror response positions at all reference spatial positions within all reference hot stamping areas meet the preset construction conditions.
[0033] The complex equilibrium differential response values of each reference spatial position along the first illumination angle direction and along the second illumination angle direction at each of its corresponding candidate illumination centers are calculated. Since the process of obtaining the complex equilibrium differential response values of each reference spatial position along each illumination angle direction is the same, for ease of understanding, this embodiment will next use the specific process of obtaining the complex equilibrium differential response value of the reference spatial position P along the k-th illumination angle direction at the c-th candidate illumination center among all its corresponding candidate illumination centers as an example. The value of k is 1 or 2, meaning that the k-th illumination angle direction only includes the first illumination angle direction and the second illumination angle direction. The specific process of obtaining the complex equilibrium differential response value of the reference spatial position P along the first illumination angle direction at its corresponding c-th candidate illumination center is as follows: For the c-th candidate lighting center, the sampling lighting angle point where its k-th lighting angle is increased by the preset rotation sampling step corresponding to the k-th angle adjustment axis, and the other lighting angle remains unchanged, is recorded as the positive neighbor angle point of the c-th candidate lighting center under the k-th lighting angle; the sampling lighting angle point where its k-th lighting angle is decreased by the preset rotation sampling step corresponding to the k-th angle adjustment axis, and the other lighting angle remains unchanged, is recorded as the negative neighbor angle point of the c-th candidate lighting center under the k-th lighting angle; k takes values of 1 and 2. If k is 1, the first illumination angle of the c-th candidate illumination center is A1, the second illumination angle is A2, and the preset rotation sampling step size of the first angle adjustment axis is Δa, then the candidate illumination center with the first illumination angle equal to A1 + Δa and the second illumination angle equal to A2 is denoted as the positive neighbor angle point of the c-th candidate illumination center under the first illumination angle. The process for determining the negative neighbor angle point is similar. Since one reference angular domain reflection image corresponds to one sampling illumination angle point, and the candidate illumination center also belongs to the sampling illumination angle point, the reference angular domain reflection images corresponding to the positive and negative neighbor angle points can be obtained respectively, and then the reflection response value of the reference spatial position P under the positive and negative neighbor angle points can be obtained; subsequently, the c-th candidate illumination center is calculated. The difference between the reflection response value of the reference spatial position P at the positive neighbor angle point of the c-th candidate lighting center at the k-th lighting angle and the reflection response value of the reference spatial position P at the negative neighbor angle point of the c-th candidate lighting center at the k-th lighting angle is recorded as the effective value of the numerator. The sum of the reflection response value of the reference spatial position P at the positive neighbor angle point of the c-th candidate lighting center at the k-th lighting angle and the reflection response value of the reference spatial position P at the negative neighbor angle point of the c-th candidate lighting center at the k-th lighting angle is recorded as the effective value of the denominator. The ratio of the effective value of the numerator to the effective value of the denominator is recorded as the complex equilibrium differential response value of the reference spatial position P at the c-th candidate lighting center along the direction of the k-th lighting angle.
[0034] In this embodiment, the specific expression for the complex equilibrium differential response value of the reference spatial position P along the direction of the k-th illumination angle at the c-th candidate illumination center is given. for: ;in, For the reference spatial location P, the complex equilibrium differential response value along the k-th illumination angle direction at the c-th candidate illumination center. Let c be the candidate lighting center, and let be the two-dimensional lighting angular coordinates formed by the first lighting angle and the second lighting angle. The preset rotation sampling step size for the k-th angle adjustment axis. For the first A unit direction vector for each illumination angle, with a length of 1. For reference spatial position P, at its corresponding c-th candidate lighting center along the th The direction of the illumination angle is positively offset. The reflection response value, For reference spatial position P, at its corresponding c-th candidate lighting center along the th Negative offset in the direction of each lighting angle The reflection response value, , This also represents the reflection response values of the reference spatial position P at the positive and negative neighborhood angle points; "and" "respectively represent along the first The positive and negative offsets in each lighting angle direction; this embodiment will and The combination of is denoted as the th . The combination of reflection response values of the c-th candidate lighting center corresponding to the reference spatial position P under each lighting angle direction.
[0035] Furthermore, in this embodiment, the ratio of the difference to the sum of the paired illumination responses is used to calculate the complex balance differential response value. This allows the complex balance differential response value to be mainly determined by the relative imbalance between the two sides of the response when the amplitude changes in the reflection response values on both sides are proportional. The closer the value is to 0, the more symmetrical the reflection response values are on both sides along the k-th illumination angle direction, and the closer the c-th candidate illumination center is to the mirror center in that direction. The closer the reflection response value is to 0, the more asymmetrical the reflection response values on both sides of the k-th illumination angle direction, and the farther the c-th candidate illumination center is from the center of the mirror.
[0036] This embodiment also needs to judge the sum of the two reflection response values in the combination of reflection response values of each candidate lighting center corresponding to the reference spatial position P. Specifically: when the sum of the two reflection response values in the combination of reflection response values of the cth candidate lighting center corresponding to the reference spatial position P under a certain lighting angle direction is zero, it is determined that the cth candidate lighting center cannot be used as the reference balance center of P. When the sum of the two reflection response values in the combination of reflection response values of the cth candidate lighting center corresponding to the reference spatial position P under the first and second lighting angle directions is not zero, it is determined that the cth candidate lighting center can be used as the reference balance center of P. When it is determined that all candidate lighting centers corresponding to the reference spatial position P cannot be used as the reference balance center of P, it is determined that P cannot effectively determine the reference balance center. Therefore, an effective reference balance center field cannot be formed at this time, and the flatness detection method provided in this embodiment should be stopped for measuring the flatness of the cultural and creative design product under inspection or for detecting the flatness of the hot stamping surface. Conversely, when there is a candidate lighting center that can be used as the reference balance center of P among all candidate lighting centers corresponding to the reference spatial position P, it is determined that P can effectively determine the reference balance center.
[0037] The smaller the sum of the squares of the complex equilibrium differential response values obtained from the two illumination angle directions for the same candidate illumination center, the closer the corresponding candidate illumination center is to specular reflection equilibrium. The smaller the value, the closer the two sides of the c-th candidate illumination center are to the specular reflection balance. Therefore, in this embodiment, the reference balance center of the reference spatial position P can be determined based on the sum of the squares of the balance differential response values of the reference spatial position P along the two illumination angle directions in each of its corresponding candidate illumination centers. , These are the complex equilibrium differential response values of the reference spatial position P at the c-th candidate illumination center corresponding to the reference spatial position P, along the directions of the first and second illumination angles; and in this embodiment, Plus The result is denoted as the eigenvalue of the c-th candidate illumination center corresponding to the reference spatial position P. Among all candidate illumination centers corresponding to the reference spatial position P, the candidate illumination center with the smallest eigenvalue is selected as the reference rebalancing center of the reference spatial position P. In addition, when there are multiple candidate illumination centers with the smallest eigenvalues, the candidate illumination centers with the smallest angular distance to the primary mirror response position of P are selected as candidates, and the reference rebalancing center is determined according to the above-mentioned angle ascending priority rule. For example, if two candidate illumination centers have the same smallest eigenvalue and the same angular distance to the primary mirror response position, then the candidate illumination center with the smaller first illumination angle is selected as the reference rebalancing center according to the above-mentioned angle ascending priority rule. The distance between the two-dimensional illumination angle coordinates of any candidate illumination center and the two-dimensional illumination angle coordinates of the primary mirror response position is the angular distance between the candidate illumination center and the primary mirror response position.
[0038] Therefore, this embodiment can obtain the reference balance center of the reference spatial position through the above process. In addition, it should be noted that when a certain reference spatial position is determined to be unable to effectively determine the reference balance center, it indicates that the reference benchmark is invalid and the reference balance center field will not be established subsequently. The flatness detection method provided in this embodiment should be stopped for the flatness detection of the hot stamping surface of the cultural and creative design product under inspection. That is, only when all reference spatial positions can be effectively determined as reference balance centers is it considered that the reference benchmark is established effectively, and the reference balance center field will be established subsequently. The flatness detection method provided in this embodiment can then be used to continue the process of hot stamping surface flatness detection of the cultural and creative design product under inspection. The reference balance center field of each reference hot stamping area is the reference balance center of the reference spatial position in the corresponding reference hot stamping area, which is obtained by arranging each reference spatial position according to its corresponding position in the product surface coordinate system. One reference hot stamping area can obtain one reference balance center field. In this embodiment, the arrangement rules of various fields obtained by arranging each spatial position according to its corresponding position in the product surface coordinate system are the same.
[0039] In this embodiment, when the relative geometric positions of the fixed imaging device, the controllable directional lighting device, and the product positioning station remain unchanged, the camera calibration relationship, the lighting angle calibration relationship, the coordinate transformation relationship, and the reference equilibrium center field remain valid. When any relative geometric position changes, the camera calibration, lighting angle calibration, and the establishment of the reference equilibrium center field must be completed again before the cultural and creative design product to be inspected can be tested. When the qualified hot stamping reference sample is replaced or its hot stamping surface is damaged, the surface morphology of the new qualified hot stamping reference sample must be measured again, the reference angular domain reflection image sequence must be re-acquired, and the reference equilibrium center field must be recalculated.
[0040] Step S002: Obtain the cultural and creative design product to be inspected and each hot stamping area on the product to be inspected, and obtain the inspection center of each inspection space position of the product to be inspected in the same way as obtaining the reference balance center; for each hot stamping area to be inspected, obtain the original balance angular displacement of each inspection space position by the difference between the inspection center of each inspection space position and the corresponding reference balance center, and form the original balance angular displacement field; separate and remove the overall rigid attitude response component from the original balance angular displacement field to obtain the local balance residual angular displacement field.
[0041] The cultural and creative design product to be inspected is installed on the product positioning station of the angular reflective surface inspection device, and is positioned, supported, and clamped according to the same product positioning benchmark, support position, and clamping area as when the reference angular reflective image sequence is obtained from the qualified hot stamping reference sample; the product positioning station defines the position and orientation of the cultural and creative design product to be inspected within the product design plane according to the product positioning benchmark.
[0042] A fixed imaging device is used to acquire a positioning image of the cultural and creative design product to be inspected, which is recorded as the positioning image to be inspected, in the same way as the determination method of the reference positioning image. The image positions of four fixed positioning feature points are determined in the positioning image to be inspected. Based on the image coordinates of the four fixed positioning feature points with the same name in the reference positioning image and the positioning image to be inspected, the planar projection transformation relationship from the reference positioning image to the positioning image to be inspected is obtained. That is, the homography matrix is calculated using the positions of the four feature points in the two images, and any pixel coordinates in the reference positioning image are transformed into the pixel coordinates of the corresponding point in the positioning image, ensuring that the physical positions detected on both sides are exactly the same. The planar projection transformation relationship is only used to determine the image positions of each reference spatial position in the regular two-dimensional spatial grid corresponding to the reference surface height field or the qualified hot stamping reference sample in the positioning image to be inspected, so that the reference reflection response value and the reflection response value to be inspected of the same physical position on the surface of the product can be compared accordingly. In this embodiment, the same physical position on the cultural and creative design product to be inspected that corresponds one-to-one with the reference spatial position is called the spatial position to be inspected.
[0043] Based on the camera calibration relationship, and the corresponding positions of the reference spatial position in the reference positioning image and the corresponding positions of the spatial position to be inspected in the positioning image to be inspected, the observation directions of the pixel positions corresponding to the reference spatial position in the reference positioning image and the observation directions of the pixel positions corresponding to the spatial position to be inspected in the positioning image to be inspected can be obtained respectively, and are recorded as the reference observation direction corresponding to the reference spatial position and the observation direction to be inspected corresponding to the spatial position to be inspected. It should be noted that if the cultural and creative design product to be inspected is tilted as a whole relative to the qualified hot stamping reference sample (overall tilt out of the plane), the effect of this overall tilt will appear in both the observation direction to be inspected and the angular domain reflection response value.
[0044] Following the method of acquiring the reference angular domain reflectance image of the qualified hot stamping reference sample at each sampling illumination angle, the angular domain reflectance image of the cultural and creative design product to be inspected at the corresponding sampling illumination angle is obtained, thus obtaining the angular domain reflectance image sequence to be inspected. That is, the angular domain reflectance image sequence to be inspected is obtained by using a fixed imaging device to maintain the same exposure and gain. The images at the same position in the angular domain reflectance image sequence to be inspected and the reference angular domain reflectance image sequence are acquired at the same sampling illumination angle. Using the same grayscale value method, main mirror response position determination rules, 3×3 local window, paired illumination complex balance difference relationship (complex balance difference response value), and same value processing order as the qualified hot stamping reference sample, the complex balance center to be inspected can be determined, and the complex balance center to be inspected can be obtained. That is, when obtaining the complex balance center corresponding to each spatial position to be inspected, the same algorithm, rules, and process as the reference complex balance center to be obtained should be used to calculate to ensure that the results on both sides are comparable.
[0045] Similarly, following the method described above for determining whether a reference balance center can be effectively determined for a reference spatial location, the method for determining whether a balance center can be effectively determined for a spatial location to be inspected is also applied. If a spatial location to be inspected is determined to be unable to effectively determine a reference balance center, it will be determined that the hot stamping area to be inspected on the product to be inspected, to which that spatial location belongs, cannot be effectively measured, nor can the flatness or morphology of the hot stamping area be effectively evaluated. The morphology restoration of the hot stamping area will then cease, and the process of using the flatness detection method provided in this embodiment to perform flatness detection on the hot stamping area to be inspected will be stopped. Only when all spatial locations to be inspected within a hot stamping area on the product to be inspected are determined to be valid reference balance centers will the hot stamping area to be inspected be determined to be measurable, and the flatness or morphology of the hot stamping area to be inspected can be effectively evaluated. The morphology restoration of the hot stamping area to be inspected can then continue, and the process of using the flatness detection method provided in this embodiment to perform flatness detection on the hot stamping area to be inspected can continue. Furthermore, this embodiment describes the subsequent testing process based on the premise that all areas to be inspected for hot stamping are determined to be capable of normal measurement.
[0046] Calculate the original angular displacement of each inspected spatial position in the hot stamping area: For any inspected spatial position, subtract the first and second illumination angles of the reference angular displacement center of the reference spatial position belonging to the same physical position from the first and second illumination angles of the inspected angular displacement center of the inspected spatial position, respectively, to obtain the original angular displacement of the inspected spatial position. That is, the original angular displacement is a two-dimensional angle difference composed of the difference between the first and second illumination angles. Arrange the original angular displacements of all inspected spatial positions in each hot stamping area according to their corresponding positions in the product surface coordinate system to obtain the original angular displacement field corresponding to the hot stamping area. In addition, the original angular displacement field also includes the common angle response that can be explained by the overall posture change of the inspected cultural and creative design product and the spatial non-common angle response generated by the local geometric changes of the hot stamping surface.
[0047] When the cultural and creative design product under inspection is tilted outwards, even if the hot stamping surface itself does not have local deformation, the centers of equilibrium at each inspection location will change according to a common rigid posture relationship. Therefore, this embodiment needs to first obtain the angle response that can be explained by the common rigid tilt of the whole product from the original equilibrium angular displacement field, and then use the remaining angle change to characterize the local directional change of the hot stamping surface. That is, after subtracting the contribution of the overall tilt from the angular displacement, what remains is the true local slope change of the hot stamping surface.
[0048] The inverse deduction of the aforementioned local directional changes requires a solution based on specular reflection geometry. Before performing specular reflection geometry calculations, it is necessary to unify the vector direction conventions and coordinate systems: the observation direction points from the measured surface position to the fixed imaging device, the illumination direction points from the measured surface position to the controllable direction illumination device, and the surface normal points to the outside of the product surface. In this embodiment, the observation direction, illumination direction, and surface normal are all represented by unit vectors; the unit vectors of the normal, observation direction, and illumination direction participating in the same specular reflection geometry calculation are all converted to the detection device coordinate system; and under the above direction conventions, the unit vector of the surface normal during specular reflection is located in the illumination... The angle bisector between the unit vector of the illumination direction and the unit vector of the observation direction; accordingly, the result of normalizing (length reduced to 1) the sum of the actual illumination direction corresponding to the reference equilibrium center of each reference spatial position and the reference observation direction corresponding to the corresponding reference spatial position, is the reference optical normal of the corresponding reference spatial position. That is, the specular reflection geometry refers to the angle bisector between the illumination direction and the observation direction of the surface normal; the reference optical normal is used to describe the optical orientation state of the qualified hot stamping reference sample in the detection device, and the independently measured reference surface slope is used as the actual geometric reference of the qualified hot stamping reference sample.
[0049] To determine the angular response corresponding to this common rigid tilt, this embodiment models it as a global rigid rotation. Since the out-of-plane global tilt only involves rotation around the X-axis and Y-axis of the product surface, the two tilt angles that allow the original equilibrium angular displacement of the hot stamping area to be inspected to be explained by the same rigid tilt relationship are defined as equivalent global rigid attitude variables. To avoid ambiguity in the rotation order, the positive rigid rotation is fixed as first rotating around the X-axis of the product surface coordinate system, and then rotating around the rotated Y-axis. This embodiment determines the range of two sampling tilt angles based on the out-of-plane mechanical tilt range of the product positioning station in the X-axis and Y-axis directions. Within this range, a search is conducted to optimally fit the angular displacement explained by the rigid rotation corresponding to the equivalent overall rigid attitude variable with the common rigid tilt response in the original balanced angular displacement field, thereby separating the overall tilt contribution. The remaining angular displacement is used to characterize the local directional change of the hot stamping surface. The out-of-plane mechanical tilt range in the X-axis direction refers to the maximum out-of-plane tilt deviation range around the X-axis after product clamping, determined by the mechanical positioning accuracy of the product positioning station. The out-of-plane mechanical tilt range in the Y-axis direction refers to the maximum out-of-plane tilt deviation range around the Y-axis after product clamping, determined by the mechanical positioning accuracy of the product positioning station.
[0050] The fixed search step size for the sampling tilt angle is determined using the established angle calibration relationship. The specific determination process is as follows: The positive Z-axis direction at the origin of the product surface coordinate system is taken as the nominal surface normal, and the reference observation direction corresponding to the origin of the product surface coordinate system is obtained according to the camera calibration relationship. Based on the nominal surface normal, the reference observation direction, and the specular reflection geometry (the normal is the angle bisector of the illumination direction and the observation direction), the illumination direction deduced is the nominal illumination direction corresponding to the origin of the product surface coordinate system. In the angle calibration relationship, the sampling illumination angle point corresponding to the actual illumination direction with the smallest spatial angle to the nominal illumination direction is selected as the initial illumination angle point. The initial illumination angle point is moved along the positive direction of the first illumination angle direction by the preset rotation sampling step size corresponding to the first angle adjustment axis. The resulting sampling illumination angle point is denoted as W1+. The initial illumination angle point is moved along the positive direction of the second illumination angle direction by the second angle adjustment axis. The sampling illumination angle point obtained by the preset rotation sampling step size corresponding to the degree adjustment axis is denoted as W2+; the second illumination angle of W1+ is the second illumination angle of the initial illumination angle point, and the first illumination angle of W1+ is obtained by moving the initial illumination angle point along the positive direction of the first illumination angle direction by the preset rotation sampling step size corresponding to the first angle adjustment axis. The same applies to W2+. The nominal surface normal rotation angle calculated based on the sampling illumination angle point W1+, the reference observation direction corresponding to the origin of the product surface coordinate system, and the specular reflection geometry is denoted as the first nominal surface normal rotation angle. The nominal surface normal rotation angle calculated based on the sampling illumination angle point W2+, the reference observation direction corresponding to the origin of the product surface coordinate system, and the specular reflection geometry is denoted as the second nominal surface normal rotation angle. The smaller non-zero value of the two normal rotation angles is used as the fixed search step size for both the X-axis sampling tilt angle and the Y-axis sampling tilt angle. Example of obtaining the nominal surface normal rotation angle: Assume the first and second illumination angles of the initial illumination angle point are c1 and c2, respectively, and the rotation sampling steps of the first and second angle adjustment axes are Δa and Δb, respectively. Move the initial illumination angle point along the positive direction of the first illumination angle and the second illumination angle direction, respectively, corresponding to the preset rotation sampling steps of the angle adjustment axes. The obtained W1+ is (c1+Δa,c2) and W2+ is (c1,c2+Δb). Under the premise that the reference observation direction corresponding to the origin of the product surface coordinate system and (c1+Δa,c2) are known, the normal obtained by back-reaming based on the specular reflection geometry is recorded as the first normal. Under the premise that the reference observation direction corresponding to the origin of the product surface coordinate system and (c1,c2+Δb) are known, the normal obtained by back-reaming based on the specular reflection geometry is recorded as the second normal. The angle between the first normal and the nominal surface normal is recorded as the first nominal surface normal rotation angle, and the angle between the second normal and the nominal surface normal is recorded as the second nominal surface normal rotation angle.
[0051] After determining the fixed search step size for the sampling tilt angle, sampling can be performed along both axes with a fixed search step size within the allowable out-of-plane mechanical tilt range in the X-axis and Y-axis directions to obtain multiple combinations of sampling tilt angles. Specifically, sampling is performed within the allowable out-of-plane mechanical tilt range in the X-axis direction with a fixed search step size to obtain each X-axis sampling tilt angle within the allowable out-of-plane mechanical tilt range in the X-axis direction; sampling is performed within the allowable out-of-plane mechanical tilt range in the Y-axis direction with a fixed search step size to obtain each Y-axis sampling tilt angle within the allowable out-of-plane mechanical tilt range in the Y-axis direction; the X-axis sampling tilt angles and Y-axis sampling tilt angles are combined in pairs to obtain multiple sampling tilt angle points; the first parameter of each sampling tilt angle point is the X-axis sampling tilt angle, and the second parameter is the Y-axis sampling tilt angle; and in this embodiment, sampling can be performed sequentially with a fixed search step size, starting from the initial parameter of the allowable out-of-plane mechanical tilt range.
[0052] After obtaining each sampling tilt angle point, the simulated candidate illumination direction of each test spatial position under each sampling tilt angle point is obtained. This embodiment takes the acquisition process of the simulated candidate illumination direction of each test spatial position under any sampling tilt angle point AS as an example. The specific acquisition process is as follows: the X-axis sampling tilt angle and Y-axis sampling tilt angle of the sampling tilt angle point AS are recorded as X1 and Y1 respectively. After transforming the reference optical normal of the reference spatial position corresponding to each test spatial position to the surface coordinate system, it is rotated by X1 degrees around the X-axis and then rotated by Y1 degrees around the rotated Y-axis. After transforming back to the detection device coordinate system, the optical normal obtained is recorded as the rotated optical normal of the test spatial position corresponding to the sampling tilt angle point AS. This step is used to simulate that the local shape of the hot stamping surface remains unchanged and only the whole product remains unchanged. When a common out-of-plane tilt occurs, the optical direction changes at each spatial position; and given the known optical normal of a certain spatial position under the sampling tilt angle AS after rotation, and the observation direction of that spatial position, based on the specular reflection geometry, an illumination direction that allows the reflected light to enter the fixed imaging device can be deduced. The deduced illumination direction is the simulated candidate illumination direction for that spatial position under the sampling tilt angle AS. Therefore, in this embodiment, within the out-of-plane mechanical tilt range of the X and Y directions, a set of discrete sampling tilt angles are taken out according to a fixed search step size. Each sampling tilt angle in the X direction and each sampling tilt angle in the Y direction are combined in pairs to form a two-dimensional, finite number of sampling tilt angles. The subsequent overall tilt search is performed at these sampling tilt angles.
[0053] In this embodiment, to compare the simulated candidate illumination direction with the center of the plating to be inspected, it is necessary to transform the spatial direction of the simulated candidate illumination direction to the coordinate space corresponding to the two-dimensional illumination angle. Simultaneously, since the simulated candidate illumination direction is derived from the rotated reference optical normal, it may exceed the range of reachable illumination directions. Each sampling illumination angle point within the detection angle domain corresponds to an actual illumination direction according to the aforementioned angle calibration relationship. The set of all these actual illumination directions constitutes the range of reachable illumination directions corresponding to the detection angle domain. Therefore, its validity needs to be determined first: For the sampling tilt angle point AS and any plating area Q to be inspected, when the simulated candidate illumination directions of all inspected spatial positions within the plating area Q under the sampling tilt angle point AS are all located within the reachable illumination... When the direction is within the range, the sampling tilt angle point AS is recorded as the effective sampling tilt angle point of the hot stamping area Q to be inspected, and the angle between the simulated candidate illumination direction of the inspected spatial position in the hot stamping area Q under the sampling tilt angle point AS and the actual illumination direction corresponding to each sampling illumination angle point in the detection angle domain is calculated to obtain the candidate equilibrium center of each inspected spatial position in the hot stamping area Q under the sampling tilt angle point AS; when there is a simulated candidate illumination direction that exceeds the range of reachable illumination direction among all the simulated candidate illumination directions of the inspected spatial positions in the hot stamping area Q under the sampling tilt angle point AS, the sampling tilt angle point AS is determined to be invalid for the hot stamping area Q to be inspected, and the sampling tilt angle point AS does not participate in the subsequent overall rigid attitude fitting of the hot stamping area Q to be inspected.
[0054] The process for determining the candidate rebalancing center of any spatial location under inspection within the hot stamping area Q at any valid sampling tilt angle is as follows: Among the angles between the simulated candidate illumination direction of the spatial location under inspection at that valid sampling tilt angle and the actual illumination direction corresponding to each sampling illumination angle point within the detection angle domain, the sampling illumination angle point corresponding to the actual illumination direction with the smallest angle is selected as the candidate rebalancing center of the spatial location under inspection at that valid sampling tilt angle. Furthermore, when there are multiple sampling illumination angle points corresponding to the actual illumination direction with the smallest angle among the angles between the simulated candidate illumination direction of the spatial location under inspection at that valid sampling tilt angle and the actual illumination direction corresponding to each sampling illumination angle point within the detection angle domain, all sampling illumination angle points corresponding to the actual illumination direction with the smallest angle are selected as candidate objects, and the candidate rebalancing center of the spatial location under inspection at that valid sampling tilt angle is determined according to the aforementioned angle ascending priority rule.
[0055] In this embodiment, after obtaining the candidate rebalancing centers of each inspected spatial position within each effective sampling tilt angle point of each inspected hot stamping area, the rigid attitude angle response components of each inspected spatial position within each inspected hot stamping area under each effective sampling tilt angle point are further illustrated using any effective sampling tilt angle point of the hot stamping area Q as an example: the two-dimensional angle difference between the candidate rebalancing centers of each inspected spatial position within the hot stamping area Q under the effective sampling tilt angle point and the reference rebalancing center of the reference spatial position belonging to the same physical location is calculated, and this difference is used as the rigid attitude angle response component of the corresponding inspected spatial position within the hot stamping area Q under the effective sampling tilt angle point; a certain rebalancing center... The two-dimensional angle difference between the equilibrium center t1 and another equilibrium center t2 is: the two-dimensional angle difference formed by subtracting the first illumination angle of t2 from the first illumination angle of t1 and the second illumination angle of t2 from the second illumination angle of t1. This is the two-dimensional angle difference between the equilibrium center t1 and the equilibrium center t2. The rigid attitude angle response component of each space position under each effective sampling tilt angle point in each hot stamping area reflects how much the candidate equilibrium center at the corresponding space position will shift relative to the reference equilibrium center when the overall tilt attitude of the whole product is the effective sampling tilt angle point. Its function is to calculate how much angular displacement the overall tilt contributes. After that, it is subtracted from the total angular displacement, and what remains is the local morphological change.
[0056] In this embodiment, after obtaining the rigid attitude angle response components of each spatial position to be inspected under each effective sampling tilt angle point, the objective function value corresponding to each hot stamping area to be inspected is calculated for each effective sampling tilt angle point. For each hot stamping area to be inspected, the effective sampling tilt angle point with the smallest objective function value is taken as the equivalent overall rigid attitude variable of the corresponding hot stamping area to be inspected. In addition, if the number of minimum values in the set of objective function values corresponding to a certain hot stamping area to be inspected under all effective sampling tilt angle points is greater than 1, then the set of all effective sampling tilt angle points corresponding to each minimum objective function value in the objective function value set is denoted as the set of effective sampling tilt angle points to be selected. The sum of the absolute values of the coordinates of each effective sampling tilt angle point in this set is calculated and denoted as the representative value of the corresponding effective sampling tilt angle point. The effective sampling tilt angle point with the smallest representative value in this set is selected as the equivalent overall rigid attitude variable of the hot stamping area to be inspected. If the number of effective sampling tilt angle points with the smallest representative value is also greater than 1, then for all effective sampling tilt angle points with the smallest representative value... For each sampling tilt angle point, the effective sampling tilt angle point with the smallest X-axis sampling tilt angle is selected first. If multiple effective sampling tilt angle points with the smallest X-axis sampling tilt angle still exist, the effective sampling tilt angle point with the smallest Y-axis sampling tilt angle among these is selected as the equivalent overall rigid attitude variable of the hot stamping area to be inspected. Since no two sampling tilt angle points in this embodiment will be equal in both the X-axis and Y-axis sampling tilt angles simultaneously, the above comparison process will inevitably yield a unique equivalent overall rigid attitude variable. The sum of the absolute coordinate values of any effective sampling tilt angle point refers to the sum of the absolute values of each coordinate of that effective sampling tilt angle point. In addition, if no effective sampling tilt angle point exists in a hot stamping area to be inspected, the detection result of the corresponding hot stamping area to be inspected is directly marked as invalid, and morphology restoration is stopped.
[0057] Since the method for obtaining the objective function value of each hot stamping area under different effective sampling tilt angles is the same, for ease of understanding, this embodiment uses any effective sampling tilt angle. The process of obtaining the objective function value corresponding to any hot stamping area Q to be inspected is described using the example of effective sampling tilt angle points. The specific process for calculating the objective function value corresponding to the hot stamping area Q to be inspected is as follows: The original equilibrium angular displacement of each spatial position to be inspected within the hot stamping area Q is compared with the effective sampling tilt angle. The summation of the squares of the Euclidean norms of the rigid attitude angle response components corresponding to the spatial position to be tested is denoted as the effective sampling tilt angle. The objective function value corresponding to the hot stamping area Q to be inspected.
[0058] Effective sampling tilt angle The expression for the objective function value corresponding to the hot stamping area Q to be inspected is: ;in, To effectively sample tilt angle points The objective function value corresponding to the hot stamping area Q to be inspected. This represents the total number of inspectable spatial locations within the hot stamping area Q. Let be the original equilibrium angular displacement of the q-th spatial position to be inspected within the hot stamping area Q. To effectively sample tilt angle points The rigid attitude angle response component of the q-th spatial position to be inspected within the hot stamping area Q. The symbol for the Euclidean norm is the superscript number (+). This represents the squared value of the Euclidean norm, and the summation represents the cumulative fitting error of all spatial positions within the hot stamping area Q to be inspected. Furthermore... The larger the value, the higher the effective sampling tilt angle. The worse the fitting effect, the less it can represent the true overall tilt of the hot stamping area Q under test, and the more difficult it is to be selected as the equivalent overall rigid attitude variable. The smaller the value, the better the fitting effect, the better it can characterize the true overall tilt of the hot stamping area Q under test, and the closer it is to the equivalent overall rigid attitude variable.
[0059] After determining the equivalent overall rigidity attitude variable of each hot stamping area to be inspected, the candidate equilibrium center of each spatial position to be inspected within each hot stamping area to be inspected under the equivalent overall rigidity attitude variable of the corresponding hot stamping area to be inspected is denoted as the rigidity prediction equilibrium center of the corresponding spatial position to be inspected; the equivalent overall rigidity attitude variable is a valid sampling tilt angle point; for example, for any spatial position to be inspected w0, if the spatial position to be inspected w0 belongs to the hot stamping area Q to be inspected, the equivalent overall rigidity attitude variable of the hot stamping area Q to be inspected is a valid sampling tilt angle point. In that case, the effective sampling tilt angle points obtained above The candidate equilibrium center of the spatial location w0 to be tested is the rigid predicted equilibrium center corresponding to the spatial location w0 to be tested. After obtaining the rigid predicted balance center, the two-dimensional angle difference between the rigid predicted balance center of each inspected spatial position and the reference balance center of the corresponding physical location is calculated and used as the overall rigid attitude response component of the corresponding inspected spatial position. The two-dimensional angle difference between the original balance angular displacement of each inspected spatial position and the overall rigid attitude response component of the corresponding inspected spatial position is used as the local balance residual angular displacement of the corresponding inspected spatial position. The calculation of the local balance residual angular displacement can also be simplified to the two-dimensional angle difference between the inspected balance center of the inspected spatial position and the rigid predicted balance center of the corresponding inspected spatial position. The local balance residual angular displacements of all inspected spatial positions within each hot stamping area are arranged according to their corresponding positions in the product surface coordinate system to obtain the local balance residual angular displacement field of the corresponding hot stamping area. The local balance residual angular displacement represents the two-dimensional angular domain change of the inspected balance center relative to the rigid predicted balance center. The local balance residual angular displacement can characterize the balance center offset caused by the local morphology change of the hot stamping surface after removing the contribution of the overall rigid tilt. Furthermore, in this embodiment, the equivalent overall rigid attitude variable represents the response component in the original complex equilibrium angular displacement field that can be explained by the common rigid tilt relationship. Spatial non-common angle changes caused by local bulges, local depressions, wrinkles, and continuous bending are retained in the local complex equilibrium residual angular displacement field.
[0060] Therefore, this embodiment can obtain the overall rigid attitude response component of the spatial position to be inspected, the local equilibrium residual angular displacement of the spatial position to be inspected, and the local equilibrium residual angular displacement field corresponding to each hot stamping area to be inspected through the above process.
[0061] Step S005: Based on the specular reflection geometry, the slope field of the inspected surface of the hot stamping area is recovered from the local equilibrium residual angular displacement field, and the height field of the inspected surface is solved according to the slope field of the inspected surface; the least squares plane fitting is performed on the height field of the inspected surface to obtain the reference fitting plane, and the surface space undulation of each hot stamping area is obtained according to the height deviation of the inspected surface height at each inspected spatial position relative to the reference fitting plane.
[0062] The slope information of the hot stamping area to be inspected reflects the surface morphology characteristics and is a key basis for determining whether there are local defects such as protrusions, depressions, and wrinkles. However, the directly measured slope is the angular offset of the balance center and cannot directly give the surface slope distribution; although the contribution of the local balance residual angular displacement has been eliminated from the overall rigid tilt, it is still in the angular domain space and needs to be further converted into surface slope information. Therefore, this embodiment restores the surface slope field of each hot stamping area to be inspected based on the balance center to be inspected and the rigid predicted balance center. The specific restoration process is as follows: Both the center of rebalancing to be inspected and the rigid prediction rebalancing center are located in the set of sampling illumination angle points that have been calibrated. Based on the angle calibration relationship, the actual illumination direction corresponding to the center of rebalancing to be inspected and the actual illumination direction corresponding to the rigid prediction rebalancing center can be read respectively, and recorded as the illumination direction to be inspected and the rigid prediction illumination direction, respectively. That is, in all the sampling illumination angle points, the actual illumination direction corresponding to the sampling illumination angle point that is exactly the same as the center of rebalancing to be inspected is the illumination direction to be inspected for the corresponding center of rebalancing to be inspected, and the actual illumination direction corresponding to the sampling illumination angle point that is exactly the same as the rigid prediction rebalancing center is the rigid prediction illumination direction for the corresponding center of rigid prediction. The result of adding and normalizing the illumination direction of the test center of each test spatial location to the observation direction of the corresponding test spatial location is denoted as the test optical normal of the corresponding test spatial location; the result of adding and normalizing the rigid prediction illumination direction of the rigid prediction test center of each test spatial location to the observation direction of the corresponding test spatial location is denoted as the rigid prediction optical normal of the corresponding test spatial location; since the test optical normal and the rigid prediction optical normal of the same test spatial location are in the same test observation geometry, the difference in direction can correspond to the local surface direction change of the test test test state relative to the common rigid attitude prediction state.
[0063] Then, using the inverse transformation relationship between the product surface coordinate system and the detection device coordinate system, the optical normal to be inspected and the rigid prediction optical normal can be transformed from the detection device coordinate system to the product surface coordinate system. The two transformed optical normals are denoted as the transformed optical normal to be inspected and the transformed rigid prediction optical normal, respectively. Then, the transformed optical normal to be inspected and the transformed rigid prediction optical normal at each inspection spatial position are subjected to inverse rigid rotation according to the equivalent overall rigid attitude variable of the hot stamping area to be inspected at the corresponding inspection spatial position. The transformed optical normal to be inspected and the transformed rigid prediction optical normal after the inverse rigid rotation are denoted as the reference optical normal to be inspected and the reference rigid prediction optical normal. The inverse rigid rotation refers to first performing the inverse rotation around the Y-axis, and then performing the inverse rotation around the Y-axis. The inverse rotation of the X-axis, for example, if a certain equivalent overall rigid attitude variable is (X3, Y3), where X3 is the angle of rotation around the X-axis during positive rotation and Y3 is the angle of rotation around the Y-axis during positive rotation, then a certain optical normal to be inspected is rotated by -Y3 degrees around the Y-axis and then by -X3 degrees around the X-axis. This allows the directional change corresponding to the common rigid attitude to be removed from the two optical normals, so that both optical normals are expressed in the product surface coordinate system corresponding to the qualified hot stamping reference sample. In this embodiment, the coordinate transformation of the three-dimensional optical normal only adopts the three-dimensional coordinate transformation relationship between the surface coordinate system and the detection device coordinate system and the three-dimensional rigid rotation relationship corresponding to the equivalent overall rigid attitude variable, and does not adopt the two-dimensional plane projection transformation relationship between the reference positioning image and the positioning image to be inspected.
[0064] In this embodiment, the unit normal in the product surface coordinate system is required to have a Z component greater than 0. Furthermore, the slope of the X-axis direction is determined by dividing the negative of the X-axis component of the unit normal by the Z-axis component, and the slope of the Y-axis direction is determined by dividing the negative of the Y-axis component of the unit normal by the Z-axis component. For example, if the optical normal of a certain spatial position to be inspected is (0.1, -0.05, 0.994), the optical slope of the X-axis direction is -0.1 / 0.994, and the optical slope of the Y-axis direction is -(-0.05) / 0.994. Then, based on the reference optical normals corresponding to each test spatial position obtained above, the test optical slope corresponding to the test spatial position is calculated. The test optical slope includes the test optical slope in the X-axis direction and the test optical slope in the Y-axis direction. The test optical slope in the X-axis direction of a certain test spatial position is the result of dividing the negative number of the X-axis component of the reference optical normal corresponding to that test spatial position by the Z-axis component of the reference optical normal corresponding to that test spatial position. The test optical slope in the Y-axis direction of that test spatial position is the result of dividing the negative number of the Y-axis component of the reference optical normal corresponding to that test spatial position by the Z-axis component of the reference optical normal corresponding to that test spatial position. Similarly, the rigid predicted optical slope corresponding to each test spatial position can be calculated based on the reference rigid predicted optical normals corresponding to each test spatial position. The rigid predicted optical slope also includes the rigid predicted optical slope in the X-axis direction and the rigid predicted optical slope in the Y-axis direction.
[0065] Next, based on the acquired optical slope and rigidity predicted optical slope corresponding to each inspected spatial position, the local slope deviation of each inspected spatial position is obtained; the local slope deviation includes horizontal axis local slope deviation and vertical axis local slope deviation; the horizontal axis local slope deviation of any inspected spatial position is the optical slope of the X-axis direction corresponding to the inspected spatial position minus the rigidity predicted optical slope of the X-axis direction corresponding to the inspected spatial position, and the vertical axis local slope deviation of any inspected spatial position is the optical slope of the Y-axis direction corresponding to the inspected spatial position minus the rigidity predicted optical slope of the Y-axis direction corresponding to the inspected spatial position; the local slope deviation is the amount of local slope change of the hot stamping surface under inspection relative to the corresponding position of the qualified hot stamping reference sample after deducting the common rigidity attitude response.
[0066] Then, the sum of the local slope deviation of the horizontal axis of each space position to be inspected and the slope of the reference surface in the X-axis direction of the reference space position belonging to the same physical location is recorded as the slope of the surface to be inspected in the X-axis direction of the corresponding space position to be inspected. The sum of the local slope deviation of the vertical axis of each space position to be inspected and the slope of the reference surface in the Y-axis direction of the corresponding reference space position to be inspected is recorded as the slope of the surface to be inspected in the Y-axis direction of the corresponding space position to be inspected. That is, the surface slope to be inspected also includes the surface slope to be inspected in the X-axis direction and the surface slope to be inspected in the Y-axis direction. The surface slopes of all the spaces to be inspected in each hot stamping area to be inspected are arranged according to the corresponding positions of each space position to be inspected in the product surface coordinate system to obtain the surface slope field of the corresponding hot stamping area to be inspected. Furthermore, this embodiment uses the reference surface slope as the actual geometric starting point for each spatial location, and takes the slope difference between the optical slope to be inspected and the rigid predicted optical slope as the local slope change relative to the geometric starting point. This allows the small non-zero slope that is allowed to exist in the qualified hot stamping reference sample itself to continue to be retained in the surface morphology restoration result.
[0067] In this embodiment, the hot stamping material type and hot stamping process specifications of the cultural and creative design product to be inspected are consistent with those of the qualified hot stamping reference sample, and it is limited to a hot stamping surface with a single, stable and repeatable primary mirror response. The angular domain difference between the equilibrium state to be inspected and the rigid predicted equilibrium state is used to characterize the local surface orientation change, while the simple difference in reflectance brightness is not used as the surface slope change.
[0068] In this embodiment, after recovering the slope field of the surface to be inspected, the height field of the surface to be inspected is obtained from the slope field, and the surface space undulation of the hot stamping area to be inspected is determined. The specific process is as follows: In this embodiment, the surface slope field of the hot stamping area to be inspected includes the rate of change of height of each inspected spatial position along the X-axis and Y-axis directions on a regular two-dimensional spatial grid; the height of each inspected spatial position is the unknown quantity, and the positive direction of the surface slope of the hot stamping area adopts the same coordinate positive direction convention as the slope of the reference surface. Since the slope represents the rate of change of height with coordinates, the height difference between two directly adjacent inspected spatial positions can be approximately represented by the product of the average slope of the two positions and the coordinate difference. Based on this, the following height difference constraint is established: For two directly adjacent inspected spatial positions R1 and R2 along any coordinate axis direction, the unknown height of the larger coordinate position in R1 and R2 is subtracted from the unknown height of the smaller coordinate position, which is the unknown height difference of R1 and R2. The product of the average slope of the inspected surfaces of R1 and R2 in the coordinate axis direction and the coordinate difference of the two positions in the coordinate axis direction is used as the height difference constraint value of R1 and R2; the unknown height and the unknown height difference are unknown quantities. In addition, no height difference constraint is established for two inspection spaces that cross the non-inspection hot stamping area.
[0069] This embodiment then uses the following method to solve the height field of the surface to be inspected: First, all the height difference constraints established above are assigned the same weight. With the goal of minimizing the sum of squared errors between the height difference to be determined and the corresponding height difference constraint value of each adjacent spatial position to be inspected under the established height difference constraints, a least squares problem is constructed. Solving this least squares problem will yield a set of relative heights for each spatial position to be inspected within each continuous hot stamping area. Since the equation system consisting only of the height difference constraints of adjacent spatial positions to be inspected only constrains the height difference between each adjacent spatial position to be inspected and does not limit the overall absolute height, the height field obtained by gradient integration has a height constant degree of freedom corresponding to the overall translation along the Z-axis. The solutions for all positions within each hot stamping area to be inspected can be obtained by superimposing the same constant on the heights of all spatial positions to be inspected within the corresponding area. Therefore, in this embodiment, an equality constraint is added during the solution process: the average value of the height to be determined for all the spatial positions to be inspected within each hot stamping area to be inspected is set to zero. This constraint can uniquely determine the overall height constant of each hot stamping area to be inspected. Finally, each spatial position to be inspected within each hot stamping area to be inspected can obtain a unique surface height, which is recorded as the surface height to be inspected. Furthermore, the surface heights to be inspected for each spatial position to be inspected within each hot stamping area to be inspected are arranged according to the corresponding positions of each spatial position to be inspected in the product surface coordinate system, thus obtaining the unique surface height field to be inspected for the hot stamping area to be inspected. For example, if a hot stamping area to be inspected contains only three adjacent spaces to be inspected, namely C1, C2, and C3, and the height difference constraint values for C1, C2, and C3 are that C2 is 0.2mm higher than C1 and C3 is 0.3mm higher than C2, then the height combinations (0, 0.2, 0.5), (1, 1.2, 1.5), and (-1, -0.8, -0.5) all satisfy the above constraints and differ from each other by only a constant, thus they cannot be uniquely determined. However, if a constraint of zero average value is added, then the unique heights of the inspected surfaces corresponding to C1, C2, and C3 are -0.233, -0.033, and 0.267mm, respectively. Furthermore, after the above processing, the height difference between any two spaces to be inspected within the hot stamping area remains unchanged, and the overall height constant only corresponds to the common translation of the inspected surfaces along the Z-axis, without changing the morphological undulation characteristics of the surface within the area. It should be noted that the hot stamping areas to be inspected are disconnected from each other, and their height difference constraints are not interconnected between the areas. Therefore, the gradient integral of each hot stamping area to be inspected has an independent overall height constant. The integral height constant between the disconnected hot stamping areas to be inspected is not interpreted as an absolute height difference. That is, the height field of the surface to be inspected obtained by solving for each hot stamping area to be inspected has an independent overall height constant. The average height of all inspected spatial positions in each hot stamping area to be inspected is zero, and there is no common absolute height reference between the areas. Therefore, in this embodiment, the difference in the overall height constant between different hot stamping areas to be inspected is not interpreted as the absolute height difference between them.
[0070] Furthermore, since the overall rigidity attitude response component is used to correct for the common directional changes caused by the overall attitude of the product in the angular domain reflectance measurement, accordingly, after the height field of the surface to be inspected is formed, a reference fitting plane is further determined for each hot stamping area to be inspected, as a reference for the overall plane corresponding to the flatness evaluation, and based on this, the height deviation field and surface space undulation amount after removing the influence of the overall attitude are obtained, as follows: First, using the surface height field corresponding to each hot stamping area to be inspected, and the surface heights of all inspected spatial positions within that area, a least-squares plane fitting is performed to obtain the reference fitting plane for each hot stamping area. This reference fitting plane characterizes the overall tilt and macroscopic posture of the corresponding hot stamping area, representing the common variable introduced by the overall rigidity of the product at the surface height of that area. Then, for each inspected spatial position within each hot stamping area, the surface height of that position is subtracted from the height of the reference fitting plane of that area at the same X and Y coordinates, yielding the height deviation of that spatial position. The height deviations of all inspected spatial positions within each hot stamping area are then arranged according to their corresponding positions in the product surface coordinate system, forming the height deviation field for each hot stamping area. Since the overall tilt and macroscopic posture have been subtracted from the reference fitting plane, the height deviation field reflects the local undulations of the surface of the product under inspection relative to the overall plane reference. It represents the spatial distribution of local protrusions, local depressions, wrinkles, or continuous bends in the hot stamping area. Finally, the maximum height deviation in the height deviation field corresponding to each hot stamping area under inspection is subtracted from the minimum height deviation to obtain the surface spatial undulation of the corresponding hot stamping area. The surface spatial undulation of each hot stamping area under inspection represents the peak and valley height range of the corresponding hot stamping area relative to the overall reference fitting plane, which can be used as an evaluation index of the flatness of the hot stamping area under inspection. The larger the surface spatial undulation, the larger the peak and valley height range of the corresponding hot stamping area under inspection relative to its reference fitting plane. That is, the more severe the surface undulation, the greater the local deformation amplitude, and the worse the flatness of the area, the more likely it is to exceed the upper limit of the quality specification and be judged as unqualified.
[0071] After obtaining the surface space undulation of each hot stamping area to be inspected, this embodiment performs a pass / fail judgment or outputs results based on whether the current quality specifications of the product specify an allowable upper limit for the surface space undulation. Firstly, when the current quality specifications of the product specify an upper limit for the allowable surface space undulation, this embodiment refers to this allowable upper limit as the qualified upper limit. At this time, the surface space undulation of each hot stamping area to be inspected is compared with the qualified upper limit: for any hot stamping area to be inspected, if the surface space undulation of the hot stamping area to be inspected is less than or equal to the qualified upper limit, the flatness of the hot stamping surface of the hot stamping area to be inspected is judged to be qualified; if the surface space undulation of the hot stamping area to be inspected is greater than the qualified upper limit, the flatness of the hot stamping surface of the hot stamping area to be inspected is judged to be unqualified.
[0072] Secondly, when the current quality specifications of the product do not specify the above-mentioned acceptable upper limit, no judgment of whether it is qualified or not will be made. Instead, the surface height field, height deviation field, and surface space undulation of each hot stamping area to be inspected will be directly output as the surface morphology inspection result.
[0073] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for detecting the surface flatness of hot stamping on cultural and creative design products, characterized in that, The method includes the following steps: Obtain the reference balance center of each reference spatial position in each reference hot stamping area on the qualified hot stamping reference sample; Obtain the cultural and creative design product to be inspected and each hot stamping area on the product to be inspected. Obtain the center of gravity for each spatial position of the product to be inspected in the same way as obtaining the reference center of gravity. For each hot stamping area to be inspected, the difference between the center of gravity for each spatial position and the corresponding reference center of gravity is used to obtain the original angular displacement of each spatial position to be inspected, and an original angular displacement field is formed. Separate and remove the overall rigid attitude response component from the original angular displacement field to obtain the local residual angular displacement field. Based on the geometric relationship of mirror reflection, the slope field of the hot stamping area to be inspected is recovered from the local equilibrium residual angular displacement field, and the height field of the surface to be inspected is solved according to the slope field of the surface to be inspected. The reference fitting plane is obtained by performing least squares plane fitting on the height field of the surface to be inspected. The surface space undulation of each hot stamping area to be inspected is obtained based on the height deviation of the surface height at each spatial position to be inspected relative to the reference fitting plane.
2. The method for detecting the surface flatness of hot stamping on cultural and creative design products as described in claim 1, characterized in that, The method for obtaining the reference equilibrium center at any reference spatial location P includes: The two adjustment axes of the angle adjustment mechanism of the controllable directional lighting device are respectively denoted as the first angle adjustment axis and the second angle adjustment axis. The angular positions of the first angle adjustment axis and the second angle adjustment axis after rotation are respectively denoted as the first lighting angle and the second lighting angle. The rotation directions of the first angle adjustment axis and the second angle adjustment axis are respectively denoted as the first lighting angle direction and the second lighting angle direction. The first angle adjustment axis and the second angle adjustment axis are rotated and sampled with a preset rotation sampling step size. The sampling angular positions of the first angle adjustment axis and the second angle adjustment axis are combined in pairs to obtain multiple sampling lighting angle points. Each sampling lighting angle point is composed of a sampling value of the first lighting angle and a sampling value of the second lighting angle. The controllable directional illumination device sequentially changes the incident illumination direction according to the sampling illumination angle point, and a surface grayscale image is acquired by a fixed imaging device at each sampling illumination angle point, which is recorded as the reference angular domain reflection image; the grayscale value of the reference spatial position P in each reference angular domain reflection image is taken as the reflection response value of the reference spatial position P under the corresponding reference angular domain reflection image, and the sampling illumination angle point corresponding to the reference angular domain reflection image with the largest reflection response value is taken as the primary mirror response position of P; A local window of sampling illumination angle points is constructed with the main mirror response position as the center, and each sampling illumination angle point in the local window of sampling illumination angle points is used as a candidate illumination center corresponding to the reference spatial position P. For the c-th candidate lighting center corresponding to the reference spatial position P, the sampling lighting angle points corresponding to the sum and difference of the k-th lighting angle and the preset rotation sampling step size of the k-th angle adjustment axis of the c-th candidate lighting center are respectively recorded as the positive neighborhood angle point and the negative neighborhood angle point of the c-th candidate lighting center along the k-th lighting angle direction, where k takes 1 and 2. Based on the reflection response values of the reference spatial position P under the positive neighborhood angle point and the negative neighborhood angle point, the complex equilibrium differential response value of the reference spatial position P along the k-th lighting angle direction at the c-th candidate lighting center is obtained, where k takes 1 and 2. The sum of squares of the complex equilibrium differential response values of the reference spatial position P along the first and second illumination angles at the c-th candidate illumination center is taken as the eigenvalue of the c-th candidate illumination center, and the candidate illumination center with the smallest eigenvalue is taken as the reference complex equilibrium center of the reference spatial position P.
3. The method for detecting the surface flatness of hot stamping on cultural and creative design products as described in claim 2, characterized in that, The expression for the complex equilibrium differential response value of the reference spatial location P along the direction of the k-th illumination angle at the c-th candidate illumination center is: ; in, For the reference spatial location P, the complex equilibrium differential response value along the k-th illumination angle direction at the c-th candidate illumination center. For the c-th candidate lighting center, The preset rotation sampling step size for the k-th angle adjustment axis. For the first The unit direction vector of the illumination angle. , These are the reflection response values of the reference spatial position P at the positive and negative neighborhood angle points, respectively.
4. The method for detecting the surface flatness of hot stamping on cultural and creative design products as described in claim 2, characterized in that, A method for separating and removing the overall rigid attitude response component from the original complex equilibrium angular displacement field to obtain a local complex equilibrium residual angular displacement field includes: Within the allowable out-of-plane mechanical tilt range in the X and Y axes, samples are taken along the two axes with a fixed search step size and combined in pairs to obtain multiple sampled tilt angle points; For any sampling tilt angle, after transforming the reference optical normal of the reference spatial position corresponding to each test spatial position to the product surface coordinate system, perform a positive rigid rotation according to the sampling tilt angle, and then transform back to the detection device coordinate system to obtain the rotated optical normal of each test spatial position under the sampling tilt angle. Based on the specular reflection geometry, the simulated candidate illumination direction of each test spatial position under the sampling tilt angle is deduced from the rotated optical normal and the test observation direction of each test spatial position. For any sampling tilt angle, if the simulated candidate illumination directions of all inspected spatial positions within a certain hot stamping area under the sampling tilt angle are all within the detection angle domain, then the sampling tilt angle is recorded as the effective sampling tilt angle of the hot stamping area under the inspection. Under the effective sampling tilt angle of each hot stamping area under the inspection, the angle between the simulated candidate illumination direction of each inspected spatial position within the corresponding hot stamping area and the actual illumination direction corresponding to each sampling illumination angle point is calculated. For each inspected spatial position, the sampling illumination angle point corresponding to the actual illumination direction with the smallest angle is selected as the effective sampling tilt angle point for the corresponding inspected spatial position. Candidate rebalancing centers for the spatial locations to be inspected; based on the candidate rebalancing centers at each effective sampling tilt angle, determine the rigid predicted rebalancing centers for each spatial location to be inspected; calculate the two-dimensional angle difference between the rigid predicted rebalancing centers for each spatial location to be inspected and the reference rebalancing centers for the corresponding reference spatial locations; obtain the overall rigid attitude response components for the corresponding spatial locations to be inspected; subtract the original rebalancing angular displacements for each spatial location to be inspected from the corresponding overall rigid attitude response components to obtain the local rebalancing residual angular displacements for each spatial location to be inspected; based on the local rebalancing residual angular displacements within each hot stamping area to be inspected, construct the local rebalancing residual angular displacement field corresponding to each hot stamping area to be inspected.
5. The method for detecting the surface flatness of hot stamping on cultural and creative design products as described in claim 4, characterized in that, The method for obtaining the rigidity prediction equilibrium center of each spatial location to be inspected includes: Calculate the two-dimensional angle difference between the candidate rebalancing center of each test spatial location under each effective sampling tilt angle and the reference rebalancing center of the corresponding reference spatial location, to obtain the rigid attitude angle response components of each test spatial location under each effective sampling tilt angle. Then, calculate the objective function value corresponding to each test hot stamping area under each effective sampling tilt angle. For each test hot stamping area, take the effective sampling tilt angle with the smallest objective function value as the equivalent overall rigid attitude variable of the corresponding test hot stamping area. Record the candidate rebalancing center of each test spatial location under the equivalent overall rigid attitude variable of its respective test hot stamping area as the rigid predicted rebalancing center of the corresponding test spatial location. Calculate the two-dimensional angle difference between the rigid predicted rebalancing center of each test spatial location and the reference rebalancing center of the corresponding reference spatial location to obtain the overall rigid attitude response components of the corresponding test spatial location. Calculate the two-dimensional angle difference between the test rebalancing center of each test spatial location and the rigid predicted rebalancing center of the corresponding test spatial location to obtain the local rebalancing residual angular displacement of each test spatial location.
6. The method for detecting the surface flatness of hot stamping on cultural and creative design products as described in claim 5, characterized in that, The objective function value corresponding to any hot stamping area under any valid sampling tilt angle point refers to the sum of the squares of the Euclidean norms of the original equilibrium angular displacements of all inspected spatial positions within the hot stamping area under the valid sampling tilt angle point and the corresponding rigid attitude angle response components of the inspected spatial positions; the specular reflection geometry refers to the direction in which the surface normal is located at the bisector of the angle between the illumination direction and the observation direction; a positive rigid rotation around the sampling tilt angle point means first rotating the X-axis sampling tilt angle of the sampling tilt angle point around the X-axis of the product surface coordinate system, and then rotating the Y-axis sampling tilt angle of the sampling tilt angle point around the rotated Y-axis; the reference optical normal is determined by the reference illumination direction and the corresponding reference observation direction based on the specular reflection geometry. The reference observation direction and the observation direction to be inspected are obtained by adding and normalizing the relationships. The camera coordinate system used for camera calibration is the detection device coordinate system. The actual illumination direction is determined by illumination angle calibration. The origin of the product surface coordinate system is the first fixed positioning feature point pre-arranged on the qualified hot stamping reference sample. The positive X-axis is the direction from the first fixed positioning feature point to the second fixed positioning feature point on the qualified hot stamping reference sample. The positive Z-axis is the direction perpendicular to the design reference plane on the surface of the qualified hot stamping reference sample and points to the outside of the sample surface. The positive Y-axis is determined by the right-hand coordinate relationship. The detection angle domain is the two-dimensional angle range covered by the sampling illumination angle point after angle calibration.
7. The method for detecting the surface flatness of hot stamping on cultural and creative design products as described in claim 5, characterized in that, A method for recovering the surface slope field of the hot stamping area to be inspected from the local equilibrium residual angular displacement field includes: Among all the sampling illumination angle points, the actual illumination direction corresponding to the sampling illumination angle point that is exactly the same as each of the centers to be tested is taken as the illumination direction to be tested for the corresponding center to be tested, and the actual illumination direction corresponding to the sampling illumination angle point that is exactly the same as each of the rigid prediction centers to be tested is taken as the rigid prediction illumination direction for the corresponding center to be tested. According to the specular reflection geometry, the illumination direction to be tested, the rigid prediction illumination direction and the corresponding observation direction of each spatial position to be tested are added and normalized to obtain the optical normal to be tested and the rigid prediction optical normal of each spatial position to be tested. The optical normal to be inspected and the rigidity predicted optical normal are transformed from the coordinate system of the detection device to the coordinate system of the product surface to obtain the transformed optical normal to be inspected and the transformed rigidity predicted optical normal. The transformed optical normal to be inspected and the transformed rigidity predicted optical normal of each spatial position to be inspected are rotated inversely according to the equivalent overall rigid attitude variable of the hot stamping area to be inspected to the corresponding spatial position to obtain the reference optical normal to be inspected and the reference rigidity predicted optical normal of each spatial position to be inspected. The inverse rigidity rotation is to first rotate in the opposite direction around the Y-axis to the corresponding tilt angle, and then rotate in the opposite direction around the X-axis to the corresponding tilt angle. The Z-axis component of the reference optical normal to be inspected and the reference rigidity predicted optical normal are taken as positive values, and the optical slope in the X-axis direction is obtained by dividing the negative number of the normal X-axis component by the normal Z-axis component. The optical slope in the Y-axis direction is obtained by dividing the negative number of the normal Y-axis component by the normal Z-axis component. The optical slope to be inspected and the rigidity predicted optical slope of each spatial position to be inspected are obtained respectively. The local slope deviation of the test optical slope at each test spatial location is obtained by subtracting the corresponding rigid predicted optical slope. The local slope deviation is then summed with the reference surface slope of the corresponding reference spatial location to obtain the test surface slope of the corresponding test spatial location. Based on the test surface slope in each test hot stamping area, a test surface slope field for each test hot stamping area is constructed.
8. The method for detecting the surface flatness of hot stamping on cultural and creative design products as described in claim 7, characterized in that, Methods for obtaining surface slope include: A regular two-dimensional spatial grid is laid out in the reference hot stamping area of the qualified hot stamping reference sample, and each grid belonging to the reference hot stamping area is taken as a reference spatial position. Using an independent three-dimensional surface topography measuring device, the surface height of each reference spatial position along the Z-axis of the product surface coordinate system is measured and recorded as the reference surface height. For any reference spatial position P, the adjacent reference spatial positions along the positive and negative X-axis directions of P are denoted as P1+ and P1-, respectively. The slope of the reference surface of P in the X-axis direction is obtained by subtracting the reference surface height of P1- from the reference surface height of P1+ and then dividing by the difference between the x-coordinates of P1+ and P1-. The slope of the reference surface of P in the Y-axis direction is obtained by subtracting the reference surface height of P2- from the reference surface height of P2+ and then dividing by the difference between the y-coordinates of P2+ and P2-.
9. The method for detecting the surface flatness of hot stamping on cultural and creative design products as described in claim 1, characterized in that, The method for solving the height field of the surface under inspection based on the slope field of the surface under inspection includes: For two directly adjacent inspected spatial positions along the X-axis and Y-axis within the same hot stamping area to be inspected, height difference constraints are established respectively: For two directly adjacent inspected spatial positions R1 and R2 along any coordinate axis, the required height of the larger coordinate position in R1 and R2 is subtracted from the required height of the smaller coordinate position in that coordinate axis direction, and the result is the required height difference between R1 and R2; The product of the average slope of the inspected surfaces of R1 and R2 in that coordinate axis direction and the difference between their coordinates in that coordinate axis direction is used as the height difference constraint value for R1 and R2. All established height difference constraints are assigned the same weight. A least squares problem is constructed with the objective of minimizing the sum of squared errors between the desired height difference of each adjacent inspected spatial position and its corresponding height difference constraint value. An equality constraint is added to the least squares problem to make the average value of the desired height of all inspected spatial positions in each inspected hot stamping area zero. The least squares problem is then solved to obtain the unique inspected surface height of each inspected spatial position in each inspected hot stamping area. Based on the inspected surface heights in each inspected hot stamping area, an inspected surface height field is constructed for each inspected hot stamping area.
10. The method for detecting the surface flatness of hot stamping on cultural and creative design products as described in claim 1, characterized in that, A method for obtaining the surface spatial undulation of any hot stamping area to be inspected includes: For any inspected spatial position within the hot stamping area to be inspected, the height of the inspected surface at the inspected spatial position is subtracted from the height of the reference fitting plane of the hot stamping area at the X and Y coordinates of the inspected spatial position to obtain the height deviation of the inspected spatial position; the difference between the maximum height deviation and the minimum height deviation among all height deviations of the inspected spatial positions within the hot stamping area to be inspected is taken as the surface space undulation of the hot stamping area to be inspected.
