Image correction method, device, system and storage medium
By combining RGB-D sensors and elastic grid models with finite element analysis and multispectral light source image correction methods, the error correction and shadow separation problems of non-planar objects are solved, real-time illumination compensation is achieved, and the accuracy and robustness of image correction are improved, making it suitable for low-cost equipment.
Patent Information
- Application Number
- CN202510712143.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-05-30
AI Technical Summary
Existing image correction technology has significant errors when processing non-planar objects, has difficulty distinguishing real content from shadow areas, cannot adapt to dynamic ambient light changes in real time, and relies on high-performance computing devices, making it difficult to achieve real-time processing in embedded terminals.
An elastic mesh model is constructed by collecting three-dimensional point cloud data using an RGB-D sensor, and geometric correction is performed using a finite element analysis algorithm. A multispectral light source is used to separate shadow areas, a generative adversarial network is used for texture restoration, and lighting parameters are adjusted in real time to form an end-to-end image correction process.
It achieves high-precision unfolding correction of non-planar objects, accurately distinguishes shadows from real content, adapts to ambient light changes in real time, improves the accuracy and robustness of image correction, is suitable for low-cost hardware, and overcomes the limitations of traditional methods.
Smart Images

Figure CN120219246B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image correction, and in particular to an image correction method, device, system and storage medium. Background Art
[0002] Current image correction technologies mainly cover geometric correction, shadow removal, and illumination compensation. In the field of geometric correction, traditional methods rely on two-dimensional image processing algorithms, such as edge detection or feature point matching to achieve affine transformation or projection transformation, adjusting tilted and curved image areas to a flat view. To address the problem of shadow interference, mainstream solutions include shadow detection based on threshold segmentation combined with histogram stretching compensation, or using deep learning models to generate content and repair shadow areas. In terms of illumination compensation, existing technologies mostly use fixed-parameter automatic white balance algorithms or manually adjust the brightness of fill lights to improve illumination uniformity. In addition, super-resolution reconstruction technology based on deep learning is also used to restore image details.
[0003] While the above methods have partially addressed basic image correction needs, they still have significant limitations in complex scenes. Traditional geometric correction methods rely on two-dimensional image features and cannot perceive the three-dimensional deformation characteristics of the target object. This leads to significant errors in the unwrapping and correction of non-planar objects such as bound books and wrinkled paper, and can easily cause texture stretching or breakage when processing curved edges. Regarding lighting processing, color threshold-based shadow segmentation algorithms struggle to distinguish between real content and shadow areas, and are particularly prone to misjudgment on low-contrast or complex surfaces, resulting in information loss or overexposure. Existing white balance and fill-lighting technologies often use fixed parameters or hysteresis response mechanisms, which are unable to adapt to dynamic ambient light changes in real time, leading to color temperature fluctuations and uneven illumination. Furthermore, purely data-driven deep learning restoration methods rely on large-scale two-dimensional training sets and lack the ability to integrate multimodal physical information (such as 3D geometry and material properties). This makes semantic distortion or logical inconsistencies prone to complex texture generation. Furthermore, they rely on high-performance computing devices, making real-time processing difficult on embedded devices. Summary of the Invention
[0004] The present invention proposes an image correction method, device, system and storage medium, aiming to reduce the error of unfolding correction of non-planar objects, efficiently distinguish real content from shadow areas, adapt to dynamic ambient light changes in real time, and improve the ability to generate complex textures.
[0005] The technical solutions of the present invention are as follows:
[0006] An image correction method comprises the following steps:
[0007] S100, uses RGB-D sensors to synchronously collect color images and 3D point cloud data of target objects;
[0008] S200, constructing an elastic mesh model of the target object based on the three-dimensional point cloud data, the elastic mesh model consisting of a discretized mesh composed of nodes, edges, and patches, wherein the nodes correspond to spatial coordinates in the three-dimensional point cloud, the edges connect adjacent nodes and assign stiffness attributes, and the patches are formed by enclosing edges and are used to calculate deformation energy;
[0009] S300, based on a finite element analysis algorithm, calculating the unfolded shape of the elastic mesh model by minimizing a deformation energy function, and generating a preliminary corrected image after surface correction;
[0010] S400, illuminating the target object with a multispectral light source, collecting reflection data in the visible light band and the near-infrared band, separating the shadow area and the real content area in the color image, and outputting a shadow area mask;
[0011] S500, inputting the preliminary corrected image and the shadow area mask into a generative adversarial network to generate a shadow-repaired image;
[0012] S600, real-time acquisition of color temperature and brightness data from the ambient light sensor, dynamic adjustment of fill light lighting parameters, and adaptive lighting compensation for the image after shadow repair;
[0013] S700: Output the target image after surface correction, shadow restoration, and illumination compensation.
[0014] In a possible implementation, in step S200, the stiffness attribute of the edge is dynamically adjusted according to the material attribute of the target object, specifically including:
[0015] Match the stiffness coefficient of the target object through the preset material database;
[0016] Alternatively, the local curvature is fitted by the three-dimensional point cloud data to dynamically adjust the stiffness property of the edge.
[0017] In a possible implementation, in step S300, the finite element analysis algorithm specifically includes:
[0018] discretizing the elastic grid model into finite element units;
[0019] Define the boundary conditions as fixed constraints on the mesh edges;
[0020] The plane coordinates of the expanded grid are calculated using the energy minimization principle.
[0021] In a possible implementation, step S300 further includes:
[0022] Inputting the preliminary corrected image and the color image into a pre-trained convolutional neural network, and outputting a fused high-precision corrected image;
[0023] The loss function of the convolutional neural network includes structural fidelity constraints and edge continuity constraints.
[0024] In a possible implementation, in step S400, the specific method of separating the shadow area is:
[0025] Calculate the reflectivity difference between the visible light band and the near-infrared band. If the brightness of a certain area in the visible light band is lower than the first threshold and the reflectivity of the near-infrared band is higher than the second threshold, it is determined to be a shadow area.
[0026] The area judged as shadow is masked.
[0027] In one possible implementation, in step S500, the generator of the generative adversarial network adopts a U-Net structure, whose input is the color image, the shadow area mask, and the real-time color temperature and brightness parameters collected by the ambient light sensor; and the output is a repaired texture consistent with the ambient lighting.
[0028] In a possible implementation, in step S600, the method for dynamically adjusting the lighting parameters of the fill light includes:
[0029] Predict the changing trend of ambient light through Kalman filter algorithm;
[0030] According to the predicted structure, the RGB channel intensity and color temperature of the fill light are adjusted so that the illumination uniformity of the target object surface reaches the preset threshold.
[0031] An image correction device, comprising:
[0032] RGB-D sensor module, which uses RGB-D sensors to simultaneously collect color images and 3D point cloud data of target objects;
[0033] An elastic mesh module constructs an elastic mesh model of the target object based on the three-dimensional point cloud data. The elastic mesh model is composed of a discretized mesh consisting of nodes, edges, and patches. The nodes correspond to spatial coordinates in the three-dimensional point cloud, the edges connect adjacent nodes and assign stiffness properties, and the patches are formed by enclosing edges and are used to calculate deformation energy.
[0034] A preliminary correction module, based on a finite element analysis algorithm, calculates the unfolded shape of the elastic mesh model by minimizing a deformation energy function, and generates a preliminary correction image after surface correction;
[0035] A multispectral light source module and a separation module illuminate the target object through a multispectral light source, collect reflection data in the visible light band and the near-infrared band, separate the shadow area and the real content area in the color image, and output a shadow area mask;
[0036] a shadow restoration module, inputting the preliminary corrected image and the shadow area mask into a generative adversarial network to generate a shadow-inpainted image;
[0037] The ambient light sensor array and illumination compensation module acquire the color temperature and brightness data of the ambient light sensor in real time, dynamically adjust the lighting parameters of the fill light, and perform adaptive illumination compensation on the image after shadow repair;
[0038] The image output module outputs the target image after surface correction, shadow repair and lighting compensation.
[0039] An image correction system, comprising:
[0040] one or more memories for storing instructions; and
[0041] One or more processors are used to call and run the instructions from the memory to perform any one of the image correction methods described above.
[0042] A computer-readable storage medium, comprising:
[0043] When the program is executed by a processor, the image correction method described in any one of the above items is executed.
[0044] The working principle and beneficial effects of the present invention are:
[0045] This technical solution, based on RGB-D sensor-based three-dimensional point cloud data and elastic mesh physical simulation, overcomes the traditional reliance of 2D geometric correction on flat surface assumptions, accurately restoring the unfolded form of curved objects and eliminating deformation errors in bound books and wrinkled paper. Secondly, multispectral shadow separation combined with GAN texture restoration distinguishes real content from shadows by using the differences in visible and near-infrared reflectance characteristics, generating physically plausible restoration textures and overcoming the misjudgment flaws of single visible light threshold segmentation. Furthermore, dynamic illumination compensation achieves millisecond-level adaptive dimming through real-time ambient light sensing and prediction algorithms, addressing the color temperature fluctuations and localized overexposure caused by traditional fixed fill lighting. Finally, the embedded end-to-end processing flow achieves high-efficiency output on low-cost hardware, breaking the deep learning model's reliance on high-performance computing equipment. Each step is closely linked, forming a complete technical closed loop from data acquisition and model construction to real-time compensation, significantly improving the accuracy and robustness of image correction in complex scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0047] Figure 1 This is a flow chart of an image correction method in Example 1;
[0048] Figure 2 This is a structural block diagram of an image correction device in Example 2. DETAILED DESCRIPTION
[0049] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present invention.
[0050] Example 1
[0051] like Figure 1 As shown, this embodiment proposes an image correction method, including the following steps:
[0052] S100 uses RGB-D sensors to synchronously collect color images and 3D point cloud data of target objects.
[0053] Step S100 synchronously acquires the color image and three-dimensional point cloud data of the target object, providing dual-modal information of geometry and texture for subsequent processing, breaking through the limitation of traditional 2D images relying on single visual data, achieving accurate modeling of the three-dimensional deformation of the object surface, and solving the problem of surface unfolding error caused by lack of depth information in two-dimensional geometric correction.
[0054] S200, constructing an elastic mesh model of the target object based on the three-dimensional point cloud data, the elastic mesh model consisting of a discretized mesh composed of nodes, edges, and patches, wherein the nodes correspond to spatial coordinates in the three-dimensional point cloud, the edges connect adjacent nodes and are assigned stiffness attributes, and the patches are formed by enclosing the edges and are used to calculate deformation energy;
[0055] Step S200 converts the target object's 3D geometry into a computable elastic mechanics model, providing structured input for subsequent physical simulations. By incorporating stiffness properties and mesh discretization, this method accurately simulates the deformation behavior of different materials (such as paper and leather), avoiding the stretching or distortion caused by traditional 2D correction methods that ignore 3D geometry. Furthermore, the elastic mesh's physical parameters (such as stiffness) can be dynamically adjusted based on the material or curvature, significantly improving the accuracy of surface unfolding. This is particularly useful for complex deformation scenarios such as bound books and wrinkled paper, laying the foundation for generating high-fidelity corrected images in subsequent steps.
[0056] S300, based on a finite element analysis algorithm, calculating the unfolded shape of the elastic mesh model by minimizing the deformation energy function, and generating a preliminary corrected image after surface correction;
[0057] Step S300 physically simulates the elastic mesh from its three-dimensional deformed state to a two-dimensional form, automatically correcting geometric distortion. Finite element analysis ensures the physical rationality of the unfolding process by minimizing energy (e.g., balancing stretching and bending energy), avoiding errors caused by human intervention. Combined with the elastic mesh's stiffness properties, it can adaptively handle local deformation differences (e.g., the different stiffness requirements of a book's center seam and flat pages), outputting a geometrically accurately proportioned two-dimensional image. This step also provides a geometric basis for subsequent shadow restoration and lighting compensation, improving the accuracy and efficiency of overall image correction.
[0058] S400: Illuminate the target object with a multi-spectral light source, collect reflection data of the visible light band and the near-infrared band, separate the shadow area and the real content area in the color image, and output a shadow area mask.
[0059] Step S400 uses the difference in reflective properties between visible light and near-infrared bands to accurately distinguish between shadow areas and real content (such as dark text and stains), greatly reducing the misjudgment rate and effectively avoiding information loss or semantic distortion caused by erroneous repair.
[0060] S500, inputting the preliminary corrected image and the shadow area mask into a generative adversarial network to generate a shadow-repaired image;
[0061] Step S500 ensures that the repaired content strictly matches the object's unfolded form by fusing the geometric correction results with multispectral shadow detection data, avoiding texture misalignment caused by residual geometric distortion in traditional methods. The mask-guided repair using a generative adversarial network can generate a fill texture that seamlessly blends in with the surrounding lighting environment, solving the edge artifacts common in threshold segmentation or interpolation repair. The complete repaired image (rather than the local fill content) is output, providing a unified processing benchmark for subsequent lighting compensation (S600), ultimately improving the visual consistency and usability (such as OCR recognition rate) of the overall image correction.
[0062] S600 obtains the color temperature and brightness data of the ambient light sensor in real time, dynamically adjusts the lighting parameters of the fill light, and performs adaptive lighting compensation on the image after shadow repair.
[0063] Step S600 dynamically adjusts the fill light parameters through real-time feedback from the ambient light sensor and Kalman filter prediction, improves the uniformity of illumination on the target surface, reduces the standard deviation of color temperature fluctuation, and overcomes the lag and instability of the fixed fill light strategy in a dynamic environment.
[0064] S700: Output the target image after surface correction, shadow restoration, and illumination compensation.
[0065] Step S700 integrates the results of geometric correction, shadow restoration, and illumination compensation to output a high-fidelity planar image, which can be directly used in high-precision scenarios such as OCR recognition and industrial inspection.
[0066] In this embodiment, in step S200, the stiffness properties of the edge are dynamically adjusted according to the material properties of the target object, specifically including:
[0067] Match the stiffness coefficient of the target object through the preset material database;
[0068] Specifically, the material database stores standard physical parameters of common materials, including but not limited to: stiffness coefficient ( E ), Poisson's ratio ( n ), bending stiffness ( k In practical applications, the material type of the target object (such as leather for a book cover) is determined through user input or image recognition, and the corresponding parameters in the database are automatically called to assign them to the mesh edges.
[0069] Or, the local curvature can be fitted through 3D point cloud data to dynamically adjust the stiffness properties of the edge.
[0070] Specifically, the local curvature is calculated as follows:
[0071] Perform moving least squares (MLS) surface fitting on the point cloud to calculate the principal curvature of each grid cell k 1 、 k 2 ;
[0072] Comprehensive curvature , stiffness coefficient E and k Positive correlation, satisfied ,in, is the base stiffness, α is the curvature weight coefficient (default 0.1).
[0073] Material database matching enables objects made of known materials (such as paper and leather) to be quickly and accurately assigned stiffness parameters that match their physical properties, ensuring the simulation accuracy of subsequent finite element analysis. Dynamic adjustment based on 3D point cloud data fitting can adaptively handle unknown materials or complex deformation areas (such as the center seam and wrinkles of a book), automatically optimizing mesh deformation behavior through the correlation between stiffness coefficient and curvature (greater curvature means higher stiffness). The combination of these two methods ensures the efficiency of common material correction while solving the problem of partition parameter optimization for mixed-material objects (such as leather covers with metal accessories). This improves the adaptability and accuracy of surface correction overall, avoiding the overstretching or distortion problems caused by uniform parameter settings in traditional methods.
[0074] In this embodiment, in step S300, the finite element analysis algorithm specifically includes:
[0075] Discretize the elastic mesh model into finite element units. Specifically, discretize the elastic mesh model into triangular or quadrilateral finite element units, each unit contains node coordinates, connection relationships and material properties (such as stiffness coefficients). E , Poisson's ratio n ). Use Delaunay triangulation or adaptive subdivision algorithms to ensure that the mesh density matches the curvature of the target object and avoid local over-sparseness or over-density.
[0076] Define the boundary condition as a fixed constraint on the mesh edge. Specifically, set the node displacement at the edge of the target object to a fixed value (such as Δ x =0,Δ y = 0), simulating the boundary constraints caused by hand-holding or binding in real-world scenarios. Furthermore, if the target object has some free edges (such as unbound book pages), some nodes can be defined as free boundaries (with variable Δx and Δy), and deformation energy can be balanced by applying virtual spring forces.
[0077] The plane coordinates of the expanded grid are calculated using the energy minimization principle. Specifically, the process includes:
[0078] Elastic potential energy modeling: Based on the material properties and deformation characteristics of the elastic mesh model, a total potential energy function including tensile energy and bending energy is constructed. The elastic potential energy of each finite element E i Includes stretching and bending classification, elastic potential energy E i The calculation formula is:
[0079] ,
[0080] in, is the element strain tensor, calculated from the nodal displacements; D is the elastic matrix, and the material parameters ( E , v ) related; k is the bending stiffness coefficient, which controls the bending resistance; is the second-order derivative of the surface, which represents the bending deformation.
[0081] Global Optimization: Solving for the total potential energy using the Newton-Raphson iteration method The minimum value of is obtained to obtain the plane coordinates after expansion. The specific steps include:
[0082] Construct Jacobian matrix and stiffness matrix;
[0083] Solving linear equations Ku = F ,in, K is the stiffness matrix, u is the node displacement vector, F is the external force vector (here the unfolding driving force);
[0084] The node coordinates are updated iteratively until convergence.
[0085] Finite element analysis uses physics-driven numerical simulation to transform the three-dimensional geometric deformation of a target object into a quantifiable mechanical model. By replacing traditional geometric interpolation with physical simulation, it eliminates deformation errors caused by ignoring the mechanical properties of materials and achieves the following core functions:
[0086] 1. High-precision surface unfolding: Minimizes the elastic potential energy based on material properties, simulating the unfolding process of real objects (such as the natural flattening of curved pages in a book), avoiding texture distortion caused by stretching and compression.
[0087] 2. Adaptive deformation compensation: Dynamically adjust physical parameters (E, ν, κ) to adapt to the correction requirements of different materials (such as soft fabric and hard plastic).
[0088] 3. Complex constraint modeling: Supports multiple scenario constraints such as fixed boundaries, free edges, and contact forces, improving the processing capabilities of special objects such as industrial parts and biological tissues.
[0089] In this embodiment, step S300 further includes:
[0090] Input the preliminary corrected image and the color image into the pre-trained convolutional neural network, and output the fused high-precision corrected image;
[0091] The preliminary correction image is a geometrically corrected image generated by physical simulation, which may retain local deformation errors or blur. The color image is the original data collected by the RGB sensor, retaining high-resolution texture and details.
[0092] In this embodiment, the convolutional neural network compensates for the idealized assumptions of the physical model by learning local deformation patterns (such as tiny wrinkles and material anisotropy) that are not captured by the physical simulation. It also incorporates high-frequency textures from the original color image (such as text strokes and metal scratches) to restore details lost in the physical simulation. Edge continuity and structural alignment are enforced to avoid breakage or misalignment caused by physical unfolding.
[0093] The loss function of convolutional neural networks contains structural fidelity constraints and edge continuity constraints.
[0094] Structural fidelity constraints combine structural similarity (SSIM), pixel-level mean squared error (MSE), and perceptual loss (VGG feature matching) to ensure that the corrected image's overall layout and semantic content are consistent with the real image. For example, the paragraph layout of ancient book pages and the geometric shapes of industrial parts are not deformed or distorted, resolving the blurring and structural misalignment caused by single-pixel loss in traditional methods. Edge continuity constraints enforce edge alignment using the Sobel gradient operator, eliminating jagged, broken, or blurry artifacts that may remain after physical simulation expansion. For example, this can be used to repair broken text edges in the seam of a bound book. These two constraints work synergistically to achieve multi-level optimization, from global to local, and from semantics to pixels.
[0095] In this embodiment, in step S400, the specific method for separating the shadow area is:
[0096] Calculate the reflectivity difference between the visible light band and the near-infrared band. If the brightness of a certain area in the visible light band is lower than the first threshold and the reflectivity of the near-infrared band is higher than the second threshold, it is determined to be a shadow area.
[0097] The first threshold is set based on the visible light reflectance threshold. Areas below this threshold are considered low-brightness areas. The second threshold is set based on the NIR reflectance threshold. Areas above this threshold indicate non-light-absorbing materials. The first and second thresholds are dynamically adjusted based on the material properties of the target object.
[0098] This embodiment's shadow region separation method leverages the spectral separation characteristics of shadow regions in the visible (low-reflection) and near-infrared (high-reflection) regions, overcoming the limitations of traditional single-band thresholding methods, which cannot distinguish between shadows and dark content. Through material-adaptive thresholding, it accommodates the varying reflective properties of diverse surfaces, such as paper, metal, and fabric.
[0099] The area judged as shadow is masked.
[0100] Mask marking provides reliable input for subsequent GAN restoration, avoiding semantic contradictions caused by incorrect region generation.
[0101] In this embodiment, in step S500, the generator of the generative adversarial network adopts a U-Net structure, whose input is a color image, a shadow area mask, and real-time color temperature and brightness parameters collected by the ambient light sensor; the output is a repaired texture consistent with the ambient light.
[0102] Specifically, the U-Net architecture employs multi-scale feature fusion. The encoder extracts deep semantic features (such as paper fiber orientation and lighting direction), while the decoder recovers details (such as text strokes and material grain). Skip connections preserve high-frequency information. Furthermore, a spatial attention module is embedded within the skip connections, prioritizing mask boundaries and high-gradient regions (such as text edges). Ambient light parameters are encoded as conditional vectors to dynamically adjust the feature distribution in the network's intermediate layers.
[0103] Specifically, the color image is used to provide contextual information of the repair area (such as surrounding texture and color distribution) to ensure that the generated content is consistent with the overall scene; the shadow area mask is used to accurately locate the pixel range to be repaired to avoid the generator from misoperating on non-shadow areas; the ambient light parameters (color temperature, brightness) are used to dynamically inject real-time lighting conditions (such as color temperature 5000K and brightness 200lux) to guide the generator to output repair content that matches the ambient light.
[0104] In this embodiment, in step S600, the method for dynamically adjusting the lighting parameters of the fill light includes:
[0105] Predict the changing trend of ambient light through Kalman filter algorithm;
[0106] According to the predicted structure, the RGB channel intensity and color temperature of the fill light are adjusted so that the illumination uniformity of the target object surface reaches the preset threshold.
[0107] The Kalman filter algorithm uses state and observation equations to construct a dynamic model of ambient light (color temperature, brightness). It integrates sensor observation data with historical status in real time to predict future short-term (e.g., 100ms) light change trends. It also filters out sensor noise (such as transient flash interference) to improve the stability of prediction results.
[0108] In Example 1 of the present application, relevant data can be acquired and processed based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0109] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0110] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware using computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0111] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0112] Example 2
[0113] Further references Figure 2 As an implementation of the method shown in the above-mentioned embodiment 1, embodiment 2 provides an image correction device, and the embodiment of the device corresponds to the method embodiment shown in embodiment 1.
[0114] An image correction device, comprising:
[0115] The RGB-D sensor module uses an RGB-D sensor to synchronously collect color images and three-dimensional point cloud data of the target object.
[0116] The RGB-D sensor module synchronously collects color images and three-dimensional point cloud data of the target object, providing accurate geometric and color information for subsequent processing. Combined with depth information, it can accurately restore the three-dimensional shape of the object, overcome the data loss problem of traditional two-dimensional image acquisition in complex curved scenes, and ensure the integrity of the input data of the subsequent correction module.
[0117] The elastic mesh module constructs an elastic mesh model of the target object based on 3D point cloud data. The elastic mesh model consists of a discretized mesh consisting of nodes, edges, and patches. Nodes correspond to spatial coordinates in the 3D point cloud, edges connect adjacent nodes and assign stiffness properties, and patches are formed by edges and are used to calculate deformation energy.
[0118] The elastic mesh module converts a three-dimensional point cloud into an elastic mesh model consisting of nodes, edges, and faces. By assigning edge stiffness properties and facet deformation energy calculation capabilities, it establishes a digital model that can be physically simulated, realizing the conversion from geometric data to a mechanical model. This provides a computable elastic mechanics framework for high-precision deformation correction, significantly improving the accuracy of deformation simulation of complex curved objects.
[0119] The preliminary correction module, based on the finite element analysis algorithm, calculates the unfolded shape of the elastic mesh model by minimizing the deformation energy function and generates a preliminary correction image after surface correction.
[0120] Based on the finite element analysis algorithm, the energy minimization calculation of the elastic mesh model is performed, and through physical simulation, high-fidelity unfolding of the three-dimensional surface to the two-dimensional plane is achieved, breaking through the limitations of traditional geometric transformation methods, maintaining the natural proportion of the object's texture and structure, and providing a geometric benchmark for subsequent image processing steps.
[0121] The multispectral light source module and separation module illuminate the target object through a multispectral light source, collect reflection data in the visible light band and near-infrared band, separate the shadow area and the real content area in the color image, and output the shadow area mask.
[0122] The multispectral light source module and separation module utilize the differences in multispectral reflection characteristics of visible light and near-infrared bands to accurately distinguish shadow areas from real content in the image. Through dual-band analysis, it overcomes the limitations of single visible light shadow detection and outputs accurate shadow area masks, providing reliable target positioning for subsequent repair.
[0123] The shadow restoration module inputs the preliminary corrected image and the shadow area mask into the generative adversarial network to generate the shadow-restored image.
[0124] The shadow restoration module inputs the preliminary corrected image and shadow mask into a generative adversarial network, and uses deep learning to generate restoration content that seamlessly integrates with the surrounding lighting. It eliminates shadow artifacts while maintaining the geometric correction results, achieving visually consistent image restoration effects and significantly improving the usability of images under complex lighting conditions.
[0125] The ambient light sensor array and illumination compensation module obtain the color temperature and brightness data of the ambient light sensor in real time, dynamically adjust the lighting parameters of the fill light, and perform adaptive illumination compensation on the image after shadow repair.
[0126] The ambient light sensor array and illumination compensation module achieve adaptive image compensation by dynamically adjusting the fill light parameters, eliminating color temperature drift and uneven brightness, ensuring color consistency of the output image under different ambient light conditions, and improving the stability of image quality.
[0127] The image output module outputs the target image after surface correction, shadow repair and lighting compensation.
[0128] The image output module integrates the processing results of each module and outputs the target image that has undergone a complete correction process, ensuring the superposition of the effects of geometric deformation elimination, shadow repair and lighting compensation, and providing high-quality image output that can be directly used for subsequent applications (such as OCR recognition and digital archiving).
[0129] An image correction device provided in Example 2 of the present invention can implement all the processes of an image correction method of the above-mentioned embodiment. The functions of each module in the device and the technical effects achieved are respectively the same as the functions and technical effects achieved by an image correction method of the above-mentioned embodiment, and will not be repeated here.
[0130] Example 3
[0131] An image correction system, the system comprising:
[0132] one or more memories for storing instructions; and
[0133] One or more processors are used to call and run instructions from the memory to perform any one of the above-mentioned image correction methods.
[0134] Example 4
[0135] A computer-readable storage medium, the computer-readable storage medium comprising:
[0136] When the program is executed by a processor, any of the above-mentioned image correction methods is executed.
[0137] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An image correction method, characterized in that: The following steps are involved: S100, uses RGB-D sensors to synchronously collect color images and 3D point cloud data of target objects; S200, constructing an elastic mesh model of the target object based on the three-dimensional point cloud data, the elastic mesh model consisting of a discretized mesh composed of nodes, edges, and patches, wherein the nodes correspond to spatial coordinates in the three-dimensional point cloud, the edges connect adjacent nodes and assign stiffness attributes, and the patches are formed by enclosing edges and are used to calculate deformation energy; S300, based on a finite element analysis algorithm, calculating the unfolded shape of the elastic mesh model by minimizing a deformation energy function, and generating a preliminary corrected image after surface correction; S400, illuminating the target object with a multispectral light source, collecting reflection data in the visible light band and the near-infrared band, separating the shadow area and the real content area in the color image, and outputting a shadow area mask; S500, inputting the preliminary corrected image and the shadow area mask into a generative adversarial network to generate a shadow-repaired image; S600, real-time acquisition of color temperature and brightness data from the ambient light sensor, dynamic adjustment of fill light lighting parameters, and adaptive lighting compensation for the image after shadow repair; S700: Output the target image after surface correction, shadow restoration, and illumination compensation.
2. The image correction method according to claim 1, wherein: In step S200, the stiffness properties of the edge are dynamically adjusted according to the material properties of the target object, specifically including: Match the stiffness coefficient of the target object through the preset material database; Alternatively, the local curvature is fitted by the three-dimensional point cloud data to dynamically adjust the stiffness property of the edge.
3. The image correction method according to claim 1, wherein: In step S300, the finite element analysis algorithm specifically includes: discretizing the elastic grid model into finite element units; Define the boundary conditions as fixed constraints on the mesh edges; The plane coordinates of the expanded grid are calculated using the energy minimization principle.
4. The image correction method according to claim 1, wherein: Step S300 also includes: Inputting the preliminary corrected image and the color image into a pre-trained convolutional neural network, and outputting a fused high-precision corrected image; The loss function of the convolutional neural network includes structural fidelity constraints and edge continuity constraints.
5. The image correction method according to claim 1, wherein: In step S400, the specific method of separating the shadow area is: Calculate the reflectivity difference between the visible light band and the near-infrared band. If the brightness of a certain area in the visible light band is lower than the first threshold and the reflectivity of the near-infrared band is higher than the second threshold, it is determined to be a shadow area. The area judged as shadow is masked.
6. The image correction method according to claim 5, characterized in that: In step S500, the generator of the generative adversarial network adopts a U-Net structure, and its input is the color image, the shadow area mask, and the real-time color temperature and brightness parameters collected by the ambient light sensor; the output is a repaired texture consistent with the ambient light.
7. The image correction method according to claim 1, characterized in that: In step S600, the method for dynamically adjusting the lighting parameters of the fill light includes: Predict the changing trend of ambient light through Kalman filter algorithm; According to the predicted structure, the RGB channel intensity and color temperature of the fill light are adjusted so that the illumination uniformity of the target object surface reaches the preset threshold.
8. An image correction device, characterized in that: include: RGB-D sensor module, which uses RGB-D sensors to simultaneously collect color images and 3D point cloud data of target objects; An elastic mesh module constructs an elastic mesh model of the target object based on the three-dimensional point cloud data. The elastic mesh model is composed of a discretized mesh consisting of nodes, edges, and patches. The nodes correspond to spatial coordinates in the three-dimensional point cloud, the edges connect adjacent nodes and assign stiffness properties, and the patches are formed by enclosing edges and are used to calculate deformation energy. A preliminary correction module, based on a finite element analysis algorithm, calculates the unfolded shape of the elastic mesh model by minimizing a deformation energy function, and generates a preliminary correction image after surface correction; A multispectral light source module and a separation module illuminate the target object through a multispectral light source, collect reflection data in the visible light band and the near-infrared band, separate the shadow area and the real content area in the color image, and output a shadow area mask; a shadow restoration module, inputting the preliminary corrected image and the shadow area mask into a generative adversarial network to generate a shadow-inpainted image; The ambient light sensor array and illumination compensation module acquire the color temperature and brightness data of the ambient light sensor in real time, dynamically adjust the lighting parameters of the fill light, and perform adaptive illumination compensation on the image after shadow repair; The image output module outputs the target image after surface correction, shadow repair and lighting compensation.
9. An image correction system, characterized in that: The system comprises: one or more memories for storing instructions; and One or more processors, configured to call and execute the instructions from the memory to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium comprises: The program, when executed by a processor, executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Finite element modeling method and computer storage medium
CN114372392A
Image shadow removal method based on comparative learning
CN120031758A