Adaptive light compensation adjustment method, device and system for product inner wall detection

CN123010305APending Publication Date: 2026-10-30SUZHOU HUAXING YUANCHUANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611181583.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-05
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]本申请为了解决如何根据成像质量自适应调节光路参数,提高内壁曲面的补光效果的问题,公开了一种用于产品内壁检测的自适应补光调节方法、装置及系统

Benefits of technology

[0014]由上述技术方案可知,本申请主光源出射的光线经可调棱镜折射形成检测光投射至产品内壁,将入射光转为侧向投射以适配内孔曲面的光照需求。成像设备采集内壁初始全景图像后提取对应成像质量参数,以此为依据迭代调整可调棱镜的空间姿态参数,通过改变折射光的投射位置与角度持续优化内壁照度分布,直至成像质量满足预设收敛条件后锁定棱镜姿态,完成自适应补光该方法以成像质量反馈驱动棱镜姿态动态调节,无需人工干预即可针对性抑制高光、补偿阴影、提升照度均匀性,既能够适配不同曲率的内孔曲面,又可保证检测过程的成像一致性,有效提升内壁微小缺陷的成像清晰度与识别准确性,适配各类封闭内孔产品的自动化质检场景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123010305A_ABST
    Figure CN123010305A_ABST
Patent Text Reader

Abstract

The application discloses an adaptive light supplement adjustment method and system for product inner wall detection, the method comprising: collecting an initial panoramic image of the inner wall of a product to be detected under irradiation of detection light by an imaging device, wherein the detection light is formed by light emitted by a main light source passing through at least one set of adjustable prisms; iteratively adjusting the spatial pose parameters of the at least one set of adjustable prisms according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets a preset convergence condition, to obtain standard spatial pose parameters; and adjusting the pose of the at least one set of adjustable prisms based on the standard spatial pose parameters to adaptively supplement light for the inner wall of the product. The application effectively improves the imaging clarity and recognition accuracy of minor defects of the inner wall, and is suitable for automatic quality inspection scenes of various closed inner hole products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of product testing technology, and in particular relates to an adaptive supplementary lighting adjustment method, device and system for product inner wall testing. Background Technology

[0002] Product internal wall defect detection is a crucial step in industrial production quality control. The surface quality of the inner wall of cylindrical closed internal structures directly affects the product's operational reliability and lifespan. Existing supplementary lighting solutions for internal wall detection often use fixed light sources with angles, projection positions, and distributions that cannot adapt to the curvature of the inner wall surface. This easily leads to problems such as localized high-brightness reflections, shadow obstruction, and uneven illumination, resulting in insufficient contrast in the imaging of micro-cracks, pinholes, and other minute defects, making them difficult to identify. Furthermore, existing supplementary lighting solutions cannot dynamically adjust the optical path parameters based on the actual imaging effect. When changing products of different specifications, the optical path must be manually adjusted repeatedly, resulting in poor adaptability and low detection consistency. This makes it difficult to meet the requirements for high-precision, blind-zone-free automated detection of closed internal curved surfaces. Summary of the Invention

[0003] To address the problem of how to adaptively adjust optical path parameters based on imaging quality to improve the supplementary lighting effect on the inner wall surface, this application discloses an adaptive supplementary lighting adjustment method, device, and system for product inner wall detection.

[0004] This application discloses an adaptive supplementary lighting adjustment method for detecting the inner wall of a product, the method comprising: An initial panoramic image of the inner wall of the product under test is acquired by an imaging device under the illumination of detection light, wherein the detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms. Based on the imaging quality parameters corresponding to the initial panoramic image of the inner wall, at least one set of adjustable prism spatial attitude parameters are iteratively adjusted until the imaging quality of the initial panoramic image meets the preset convergence condition, thereby obtaining standard spatial attitude parameters. The attitude of at least one set of adjustable prisms is adjusted based on the standard spatial attitude parameters to provide adaptive supplemental lighting to the inner wall of the product.

[0005] Optionally, the step of iteratively adjusting at least one set of adjustable prism spatial attitude parameters according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence condition to obtain standard spatial attitude parameters includes: Extract the imaging quality parameters of the initial panoramic image of the inner wall and construct the imaging quality loss function; update the spatial attitude parameters of each adjustable prism according to the prism refraction optical mapping relationship and the imaging quality loss function; Acquire panoramic images of the inner wall after updating the spatial attitude parameters, calculate the corresponding imaging quality loss function value, and determine whether the preset convergence condition is met. If not, repeatedly update the spatial attitude parameters of each adjustable prism until the imaging quality of the panoramic image of the inner wall meets the preset convergence condition.

[0006] Optionally, the step of extracting the imaging quality parameters of the initial panoramic image of the inner wall and constructing the imaging quality loss function includes: Extract the brightness distribution data of the initial panoramic image of the inner wall; calculate the brightness uniformity, highlight suppression, and shadow filling based on the brightness distribution data; An image quality loss function is generated based on the brightness uniformity, highlight suppression, shadow filling, and their respective weighting coefficients.

[0007] Optionally, updating the spatial attitude parameters of each adjustable prism based on the prism refractive optical mapping relationship and the imaging quality loss function includes: Based on the prism refraction law, a geometric mapping relationship is established between the prism's spatial attitude parameters and the landing point position on the inner wall. Calculate the rate of change of the imaging quality loss function with respect to the spatial attitude parameters of each prism; Based on the preset learning rate and the rate of change, the spatial attitude parameters of each adjustable prism are adjusted, including the prism's height, rotation angle, and tilt angle.

[0008] Optionally, the process of acquiring the updated panoramic image of the inner wall with the acquired spatial attitude parameters, calculating the corresponding imaging quality loss function value, and determining whether a preset convergence condition is met, if not, repeatedly updating the spatial attitude parameters of each adjustable prism until the imaging quality of the panoramic image of the inner wall meets the preset convergence condition, includes: Acquire panoramic images of the inner wall after updating the prism space attitude parameters, extract the corresponding imaging quality parameters, and calculate the current imaging quality loss function value; Calculate the difference between the current imaging quality loss function value and the imaging quality loss function value of the previous iteration; Determine whether the difference is less than a preset convergence threshold. If it is less, it is determined that the preset convergence condition is met, and the current prism spatial attitude parameters are output as standard spatial attitude parameters. Otherwise, the spatial attitude parameters of each adjustable prism are updated repeatedly.

[0009] Optionally, while updating the spatial attitude parameters of each adjustable prism, perform the following steps: Adjust the height and pitch angle of the main light source according to the imaging quality loss function.

[0010] Optionally, the adjustable prisms are configured in multiple groups, and updating the spatial attitude parameters of each adjustable prism includes: Establish the correspondence between the circumferential region of the inner wall and each set of adjustable prisms; adjust the spatial attitude parameters of the corresponding set of adjustable prisms according to the imaging quality parameters corresponding to each region.

[0011] Another aspect of this application discloses a method for detecting defects on the inner wall of a product, the method comprising: Set the position of the product to be tested to the predetermined detection position; The attitude of at least one set of adjustable prisms is adjusted based on standard spatial attitude parameters. The standard spatial attitude parameters are obtained by acquiring an initial panoramic image of the inner wall of the product under test under the illumination of detection light through an imaging device, and iteratively adjusting the spatial attitude parameters of at least one set of adjustable prisms according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence conditions. The detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms. An imaging device is used to acquire a panoramic image of the inner wall of the product under test, under the illumination of the detection light formed by the light emitted from the main light source and at least one set of adjustable prisms. Based on the panoramic image of the inner wall, suspected defect areas of the inner wall are identified to complete defect detection.

[0012] This application further discloses an adaptive supplementary lighting adjustment device for detecting the inner wall of a product, the device comprising: The image acquisition module is used to acquire an initial panoramic image of the inner wall of the product under test under the illumination of the detection light through an imaging device. The detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms. The iterative adjustment module is used to iteratively adjust at least one set of spatial attitude parameters of adjustable prisms according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence condition, thereby obtaining standard spatial attitude parameters. The supplementary lighting control module is used to adjust the attitude of at least one set of adjustable prisms based on the standard spatial attitude parameters to provide adaptive supplementary lighting to the inner wall of the product.

[0013] This application also discloses a product testing system, including an imaging device, a main light source, at least one set of adjustable prisms, and an adaptive supplementary lighting adjustment device as described above.

[0014] As can be seen from the above technical solution, the light emitted from the main light source of this application is refracted by an adjustable prism to form detection light and projected onto the inner wall of the product, converting the incident light into lateral projection to adapt to the illumination requirements of the inner hole curved surface. After the imaging device acquires the initial panoramic image of the inner wall, it extracts the corresponding imaging quality parameters. Based on this, iteratively adjusts the spatial attitude parameters of the adjustable prism. By changing the projection position and angle of the refracted light, it continuously optimizes the illuminance distribution of the inner wall until the imaging quality meets the preset convergence condition and then locks the prism attitude, completing the adaptive supplementary lighting. This method uses imaging quality feedback to drive the dynamic adjustment of the prism attitude, which can suppress highlights, compensate for shadows, and improve the uniformity of illumination without manual intervention. It can adapt to inner hole curved surfaces with different curvatures and ensure the imaging consistency of the detection process, effectively improving the imaging clarity and recognition accuracy of small defects on the inner wall, and is suitable for automated quality inspection scenarios of various closed inner hole products. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 An overall flowchart of the adaptive supplementary lighting adjustment method for detecting the inner wall of a product provided in an embodiment of this application; Figure 2 A flowchart illustrating the iterative adjustment of the spatial attitude parameters of an adjustable prism based on imaging quality parameters, provided in an embodiment of this application; Figure 3 A flowchart for extracting imaging quality parameters and constructing an imaging quality loss function provided in an embodiment of this application; Figure 4 A flowchart illustrating the process of updating prism spatial attitude parameters based on prism refraction optical mapping relationship and imaging quality loss function, provided for embodiments of this application. Figure 5 This is a schematic diagram of a single-prism group transmission illumination optical path provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structural relationship of the core components of adaptive supplementary lighting provided in the embodiments of this application; Figure 7(a) is a schematic diagram of the rotation angle β of the single prism group provided in the embodiment of this application; Figure 7(b) is a schematic diagram of the tilt angle α of the single prism group provided in the embodiment of this application; Figure 8 A flowchart illustrating the iterative convergence determination process provided in this application embodiment; Figure 9A flowchart illustrating a product inner wall defect detection method provided in this application embodiment; Figure 10 This is a functional module structure diagram of an adaptive supplementary lighting adjustment device for detecting the inner wall of a product, provided in an embodiment of this application. Detailed Implementation

[0017] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not limiting, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without such specific details.

[0018] This application discloses, on the one hand, an adaptive supplementary lighting adjustment method for detecting the inner wall of a product, such as... Figure 1 As shown, the method includes: S100: Acquire an initial panoramic image of the inner wall of the product under test under the illumination of detection light using an imaging device. The detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms.

[0019] S200: Iteratively adjust at least one set of adjustable prism spatial attitude parameters according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence condition, and obtain standard spatial attitude parameters.

[0020] S300: Adjust the attitude of at least one set of adjustable prisms based on the standard spatial attitude parameters to provide adaptive supplementary lighting to the inner wall of the product.

[0021] This application provides an adaptive supplementary lighting adjustment method for detecting defects on the inner walls of products. This method can be applied to the detection of surface defects on the inner walls of products with closed internal holes. It can adjust the optical path before imaging defects such as microcracks, pinholes, paint peeling, and surface scratches on the inner walls of the product to improve imaging quality. In this embodiment, a motor stator is used as an example. The motor stator has a hollow cylindrical structure with a continuous curved inner wall. During the detection process, the imaging device is positioned directly above the inner hole of the stator, allowing for full-area imaging without needing to penetrate the inner hole.

[0022] Specifically, an imaging device acquires an initial panoramic image of the inner wall of the product under test under the illumination of the detection light. The detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms. Before acquiring the initial panoramic image of the inner wall, the product under test can be fixed on a drivable support mechanism. The support mechanism can drive the product under test to rotate circumferentially and translate axially, setting the product under test to a predetermined detection position to cooperate with the imaging device to complete the full-area scanning imaging of the inner wall. The main light source is positioned below the imaging device, and the main light source and the imaging device can be respectively positioned on the upper and lower sides of the product under test, aligned with the central axis of the inner hole of the product under test. The light emitted from the main light source propagates downward along the axis of the inner hole. At least one set of adjustable prisms is positioned in the light path below the main light source. The prisms are made of a light-transmitting material and can refract the incident light, changing the direction of light propagation. This causes the light, which originally propagates along the axis, to be deflected to the side and projected onto the curved surface of the inner wall of the product under test, forming the illumination light required for detection, i.e., the detection light.

[0023] For example, for a motor stator with a set inner diameter, the height of the main light source is set to the corresponding value during initial configuration. The initial height, rotation angle, and tilt angle of the adjustable prism are also set to their corresponding initial values. This ensures that the refracted detection light can cover the corresponding area around the inner wall, guaranteeing that all areas of the inner wall receive basic illumination in the initial state, allowing the imaging device to acquire a complete image of the inner wall. The initial parameters can be preset with reference to the inner diameter and reflective characteristics of the inner wall material of the product under test, or the standard spatial attitude parameters of a product of the same specification after historical adjustment can be used as the initial values.

[0024] Specifically, the imaging equipment employs a linear array scanning method. When acquiring the initial panoramic image of the inner wall, the supporting mechanism drives the product under test to rotate circumferentially at a set speed, while simultaneously translating at a uniform speed along the inner hole axis. The imaging equipment acquires image data of the inner wall line by line at a set scanning frequency. After acquisition, the image data from each line are stitched together to form a complete, unfolded initial panoramic image of the inner wall. This initial panoramic image covers the entire circumferential and axial areas of the inner wall of the product under test, comprehensively reflecting the imaging brightness and surface condition at each location. It should be noted that the formation of the detection light relies on the cooperation of the main light source and the adjustable prism. The main light source provides the basic incident light, and the adjustable prism controls the propagation direction of the refracted light by changing its own orientation, thereby controlling the projection position, illumination angle, and light intensity distribution of the detection light on the inner wall. Unlike directly illuminating the inner wall with a ring light source, the detection light formed by prism refraction allows for flexible adjustment of the illumination angle. The incident angle can be adjusted according to the normal direction at different locations on the curved surface to reduce specular reflections and provide directional supplementary lighting for shadowed areas. Ring light sources have a fixed light emission angle and can only be adapted to inner walls with a single curvature. When the curvature of the inner wall changes, it is easy to cause problems such as local over-brightness or local under-brightness. Adjustable prisms, on the other hand, can be adjusted in posture to adapt to curved surfaces with different curvatures, making them more widely applicable.

[0025] In alternative implementations, such as Figure 2 As shown, the step of iteratively adjusting the spatial attitude parameters of at least one set of adjustable prisms according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence condition, and obtaining the standard spatial attitude parameters, includes: S210: Extract the imaging quality parameters of the initial panoramic image of the inner wall and construct the imaging quality loss function; update the spatial attitude parameters of each adjustable prism according to the prism refraction optical mapping relationship and the imaging quality loss function. S220: Acquire panoramic images of the inner wall after updating the spatial attitude parameters, calculate the corresponding imaging quality loss function value, and determine whether the preset convergence condition is met. If not, repeatedly update the spatial attitude parameters of each adjustable prism until the imaging quality of the panoramic image of the inner wall meets the preset convergence condition.

[0026] In this embodiment, at least one set of adjustable prism spatial attitude parameters are iteratively adjusted based on the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets a preset convergence condition, thus obtaining standard spatial attitude parameters. After obtaining the initial panoramic image of the inner wall, the image is processed to extract the corresponding imaging quality parameters. These imaging quality parameters are used to quantitatively characterize the illumination effect and imaging sharpness of the inner wall image and serve as the basis for adjusting the prism attitude. The iterative adjustment process is a closed-loop process. After each adjustment of the prism attitude, the inner wall image is re-acquired and the imaging quality parameters are calculated. It is determined whether the convergence condition is met. If not, the adjustment continues until the condition is met, at which point the adjustment stops, and the prism attitude parameters at this point are output as standard spatial attitude parameters. Adjusting the spatial attitude of the prism according to the standard spatial attitude parameters can improve the illumination quality of the detection light on the inner wall of the product under test, thereby improving the accuracy of defect detection.

[0027] Specifically, the iterative adjustment of the adjustable prism's spatial attitude parameters involves extracting imaging quality parameters and constructing an imaging quality loss function, updating the adjustable prism's spatial attitude parameters based on the refractive optical mapping relationship and the imaging quality loss function, acquiring the updated image, and performing a convergence determination. If the convergence condition is not met, the above process is repeated cyclically, forming a complete closed-loop iterative process.

[0028] For example, the process of extracting imaging quality parameters from the initial panoramic image of the inner wall and constructing an imaging quality loss function first involves extracting brightness distribution data from the image. This brightness distribution data represents the imaging brightness values ​​corresponding to various locations on the inner wall, presented in two-dimensional form corresponding to the circumferential and axial positions of the inner wall, reflecting the brightness differences in different areas of the inner wall. Based on the brightness distribution data, brightness uniformity, highlight suppression, and shadow filling can be calculated to evaluate image quality. Brightness uniformity is the degree of consistency in brightness across different areas of the inner wall; the smaller the brightness difference, the higher the brightness uniformity value, indicating more uniform illumination of the inner wall. Highlight suppression is the degree to which the brightness of highlight areas on the inner wall exceeds the average brightness. Highlight areas are areas on the inner wall with excessive brightness due to specular reflection; a higher highlight suppression value indicates a more severe highlight problem. Shadow filling is the degree to which the brightness of shadow areas on the inner wall is lower than the average brightness; shadow areas are areas on the inner wall with insufficient light resulting in low brightness; a higher shadow filling value indicates a more severe shadow problem.

[0029] In alternative implementations, such as Figure 3 As shown, the extraction of imaging quality parameters from the initial panoramic image of the inner wall and the construction of the imaging quality loss function include: S310: Extract the brightness distribution data of the initial panoramic image of the inner wall; calculate the brightness uniformity, highlight suppression and shadow filling based on the brightness distribution data; S320: Based on the brightness uniformity, highlight suppression, shadow filling and their respective weighting coefficients, generate an image quality loss function.

[0030] In this embodiment, the imaging quality loss function integrates brightness uniformity, highlight suppression, and shadow filling into a quantified value to comprehensively characterize the image quality. A lower loss function value indicates better overall image quality. When constructing the imaging quality loss function, corresponding weight coefficients are configured for brightness uniformity, highlight suppression, and shadow filling. The sum of the weight coefficients for brightness uniformity, highlight suppression, and shadow filling is a fixed value. The weight ratio of each indicator can be adjusted according to detection requirements. For example, for scenarios with high highlight suppression requirements, the weight coefficient corresponding to highlight suppression can be increased; for scenarios with high contrast uniformity requirements, the weight coefficient corresponding to brightness uniformity can be increased.

[0031] The imaging quality loss function is calculated as follows:

[0032] In the formula, J represents the numerical value of the imaging quality loss function, U represents brightness uniformity, H represents highlight suppression, S represents shadow filling, ω1 represents the weighting coefficient corresponding to brightness uniformity, ω2 represents the weighting coefficient corresponding to highlight suppression, and ω3 represents the weighting coefficient corresponding to shadow filling. 1-U is used to convert brightness uniformity into a positive loss term; that is, the lower the uniformity, the higher the corresponding loss value, consistent with the change direction of the other two loss terms, facilitating overall optimization. The weighting coefficients range from 0 to 1 and can be calibrated at the factory according to common detection scenarios. They can also be adjusted according to actual needs during use.

[0033] In alternative implementations, such as Figure 4 As shown, updating the spatial attitude parameters of each adjustable prism based on the prism refraction optical mapping relationship and the imaging quality loss function includes: S410: Establish the geometric mapping relationship between the spatial attitude parameters of the prism and the landing point position on the inner wall based on the prism refraction law; S420: Calculate the rate of change of the imaging quality loss function with respect to the spatial attitude parameters of each prism; S430: Adjust the spatial attitude parameters of each adjustable prism according to the preset learning rate and the change rate. The spatial attitude parameters include the height, rotation angle and tilt angle of the prism.

[0034] Specifically, after obtaining the imaging quality loss function, the spatial attitude parameters of each adjustable prism are updated based on the prism refraction optical mapping relationship and the value of the loss function. The prism refraction optical mapping relationship is used to establish the correspondence between the prism attitude parameters and the position of the light rays falling on the inner wall, clarifying how changes in the prism attitude alter the projection position and illumination angle of the detection light, and thus how they affect the illuminance distribution and imaging quality of the inner wall. The spatial attitude parameters of the prism include the prism's height, rotation angle, and tilt angle. These three parameters affect the propagation path of the outgoing light rays from different dimensions and can be adjusted independently without interference, thereby achieving control over the position of the light rays falling and the illumination angle.

[0035] Specifically, the prism height is the position of the prism along the axis of the inner hole. Changes in height alter the axial position of the light rays projected onto the inner wall. The higher the prism, the longer the path of the light rays to the inner wall, the greater the axial deflection of the refracted light, and the lower the axial position of the landing point. Conversely, the lower the prism, the shorter the path of the light rays to the inner wall, the smaller the axial deflection of the refracted light, and the higher the axial position of the landing point. The rotation angle is the angle by which the prism rotates around the axis of the inner hole. Changes in the rotation angle alter the circumferential position of the light rays projected onto the inner wall; as the rotation angle rotates, the circumferential position of the landing point rotates accordingly, allowing for corresponding adjustment in the circumferential area. The tilt angle is the angle between the light-receiving surface of the prism and the horizontal direction. Changes in the tilt angle alter the incident angle of the light rays, which in turn changes the size of the exit angle, ultimately affecting the axial position of the landing point and the incident angle of the light rays on the inner wall. A larger tilt angle results in a larger incident angle, a larger exit angle, a greater degree of lateral deflection of the light rays, a greater axial deflection of the landing point, and a larger incident angle of the light rays on the inner wall.

[0036] The law of refraction, which is satisfied by the prism refraction process, is expressed as follows: n1sinθ in =n2sinθ out In the formula, n1 represents the refractive index of the incident medium, which in this embodiment is air, and its corresponding value is 1; n2 represents the refractive index of the prism material, which is a fixed constant determined by the material used to manufacture the prism; θ in θ represents the angle of incidence of a ray on the prism's incident surface, that is, the angle between the incident ray and the normal to the incident surface; out The angle of incidence (or exit angle) represents the angle between the outgoing ray and the normal to the exit facet of the prism. The tilt angle of the prism directly determines the magnitude of the incident angle. When the tilt angle changes, the incident angle changes synchronously, which in turn changes the exit angle, ultimately altering the propagation direction of the outgoing ray. Light travels in a straight line inside the prism, undergoing two refractions at the incident and exit faces. The final exit direction is determined by the combined effect of these two refractions. The correspondence between the angle of incidence and the tilt angle of the prism can be derived geometrically.

[0037] Based on the propagation direction of the emitted light and the position parameters of the prism, the coordinates of the point where the detection light lands on the inner wall can be calculated. The landing coordinates include the circumferential angle and the axial position, and the corresponding calculation relationship is as follows: φ=β+f(θ out ,h,R) z=h tanθ out In the formula, φ represents the circumferential angle of the detection light's landing point, β represents the rotation angle of the prism, f represents the geometric mapping function determined by the exit angle, prism height, and inner hole radius, and θ out The angle of incidence of the light ray is represented by θ, h represents the height of the prism, R represents the radius of the inner hole of the product under test, z represents the axial position of the point where the detection light falls, and tanθ represents the radius of the inner hole of the product under test. out The tangent of the emission angle, multiplied by the prism height, yields the axial offset of the landing point relative to the prism position. Through this mapping relationship, the landing point position on the inner wall corresponding to each set of prism attitude parameters can be clearly determined. The geometric mapping function can be derived from the geometric constraints of the cylinder's inner wall. Combining the inner hole radius and the propagation direction of the emitted light, the circumferential angle at the intersection of the light ray and the inner wall can be calculated.

[0038] In this embodiment, the total illuminance at any location on the inner wall is the superposition of the direct illuminance and the illuminance refracted by each prism. The direct light is the light from the main light source that directly illuminates the inner wall without being refracted by the prisms, and the refracted light is the light projected onto the inner wall after being refracted by each prism. The total illuminance is calculated as follows: E(φ,z)=E direct +ΣE i(φ,z) E i(φ,z) =E0 cosγ i / r i ² δ(φ-φ i ,zz i ) In the formula, E(φ,z) represents the total illuminance at a circumferential angle of φ and an axial position of z on the inner wall; E direct ΣE represents the illuminance produced by direct light from the main light source at that location; i(φ,z) E0 represents the sum of the illuminance produced at that location by the refracted light from all the prisms; E0 represents the fundamental luminous intensity of the light emitted from the prism, a fixed value determined by the luminous intensity of the main light source and the transmittance of the prism; γ i The angle of incidence of the refracted light from the i-th prism at the point where it lands on the inner wall is represented by r, which is the angle between the ray and the normal to the inner wall surface. i Let represent the distance from the exit surface of the i-th prism to the landing point on the inner wall; δ is the impulse function, where the illuminance of the refracted light is mainly concentrated in the region near the landing point; φ iz represents the circumferential angle of the point where the refracted light falls corresponding to the i-th prism. i This represents the axial position of the point where the refracted light falls corresponding to the i-th prism. The image brightness at each position on the inner wall is positively correlated with the illuminance at that position; higher illuminance corresponds to higher image brightness. Therefore, the illuminance distribution can be changed by adjusting the prism orientation, thereby adjusting the image brightness distribution. i The term reflects the influence of the incident angle on illuminance. The smaller the incident angle, the higher the illuminance component in the normal direction, and the higher the corresponding image brightness; the larger the incident angle, the lower the illuminance component in the normal direction, and the lower the corresponding image brightness. i The term ² reflects the inverse square law of distance: the farther the distance, the lower the illuminance; the closer the distance, the higher the illuminance.

[0039] Specifically, when updating the prism space attitude parameters, gradient descent is used for adjustment. This involves calculating the partial derivatives of the imaging quality loss function with respect to each prism attitude parameter, and adjusting the prism attitude parameters based on the direction and magnitude of the partial derivatives. This gradually reduces the value of the loss function, thus optimizing the imaging quality. The partial derivative represents the rate of change of the loss function value when a certain prism parameter changes. When the partial derivative is positive, increasing the parameter will increase the loss function value, so the parameter needs to be decreased; when the partial derivative is negative, increasing the parameter will decrease the loss function value, so the parameter needs to be increased. The parameter adjustment amount is the product of the learning rate and the partial derivative. The learning rate controls the adjustment step size in each iteration. An excessively large learning rate can easily lead to iteration oscillations, while an excessively small learning rate will result in slow convergence.

[0040] The iterative update formulas for the attitude parameters of each prism are as follows:

[0041]

[0042]

[0043] It should be noted that k in the formula represents the current iteration number, and k+1 represents the next iteration; This represents the height of the i-th prism in the k-th iteration. This represents the height of the i-th prism in the (k+1)-th iteration; This represents the tilt angle of the i-th prism in the k-th iteration. This represents the tilt angle of the i-th prism in the (k+1)-th iteration; This represents the rotation angle of the i-th prism during the k-th iteration. This represents the rotation angle of the i-th prism in the (k+1)-th iteration; express The iterative learning rate, express The iterative learning rate, express The iterative learning rate is used to control the step size of parameter adjustment in each iteration, and can be set according to actual needs; It represents the partial derivative of the loss function with respect to the height of the ith prism at the k-th iteration, i.e., the rate of change of the height parameter; It represents the partial derivative of the loss function with respect to the tilt angle of the ith prism at the k-th iteration, i.e., the rate of change corresponding to the tilt angle parameter; This represents the partial derivative of the loss function with respect to the rotation angle of the ith prism at the k-th iteration, i.e., the rate of change corresponding to the rotation angle parameter. The partial derivative can be calculated using numerical differentiation, i.e., by slightly changing the value of the corresponding parameter and calculating the ratio of the change in the loss function to the change in the parameter, thus approximating the value of the partial derivative. The step size of the numerical differentiation can be set according to the adjustment range of the parameters; a step size that is too small is easily affected by noise, while a step size that is too large results in insufficient calculation accuracy.

[0044] For example, when the brightness of a certain circumferential region is too high, resulting in obvious highlights, the highlight suppression value of the corresponding region increases, and the loss function value increases. Calculating the partial derivative of the corresponding prism's tilt angle reveals that increasing the tilt angle reduces the loss function value. Therefore, adjusting the tilt angle of the corresponding prism increases the incident angle of the refracted light, causing it to deviate from the specular reflection direction, gradually reducing the brightness of the highlight region and decreasing the highlight suppression value. When the brightness of a certain region is too low, resulting in obvious shadows, the shadow filling value of the corresponding region increases, and the loss function value increases. In this case, adjusting the height and tilt angle of the corresponding prism decreases, allowing more light to be projected onto the shadow region, gradually increasing the brightness of the shadow region and decreasing the shadow filling value. When there are significant differences in brightness between regions and low uniformity, the attitude parameters of multiple prisms are adjusted simultaneously to make the brightness of each region more consistent, gradually improving brightness uniformity.

[0045] In specific examples, such as Figure 5 and Figure 6As shown, 1 is the main light source, 2 is the stator to be tested, 3 is the second prism in the single prism group, 4 is the first prism in the single prism group, and 5 is the line array camera. The illumination beam emitted by the main light source 1 is incident perpendicularly to the first prism 4 of the single prism group. After being refracted by the prism, it is laterally deflected and projected onto the inner curved surface target area of ​​the stator 2, forming an illumination spot. The diffuse reflection light from the inner wall surface carries surface texture and defect information, propagates upward along the inner hole axis, and directly enters the target surface of the line array camera 5 to complete the imaging. At the same time, the second prism 3 in the single prism group can refract and adjust some stray light or auxiliary light path as supplementary illumination or light path compensation, further improving the uniformity of the inner wall illumination. Figure 7(a) is a front view of the prism. The adjustment angle is the rotation angle β, which represents the angle of rotation of the prism around the vertical axis of the stator inner hole, used to adjust the landing point of the refracted light in the circumferential direction of the inner wall. Figure 7(b) is a side view of a single prism assembly. The adjustment angle marked in the figure is the tilt angle α, which represents the tilt angle between the normal of the prism incident surface and the vertical direction. It is used to adjust the position of the refracted light landing on the inner wall axis and the size of the incident angle.

[0046] In alternative implementations, such as Figure 8 As shown, the process involves acquiring an updated panoramic image of the inner wall with the acquired spatial attitude parameters, calculating the corresponding imaging quality loss function value, and determining whether a preset convergence condition is met. If not, the spatial attitude parameters of each adjustable prism are repeatedly updated until the imaging quality of the panoramic image of the inner wall meets the preset convergence condition. This includes: S510: Acquire panoramic images of the inner wall after updating the prism space attitude parameters, extract the corresponding imaging quality parameters and calculate the current imaging quality loss function value; S520: Calculate the difference between the current imaging quality loss function value and the previous iteration's imaging quality loss function value; S530: Determine whether the difference is less than the preset convergence threshold. If it is less, it is determined that the preset convergence condition is met, and the current prism spatial attitude parameters are output as standard spatial attitude parameters. Otherwise, the spatial attitude parameters of each adjustable prism are updated repeatedly.

[0047] Furthermore, after updating the prism attitude parameters, a new panoramic image of the inner wall is acquired under the current attitude. The corresponding imaging quality parameters are extracted, and the current imaging quality loss function value is calculated. This current loss function value is compared with the loss function value from the previous iteration to determine if the preset convergence condition is met. The convergence criterion determines whether the current imaging quality meets the expected requirements and whether continued iteration can bring a significant quality improvement. If the improvement is very small, iteration can be stopped, and the parameters locked.

[0048] The convergence criterion is as follows:

[0049] In the formula, This represents the image quality loss function value after the (k+1)th iteration. Let | represent the image quality loss function value after the k-th iteration. | indicates taking the absolute value, and ε represents the preset convergence threshold, which is a fixed positive number. Its value can be set according to the accuracy requirements of the detection. The higher the requirement for image quality, the smaller the value of the convergence threshold can be set.

[0050] During the iteration process, it is determined whether the difference is less than a preset convergence threshold. If it is less, the preset convergence condition is met, and the current prism spatial attitude parameters are output as the standard spatial attitude parameters. Otherwise, the spatial attitude parameters of each adjustable prism are repeatedly updated. This is the final step in the convergence determination. When the difference in the loss function between two iterations is less than the convergence threshold, it indicates that further adjustment of the prism parameters is unlikely to bring about a significant improvement in image quality, and the current optical path state already meets the illumination requirements for detection. At this point, the iteration process can be terminated, and the current prism spatial attitude parameters are locked as the standard spatial attitude parameters. If the difference is greater than or equal to the convergence threshold, it indicates that there is still room for further improvement in image quality. The next round of parameter updates, image acquisition, and quality evaluation needs to be performed until the convergence condition is met.

[0051] In an optional implementation, while updating the spatial attitude parameters of each adjustable prism, the height and pitch angle of the main light source are adjusted according to the imaging quality loss function.

[0052] Specifically, the height and pitch angle of the main light source, serving as the primary source of illumination, directly affect the illuminance distribution and incident angle of direct light on the inner wall. The height of the main light source refers to its position along the axis of the inner hole; changes in height alter the propagation distance and illumination range of the direct light. The pitch angle of the main light source refers to the angle between its light-emitting surface and the horizontal plane; changes in pitch angle alter the emission angle and incident angle of the direct light on the inner wall. Adjustments to the main light source parameters are also based on the image quality loss function. When the overall brightness is low, the height and pitch angle of the main light source can be adjusted to increase the basic illuminance; conversely, when the overall brightness is too high, the main light source parameters can be adjusted to decrease the basic illuminance. The adjustment of the main light source parameters works in conjunction with the adjustment of the prism's orientation. The prism primarily adjusts the illuminance distribution in localized areas, addressing localized highlights and shadows, while the main light source primarily adjusts the overall basic illuminance. Together, they achieve a superior inner wall illumination effect. In this embodiment, the adjustable prism can be configured as multiple sets, with the multiple sets of prisms evenly arranged along the circumference of the inner hole, so that the illumination of different circumferential areas can be independently adjusted.

[0053] In an optional implementation, the adjustable prisms are configured in multiple groups, and updating the spatial attitude parameters of each adjustable prism includes: Establish the correspondence between the circumferential region of the inner wall and each set of adjustable prisms; adjust the spatial attitude parameters of the corresponding set of adjustable prisms according to the imaging quality parameters corresponding to each region.

[0054] Specifically, a pre-established correspondence between the circumferential regions of the inner wall and each set of adjustable prisms can be used for zoned adjustment. Multiple sets of prisms are evenly distributed circumferentially, with each set primarily responsible for illuminating a corresponding circumferential region on the inner wall. The illumination ranges of each set of prisms may partially overlap to ensure smooth transitions in illuminance across the circumferential regions. Based on the number of prisms, the entire circumference of the inner wall is divided into a corresponding number of circumferential regions, with each circumferential region corresponding to a set of adjustable prisms, establishing a one-to-one correspondence between regions and prisms.

[0055] Adjusting the spatial orientation parameters of the corresponding adjustable prisms for each region is the execution step of zoned adjustment. The brightness uniformity, highlight suppression, and shadow filling are calculated for each circumferential region to obtain the local imaging quality parameters for each region. When a region exhibits significant highlight issues, the tilt angle and height of the corresponding prism are adjusted individually to change the incident light angle, reduce the intensity of specular reflection, and suppress highlights. When a region exhibits significant shadow issues, the rotation angle and height of the corresponding prism are adjusted individually to allow more light to reach that region, compensating for shadows. When there are large brightness differences between regions, the parameters of each prism group are adjusted individually to make the brightness of each region more uniform. This independent zoned adjustment method enables illumination control, avoids interference with other regions when adjusting one region, and improves the overall supplementary lighting effect.

[0056] Based on the same principle, such as Figure 9 As shown, this application also discloses a method for detecting defects on the inner wall of a product, the method comprising: S610: Set the position of the product to be tested to the predetermined detection position; S620: Adjust the attitude of at least one set of adjustable prisms based on standard spatial attitude parameters. The standard spatial attitude parameters are obtained by acquiring an initial panoramic image of the inner wall of the product under test under the illumination of detection light through an imaging device, and iteratively adjusting the spatial attitude parameters of at least one set of adjustable prisms according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence conditions. The detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms. S630: The imaging device acquires a panoramic image of the inner wall of the product under test under the illumination of the detection light formed by the light emitted from the main light source through at least one set of adjustable prisms, and the defect detection is completed by identifying the suspected defect area of ​​the inner wall based on the panoramic image of the inner wall.

[0057] Setting the product under test to the predetermined inspection position is a preliminary step in defect detection. The product under test is clamped and fixed onto the carrier mechanism, and its position is adjusted using a positioning mechanism to ensure that the inner hole axis of the product under test coincides with the optical axis of the imaging equipment. After positioning, the carrier mechanism moves the product under test to the inspection station.

[0058] The attitude of at least one set of adjustable prisms is adjusted based on standard spatial attitude parameters. These standard spatial attitude parameters are obtained by acquiring an initial panoramic image of the inner wall of the product under test under detection light using an imaging device. The spatial attitude parameters of at least one set of adjustable prisms are iteratively adjusted according to the imaging quality parameters corresponding to the initial panoramic image until the imaging quality of the initial panoramic image meets a preset convergence condition. The detection light, emitted from the main light source, is formed by passing through at least one set of adjustable prisms; this is the optical path preparation step for defect detection. Before formal testing, the aforementioned adaptive supplementary lighting adjustment process is executed first to obtain standard spatial attitude parameters suitable for the current product under test. Then, the attitude of each set of adjustable prisms is adjusted according to these parameters to ensure the optical path is in optimal illumination. For batch testing of products of the same specification, the standard spatial attitude parameters obtained from adjusting the first product can be applied to products of the same specification. It is not necessary to perform a complete iterative adjustment process for each product; only periodic calibration is required, which can effectively improve the efficiency of batch testing.

[0059] The core step of defect detection involves acquiring a panoramic image of the inner wall of the product under test under illumination by a detection light formed by light emitted from the main light source and passing through at least one set of adjustable prisms. This panoramic image is used to identify suspected defect areas on the inner wall, thus completing defect detection. After the optical path is adjusted, the supporting mechanism drives the product under test to rotate circumferentially and translate axially. Simultaneously, the imaging device performs a full-line scan, acquiring a panoramic image of the inner wall under optimal illumination. Image recognition algorithms analyze the panoramic image, identifying areas with abnormal grayscale or texture, marking them as suspected defect areas, and extracting information such as the location and size of these suspected defects. For the marked suspected defects, the supporting mechanism is driven to move the product under test, aligning the suspected defect area with the re-inspection station. The imaging device then performs a re-inspection to confirm the type and level of the defect, ultimately generating an inner wall quality inspection report for the product.

[0060] This application further discloses an adaptive supplementary lighting adjustment device for detecting the inner wall of a product, such as... Figure 10 As shown, the device includes: Image acquisition module 11 is used to acquire an initial panoramic image of the inner wall of the product under test under the illumination of detection light through an imaging device. The detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms. The iterative adjustment module 12 is used to iteratively adjust at least one set of spatial attitude parameters of adjustable prisms according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence condition, so as to obtain standard spatial attitude parameters. The supplementary lighting control module 13 is used to adjust the attitude of at least one set of adjustable prisms based on the standard spatial attitude parameters to provide adaptive supplementary lighting to the inner wall of the product.

[0061] Based on the same principle, the implementation of the device in this application can be referred to the implementation of the method, and will not be described in detail here.

[0062] This application also discloses a product testing system, including an imaging device, a main light source, at least one set of adjustable prisms, and an adaptive supplementary lighting adjustment device as described above.

[0063] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. An adaptive supplementary lighting adjustment method for detecting the inner wall of a product, characterized in that, The method includes: An initial panoramic image of the inner wall of the product under test is acquired by an imaging device under the illumination of detection light, wherein the detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms. Based on the imaging quality parameters corresponding to the initial panoramic image of the inner wall, at least one set of adjustable prism spatial attitude parameters are iteratively adjusted until the imaging quality of the initial panoramic image meets the preset convergence condition, thereby obtaining standard spatial attitude parameters. The attitude of at least one set of adjustable prisms is adjusted based on the standard spatial attitude parameters to provide adaptive supplemental lighting to the inner wall of the product.

2. The adaptive supplementary lighting adjustment method for product inner wall detection according to claim 1, characterized in that, The step of iteratively adjusting at least one set of adjustable prism spatial attitude parameters based on the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence condition, to obtain standard spatial attitude parameters, includes: Extract the imaging quality parameters of the initial panoramic image of the inner wall and construct the imaging quality loss function; update the spatial attitude parameters of each adjustable prism according to the prism refraction optical mapping relationship and the imaging quality loss function; Acquire panoramic images of the inner wall after updating the spatial attitude parameters, calculate the corresponding imaging quality loss function value, and determine whether the preset convergence condition is met. If not, repeatedly update the spatial attitude parameters of each adjustable prism until the imaging quality of the panoramic image of the inner wall meets the preset convergence condition.

3. The adaptive supplementary lighting adjustment method for product inner wall detection according to claim 2, characterized in that, The step of extracting the imaging quality parameters of the initial panoramic image of the inner wall and constructing the imaging quality loss function includes: Extract the brightness distribution data of the initial panoramic image of the inner wall; calculate the brightness uniformity, highlight suppression, and shadow filling based on the brightness distribution data; An image quality loss function is generated based on the brightness uniformity, highlight suppression, shadow filling, and their respective weighting coefficients.

4. The adaptive supplementary lighting adjustment method for product inner wall detection according to claim 2, characterized in that, The step of updating the spatial attitude parameters of each adjustable prism based on the prism refractive optical mapping relationship and the imaging quality loss function includes: Based on the prism refraction law, a geometric mapping relationship is established between the prism's spatial attitude parameters and the landing point position on the inner wall. Calculate the rate of change of the imaging quality loss function with respect to the spatial attitude parameters of each prism; Based on the preset learning rate and the rate of change, the spatial attitude parameters of each adjustable prism are adjusted, including the prism's height, rotation angle, and tilt angle.

5. The adaptive supplementary lighting adjustment method for product inner wall detection according to claim 2, characterized in that, The process involves acquiring an updated panoramic image of the inner wall with the acquired spatial attitude parameters, calculating the corresponding imaging quality loss function value, and determining whether a preset convergence condition is met. If not, the spatial attitude parameters of each adjustable prism are repeatedly updated until the imaging quality of the panoramic image of the inner wall meets the preset convergence condition, including: Acquire panoramic images of the inner wall after updating the prism space attitude parameters, extract the corresponding imaging quality parameters, and calculate the current imaging quality loss function value; Calculate the difference between the current imaging quality loss function value and the imaging quality loss function value of the previous iteration; Determine whether the difference is less than a preset convergence threshold. If it is less, it is determined that the preset convergence condition is met, and the current prism spatial attitude parameters are output as standard spatial attitude parameters. Otherwise, the spatial attitude parameters of each adjustable prism are updated repeatedly.

6. The adaptive supplementary lighting adjustment method for product inner wall detection according to claim 2, characterized in that, While updating the spatial attitude parameters of each adjustable prism, perform the following steps: Adjust the height and pitch angle of the main light source according to the imaging quality loss function.

7. The adaptive supplementary lighting adjustment method for product inner wall detection according to claim 2, characterized in that, The adjustable prisms are configured in multiple groups, and updating the spatial attitude parameters of each adjustable prism includes: Establish the correspondence between the circumferential region of the inner wall and each set of adjustable prisms; adjust the spatial attitude parameters of the corresponding set of adjustable prisms according to the imaging quality parameters of each region.

8. A method for detecting defects on the inner wall of a product, characterized in that, The method includes: Set the position of the product to be tested to the predetermined detection position; The attitude of at least one set of adjustable prisms is adjusted based on standard spatial attitude parameters. The standard spatial attitude parameters are obtained by acquiring an initial panoramic image of the inner wall of the product under test under the illumination of detection light through an imaging device, and iteratively adjusting the spatial attitude parameters of at least one set of adjustable prisms according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence conditions. The detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms. An imaging device is used to acquire a panoramic image of the inner wall of the product under test, under the illumination of the detection light formed by the light emitted from the main light source and at least one set of adjustable prisms. Based on the panoramic image of the inner wall, suspected defect areas of the inner wall are identified to complete defect detection.

9. An adaptive supplementary lighting adjustment device for detecting the inner wall of a product, characterized in that, The device includes: The image acquisition module is used to acquire an initial panoramic image of the inner wall of the product under test under the illumination of the detection light through an imaging device. The detection light is formed by light emitted from the main light source passing through at least one set of adjustable prisms. The iterative adjustment module is used to iteratively adjust at least one set of spatial attitude parameters of adjustable prisms according to the imaging quality parameters corresponding to the initial panoramic image of the inner wall until the imaging quality of the initial panoramic image meets the preset convergence condition, thereby obtaining standard spatial attitude parameters. The supplementary lighting control module is used to adjust the attitude of at least one set of adjustable prisms based on the standard spatial attitude parameters to provide adaptive supplementary lighting to the inner wall of the product.

10. A product testing system, characterized in that, It includes an imaging device, a main light source, at least one set of adjustable prisms, and an adaptive supplementary lighting adjustment device as described in claim 9.