Projection area non-planar adjustment method, medium and system
Through laser scanning and GPU parallel computing, a surface model of the projection area is established and the projection image is adjusted in real time, which solves the problem of difficulty in achieving global non-planar adjustment and dynamic adaptation in the existing technology, and significantly improves the projection quality and adaptability.
Patent Information
- Application Number
- CN202410703860.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-20
AI Technical Summary
Existing non-planar projection technology is difficult to achieve global non-planar adjustment of the projected image, has limited correction effects, is difficult to cope with real-time geometric changes in the projection area, and cannot dynamically adaptively adjust the projection effect.
A laser scanner is used to obtain the three-dimensional elevation data of the projection area, a surface model is established, and GPU parallel computing and iterative optimization algorithms are used to monitor and dynamically adjust the projection image in real time to adapt to the geometric changes in the projection area.
It achieves precise global non-planar adjustment of the projected image, improves the projection quality and adaptability, and can maintain the best projection effect in dynamically changing environments.
Smart Images

Figure CN118678037A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of projection technology, and in particular, relates to a method, medium and system for adjusting a non-planar projection area. Background Art
[0002] With the rapid development of society, projection technology has been widely used in various fields, including education, entertainment, display, conference and many other scenarios. Compared with traditional planar projection, non-planar projection can bring users a more immersive visual experience and better fit the actual environment of the projection area. However, since the projection area usually has certain geometric irregularities, such as curved surfaces and folded surfaces, how to achieve effective non-planar adjustment of the projected image has always been a major technical challenge faced by the industry. The existing non-planar projection technologies mainly include the following solutions:
[0003] 1. Solution based on manual correction: Before projection, the staff manually adjusts the position and angle of the projector, or manually deforms the input image, trying to make the projection effect conform to the geometric shape of the projection area. This method requires a lot of manual intervention, is cumbersome to operate, and is difficult to adapt to real-time geometric changes in the projection area.
[0004] 2. The solution based on preset templates: some common geometric model templates are established in advance, such as cylinders, spheres, etc. During the actual projection, the appropriate template is selected for image transformation according to the detected geometric information of the projection area. This method has strong limitations and cannot adapt to complex and diverse projection environments.
[0005] 3. Solution based on camera feedback: The camera is used to monitor the degree of distortion of the projected image on the projection area in real time, and the input image is dynamically corrected based on the feedback information. This method can achieve a certain degree of adaptability, but it often cannot accurately capture the global geometry of the projection area, and the correction effect is limited.
[0006] In general, most of the existing non-planar projection technologies have the technical problems of being difficult to achieve global non-planar adjustment of the projected image, having strong limitations in the correction effect, being difficult to cope with real-time geometric changes in the projection area, and being unable to dynamically and adaptively adjust the projection effect. Summary of the invention
[0007] In view of this, the present invention provides a method, medium and system for non-planar adjustment of the projection area, which can solve the technical problems in the prior art that it is difficult to achieve global non-planar adjustment of the projection image, the correction effect is highly limited, it is difficult to cope with real-time geometric changes in the projection area, and the projection effect cannot be dynamically and adaptively adjusted.
[0008] The present invention is achieved in that:
[0009] A first aspect of the present invention provides a method for adjusting a non-planar projection area, comprising the following steps:
[0010] S10, scanning the projection area with a laser scanner to obtain surface elevation data, converting the obtained elevation data into a mathematical model, and establishing a surface model of the projection area using differential geometry and surface theory;
[0011] S20, calculating the curvature and distortion of each point in the projection area according to the surface model;
[0012] S30, loading the original image data into the GPU video memory, and loading the surface model parameters and curvature distortion data into the GPU constant memory for access by the CUDA core;
[0013] S40, dividing the thread grid, assigning the image pixels to different thread blocks for parallel processing, each thread calculating the corresponding position of the assigned pixel point on the ideal plane according to the position of the pixel point on the surface model and the curvature distortion;
[0014] S50, storing the calculated pixel position into the shared memory, achieving data continuity between the main area and the boundary area inside the thread block, ensuring that adjacent pixels on the surface maintain continuity after remapping, and storing the result back into the global memory after the thread block completes the internal data connection;
[0015] S60, performing data continuity processing on the boundary area between thread blocks on the data in the global memory to achieve the continuity of the entire image data, and performing geometric transformation on the connected image data to generate projection image data after non-planar adjustment;
[0016] S70, sending the adjusted projection image data to the projector to complete the projection, monitoring the changes of the projection area surface in real time, reacquiring the elevation data, dynamically adjusting the surface model parameters and the projection image parameters, and adaptively adjusting the projection effect;
[0017] S80, using iterative optimization algorithm, continuously optimizes the surface model and non-planar adjustment parameters to improve projection quality.
[0018] Wherein, the step S10 specifically includes:
[0019] Step 101: Scan the projection area using a laser scanner to obtain three-dimensional elevation data of the surface of the area;
[0020] Step 102: mathematically model the acquired elevation data, and use differential geometry and surface theory to establish a non-planar surface model of the projection area to accurately describe the geometric shape of the projection area.
[0021] The specific steps of step S20 include:
[0022] Step 201: According to the established surface model, using the curvature formula in differential geometry, differential operation is performed on the surface model to obtain the principal curvature and Gaussian curvature of each position point;
[0023] Step 202: Store the calculated curvature data in the constant memory of the GPU.
[0024] The specific steps of step S30 include:
[0025] Step 301, copying the original image data to be projected into the video memory of the GPU;
[0026] Step 302: Copy the surface model parameters to the constant memory of the GPU.
[0027] The specific steps of step S40 include:
[0028] Step 401: Divide the entire image into multiple thread blocks according to the characteristics of GPU hardware, and each thread block is responsible for processing a portion of pixels in the image;
[0029] Step 402: Each thread block is further subdivided into multiple threads, and each thread is responsible for calculating the mapping position of a pixel point on the ideal plane;
[0030] Step 403: using the surface model parameters and the coordinate position of the pixel point on the surface, the corresponding coordinates of the point on the ideal plane are calculated using differential geometry formulas.
[0031] The specific steps of step S50 include:
[0032] Step 501: Each thread block stores the calculated pixel mapping position in the shared memory of the block, and uses the low latency and high bandwidth characteristics of the shared memory to ensure fast data interaction within the thread block;
[0033] Step 502: Two types of pixels are processed inside the thread block: pixels in the main area are stored in the shared memory; pixels in the boundary area need to exchange data with adjacent thread blocks to ensure that adjacent pixels on the surface maintain continuity after remapping;
[0034] Step 503: The thread block transfers the calculation result from the shared memory to the global memory for subsequent processing.
[0035] The specific steps of step S60 include:
[0036] Step 601: Perform data connection operation between thread blocks on the pixel mapping result stored in the global memory to ensure that the boundary pixels between different thread blocks remain continuous after remapping;
[0037] Step 602: Use the corresponding position of each pixel on the ideal plane to perform geometric transformation on the original image data to generate final non-planar adjusted projection image data.
[0038] The specific steps of step S70 include:
[0039] Step 701, sending the projection image data calculated in step S60 and adjusted to the non-planar surface to the projector to complete the actual projection process;
[0040] Step 702: Use a camera or other sensing device to monitor the geometric changes of the projection area surface in real time. Once the surface shape changes, immediately re-execute steps S10 to S60 to obtain new elevation data, update the surface model parameters and projection image parameters, and thus dynamically adjust the projection effect.
[0041] The specific steps of step S80 include:
[0042] Step 801: adopt an iterative optimization algorithm based on the gradient descent method, taking the projection quality as the optimization objective function;
[0043] Step 802: In each iteration, the difference between the projected image and the ideal projection effect is calculated according to the current curved surface model and non-planar adjustment parameters, and the model parameters are adjusted using the gradient information to gradually reduce the difference, thereby improving the projection quality.
[0044] Step 803: When the projection quality is higher than the preset quality threshold, it is considered that the ideal effect has been achieved and the iteration is stopped.
[0045] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned method for adjusting the non-planarity of the projection area.
[0046] A third aspect of the present invention provides a projection area non-planar adjustment system, which includes the above-mentioned computer-readable storage medium.
[0047] Compared with the prior art, the method, medium and system for adjusting the non-planarity of the projection area provided by the present invention have the following beneficial effects:
[0048] 1. Accurately obtain the three-dimensional elevation data of the projection area and establish a non-planar surface model: The projection area is scanned with a laser scanner at a high density to obtain the three-dimensional elevation data of the surface of the area, and a cubic B-spline surface is used for accurate modeling, which can fully describe the complex geometric shape of the projection area. Compared with the existing technology that can only use simple preset geometric models, this method can adapt to more complex and diverse projection environments.
[0049] 2. GPU-based parallel computing to achieve global non-planar adjustment: Load image data and geometric parameters into GPU video memory and constant memory, give full play to the parallel computing capabilities of GPU, and divide the non-planar adjustment process of the entire projected image into multiple thread blocks and threads for parallel processing. This not only greatly improves the computing efficiency, but also ensures that the entire image maintains good continuity after geometric transformation through shared memory and boundary processing, avoiding obvious distortion and breakage. Compared with the existing CPU-based serial processing method, this method has significantly improved the computing speed and image quality.
[0050] 3. Realize real-time dynamic adaptive adjustment of projection effect: This method can monitor the geometric changes of the projection area surface in real time, and dynamically update the surface model parameters and projection image parameters to continuously optimize the projection effect. Once the shape of the projection area surface changes, the elevation data is immediately re-acquired, the geometric model is updated, and the non-planar adjustment results are recalculated. This real-time adaptive adjustment mechanism can ensure that the projection effect always conforms to the actual geometric shape of the projection area, and maintains the best projection quality even in a dynamically changing environment. Compared with the existing static correction method, this method has stronger adaptability and robustness.
[0051] 4. Use iterative optimization algorithm to further improve projection quality: In addition to real-time adaptive adjustment, this method also uses an iterative optimization algorithm based on the gradient descent method, taking the projection quality index as the objective function, and continuously optimizes the surface model parameters and non-planar adjustment parameters. By dynamically adjusting the optimization step size, it can quickly converge to the optimal projection effect. Compared with the existing static correction method, this method can continuously improve the projection quality and meet higher visual experience requirements.
[0052] To sum up, the non-planar adjustment method of the projection area proposed in the present invention makes full use of technical means such as laser scanning, GPU parallel computing, real-time adaptive adjustment and iterative optimization, can accurately obtain the geometric information of the projection area, quickly and efficiently realize the global non-planar adjustment of the projection image, and can dynamically adapt to changes in the projection environment, ultimately significantly improving the projection quality and adaptability, and solving the technical problems of the prior art that it is difficult to realize the global non-planar adjustment of the projection image, the correction effect is highly limited, it is difficult to cope with the real-time geometric changes in the projection area, and the projection effect cannot be dynamically and adaptively adjusted. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0054] Figure 1 A flow chart of the method provided by the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0056] like Figure 1 FIG. 1 is a flow chart of a method for adjusting a non-planar projection area provided by the present invention. The method comprises the following steps:
[0057] S10, scanning the projection area with a laser scanner to obtain surface elevation data, converting the obtained elevation data into a mathematical model, and establishing a surface model of the projection area using differential geometry and surface theory;
[0058] S20, calculating the curvature and distortion of each point in the projection area according to the surface model;
[0059] S30, loading the original image data into the GPU video memory, and loading the surface model parameters and curvature distortion data into the GPU constant memory for access by the CUDA core;
[0060] S40, dividing the thread grid, assigning the image pixels to different thread blocks for parallel processing, each thread calculating the corresponding position of the assigned pixel point on the ideal plane according to the position of the pixel point on the surface model and the curvature distortion;
[0061] S50, storing the calculated pixel position into the shared memory, achieving data continuity between the main area and the boundary area inside the thread block, ensuring that adjacent pixels on the surface maintain continuity after remapping, and storing the result back into the global memory after the thread block completes the internal data connection;
[0062] S60, performing data continuity processing on the boundary area between thread blocks on the data in the global memory to achieve the continuity of the entire image data, and performing geometric transformation on the connected image data to generate projection image data after non-planar adjustment;
[0063] S70, sending the adjusted projection image data to the projector to complete the projection, monitoring the changes of the projection area surface in real time, reacquiring the elevation data, dynamically adjusting the surface model parameters and the projection image parameters, and adaptively adjusting the projection effect;
[0064] S80, using iterative optimization algorithm, continuously optimizes the surface model and non-planar adjustment parameters to improve projection quality.
[0065] The specific implementation methods of the above steps are described in detail below:
[0066] The specific implementation method of step S10 is: use a laser scanner to scan the projection area to obtain the three-dimensional elevation data of the surface of the area. First, the laser scanner continuously emits laser beams at a certain scanning frequency and receives reflected signals, and calculates the distance of the corresponding position by measuring the flight time of each laser beam, thereby obtaining the elevation data of the entire projection area. Next, the acquired elevation data is mathematically modeled, and a non-planar surface model of the projection area is established using differential geometry and surface theory. Specifically, a surface fitting algorithm is used to convert the collected elevation data point cloud into a smooth three-dimensional surface model, which can accurately describe the geometric shape of the projection area. The purpose of this step is to provide the required mathematical basis for subsequent non-planar adjustments.
[0067] The specific implementation method of step S20 is: according to the established surface model, the curvature and distortion of each point in the projection area are calculated. First, the curvature formula in differential geometry is used to perform differential operations on the surface model to obtain the principal curvature and Gaussian curvature of each position point. The principal curvature reflects the local curvature of the surface at this point, and the Gaussian curvature reflects the overall distortion of the surface at this point. These two curvature parameters together constitute the geometric deformation characteristics of the surface model at each point. Next, these curvature data are stored in the constant memory of the GPU to prepare for subsequent parallel computing. The purpose of this step is to obtain the geometric deformation feature parameters of the projection area, which provides a key basis for the next step of non-planar adjustment.
[0068] The specific implementation method of step S30 is: load the original image data into the GPU video memory, and load the surface model parameters and curvature distortion data calculated in step S20 into the GPU constant memory. First, copy the original image data to be projected to the GPU video memory to ensure that the GPU can quickly access the image data. Then, copy the surface model parameters (such as curvature, distortion, etc.) calculated in step S20 to the constant memory of the GPU. Constant memory has a low access latency, which can ensure that the GPU core can efficiently access these geometric parameter data during calculation. Through the preparation work of this step, the foundation is laid for subsequent parallel calculations and non-planar adjustments.
[0069] The specific implementation method of step S40 is: divide the thread grid, assign the image pixels to different thread blocks for parallel processing, and each thread calculates the corresponding position of the assigned pixel point on the ideal plane according to the position of the pixel point on the surface model and the curvature distortion. First, according to the characteristics of the GPU hardware, the entire image is divided into multiple thread blocks, and each thread block is responsible for processing a part of the pixels in the image. Next, each thread block is further subdivided into multiple threads, and each thread is responsible for calculating the mapping position of a pixel point on the ideal plane. The specific calculation method is: using the surface model parameters obtained in step S20, combined with the coordinate position of the pixel point on the surface, the corresponding coordinates of the point on the ideal plane are calculated by differential geometry formulas. In this way, parallel processing of the entire image can be achieved and the calculation efficiency can be improved. The purpose of this step is to calculate the corresponding position of each pixel point on the ideal plane based on the geometric characteristics of the surface, in preparation for subsequent geometric transformations.
[0070] The specific implementation method of step S50 is: storing the calculated pixel position in the shared memory, realizing the data continuity of the main area and the boundary area inside the thread block, ensuring that the adjacent pixels on the surface maintain continuity after remapping, and storing the result back to the global memory after the thread block completes the internal data connection. First, each thread block stores the calculated pixel mapping position in the shared memory of this block. The characteristics of shared memory are low latency and high bandwidth, which can ensure the fast interaction of data inside the thread block. Next, the thread block processes two types of pixels inside: pixels in the main area and pixels in the boundary area. The pixels in the main area only need to be stored in the shared memory; while the pixels in the boundary area need to exchange data with the adjacent thread blocks to ensure that the adjacent pixels on the surface maintain continuity after remapping. Finally, the thread block transfers the calculation results from the shared memory to the global memory for subsequent processing. The purpose of this step is to ensure the continuity of the entire image data during the remapping process and lay the foundation for subsequent geometric transformations.
[0071] The specific implementation method of step S60 is: the data in the global memory is processed for continuity of the boundary area data between thread blocks to achieve the continuity of the entire image data, and the connected image data is subjected to geometric transformation to generate projection image data after non-planar adjustment. First, the data connection operation between thread blocks is performed for the pixel mapping results stored in the global memory. Specifically, for the boundary pixels between different thread blocks, interpolation or smoothing processing is required to ensure that they remain continuous after remapping. This ensures that the entire image data will not have obvious breaks or distortions during the geometric transformation process. Next, the original image data is geometrically transformed using the corresponding position of each pixel on the ideal plane calculated in step S40 to generate the final projection image data after non-planar adjustment. The purpose of this step is to ensure that the entire projection image maintains continuity and natural transition after geometric transformation, thereby improving the projection quality.
[0072] The specific implementation method of step S70 is: sending the adjusted projection image data to the projector, completing the projection, monitoring the changes of the projection area surface in real time, reacquiring the elevation data, dynamically adjusting the surface model parameters and the projection image parameters, and adaptively adjusting the projection effect. First, the projection image data after non-planar adjustment calculated in step S60 is sent to the projector to complete the actual projection process. Next, a camera or other sensing device is used to monitor the geometric changes of the projection area surface in real time. Once the surface shape is found to have changed, steps S10 to S60 are immediately re-executed to obtain new elevation data, update the surface model parameters and the projection image parameters, and thus dynamically adjust the projection effect to ensure that the projection always conforms to the actual geometric shape of the projection area. The purpose of this step is to achieve adaptive adjustment of the projection effect and improve the adaptability and stability of the projection.
[0073] The specific implementation method of step S80 is: using an iterative optimization algorithm to continuously optimize the surface model and non-planar adjustment parameters to improve the projection quality. First, an iterative optimization algorithm based on the gradient descent method can be used, with the projection quality as the optimization objective function. In each iteration, the difference between the projected image and the ideal projection effect is calculated based on the current surface model and non-planar adjustment parameters, and the model parameters are adjusted using the gradient information to gradually reduce the difference, thereby improving the projection quality. For example, the threshold of the projection quality can be set to 0.95. When the projection quality is higher than the threshold, it is considered that the ideal effect has been achieved and the iteration is stopped. The purpose of this step is to continuously improve the projection effect through parameter optimization to ensure that the projection quality meets the requirements.
[0074] In order to better understand this method, the specific implementation of this method is described in more detail below in combination with a specific formula:
[0075] The specific implementation of step S10 is as follows:
[0076] The surface geometry of the projection area usually has certain non-planar characteristics. In order to achieve non-planar adjustment of the projection image, it is necessary to first obtain the three-dimensional elevation information of the projection area. This step uses laser scanning technology to scan the projection area, obtain the elevation data of the surface of the area, and convert it into a mathematical model to establish a non-planar surface model of the projection area.
[0077] Specifically, the laser scanner continuously emits laser beams at a certain scanning frequency and receives reflected signals. By measuring the flight time of each laser beam, the distance of the corresponding position is calculated, thereby obtaining the elevation data of the entire projection area. Suppose the sampling position of the laser scanner in the spatial coordinate system (x, y, z) is (c i ,y i ,z ij ), where i = 1, 2, ..., M, j = 1, 2, ..., N, we can get a discrete set of elevation data points
[0078] Next, the surface fitting algorithm is used to convert the collected elevation data point cloud into a smooth three-dimensional surface model. This method uses a cubic B-spline surface for fitting, and its mathematical expression is:
[0079]
[0080] Among them, P ij are the coordinates of the control points, and are the cubic B-spline basis functions in the u and v directions respectively. By adjusting the positions and weights of the control points, the geometric shape of the projection area can be accurately described. The final surface model S(u,v) can be used for subsequent geometric parameter calculations and non-planar adjustments of the projection image.
[0081] The specific implementation of step S20 is as follows:
[0082] According to the non-planar surface model S (u, v) established in step S10, it is necessary to calculate the curvature and distortion of each point in the projection area to provide a basis for subsequent non-planar adjustments.
[0083] First, using the curvature formula in differential geometry, the surface model S(u,v) is differentiated to obtain the principal curvature k1 and Gaussian curvature k2 of each position point (u,v):
[0084]
[0085] Where E = S u ·S u ,F=S u ·Sv ,G=S v ·S v is the coefficient of the first basic form. The principal curvature k1 reflects the local curvature of the surface at that point, and the Gaussian curvature k2 reflects the overall distortion of the surface at that point.
[0086] Next, the calculated curvature data (k1, k2) is stored in the constant memory of the GPU so that subsequent parallel computing can efficiently access these geometric parameters. The constant memory of the GPU has a low access latency, which ensures that the GPU core can quickly obtain the required curvature information during calculation.
[0087] In summary, the purpose of this step is to obtain the geometric deformation characteristic parameters of the projection area, providing a key basis for subsequent non-planar adjustments.
[0088] The specific implementation of step S30 is as follows:
[0089] In order to achieve efficient parallel processing of the projected image, the original image data and the surface model parameters calculated in step S20 need to be loaded into the video memory and constant memory of the GPU respectively.
[0090] First, the original image data I(x,y) to be projected is copied to the GPU's video memory to ensure that the GPU can quickly access the image data. The resolution of the original image data is recorded as W×H pixels.
[0091] Next, the surface model parameters calculated in step S20, including the principal curvature k1(u,v) and Gaussian curvature k2(u,v) of each position point (u,v), are copied to the constant memory of the GPU. The characteristic of constant memory is low access latency, which can ensure that the GPU core can efficiently access these geometric parameter data during calculation.
[0092] The preparation work in this step lays the foundation for the subsequent GPU-based parallel computing and non-planar adjustment. The original image data is stored in the video memory, which can be accessed quickly; while the surface model parameters are stored in the constant memory, the GPU core can efficiently obtain geometric information, thereby improving the overall computing performance.
[0093] The specific implementation of step S40 is as follows:
[0094] The goal of this step is to map the original projection image (x, y) to the ideal plane projection coordinates (u, v) according to the surface model parameters calculated in step S20. In order to give full play to the parallel computing capability of GPU, the CUDA programming model is used to realize the parallel processing of this process.
[0095] First, the entire projection image is divided into B x×B y Each thread block is responsible for processing a portion of pixels in the image. The size of the thread block is set to T x ×T y threads, each thread is responsible for calculating the mapping position of a pixel on the ideal plane.
[0096] For the (k, l)th thread in the (i, j)th thread block, it is responsible for calculating the (x, y)th pixel point (x = i*T x +k,y=j*T y +l) on the ideal plane. According to the surface model parameters k1(u,v) and k2(u,v) obtained in step S20, the corresponding coordinates of the point on the ideal plane can be calculated using differential geometry formulas:
[0097] u=u(x,y)=a1x+a2y+a3
[0098] v=v(x,y)=b1x+b2y+b3
[0099] Among them, a1, a2, a3, b1, b2, b3 are coefficients that depend on k1 and k2. Through such calculation, the corresponding position of each pixel in the original image on the ideal plane can be obtained.
[0100] This step makes full use of the parallel computing capabilities of the GPU and divides the entire image mapping process into multiple thread blocks and threads for parallel processing, greatly improving computing efficiency.
[0101] The specific implementation of step S50 is as follows:
[0102] In order to ensure that adjacent pixels on the surface maintain continuity after remapping, it is necessary to implement data continuity processing of pixel mapping results within and between thread blocks.
[0103] First, each thread block stores the calculated pixel mapping position (u, v) in the shared memory of this block. Shared memory is a special memory area with low latency and high bandwidth in the GPU, which can ensure fast data interaction within the thread block.
[0104] Next, the thread block needs to process two types of pixels separately: pixels in the main area and pixels in the boundary area. For pixels in the main area, it only needs to store their mapping results in shared memory; while for pixels at the boundary of the thread block, it is necessary to exchange data with adjacent thread blocks to ensure that adjacent pixels on the surface maintain continuity after remapping.
[0105] Specifically, for the boundary pixel (x = i*T x +k,y=j*Ty +l), it is necessary to interpolate or smooth the corresponding boundary pixels of the four adjacent thread blocks above, below, left and right to calculate the continuous mapping coordinates (u, v). This ensures that the entire image will not have obvious breaks or distortions during the geometric transformation process.
[0106] Finally, the thread block transfers the calculation results from the shared memory to the global memory to prepare for subsequent geometric transformations.
[0107] Through the data continuity processing in this step, it can be ensured that adjacent pixels on the surface maintain a smooth transition after remapping, laying the foundation for subsequent geometric transformations.
[0108] The specific implementation of step S60 is as follows:
[0109] The goal of this step is to perform a geometric transformation on the original image data I(x, y) according to the corresponding position (u, v) of each pixel on the ideal plane calculated in step S40, and generate the final non-planar adjusted projection image data I ′ (u,b).
[0110] First, the pixel mapping results (u, v) stored in the global memory are connected between thread blocks. Specifically, for the boundary pixels between different thread blocks, bilinear interpolation is required to ensure that they remain continuous after remapping. This ensures that the entire image data will not be significantly broken or distorted during the geometric transformation process.
[0111] Next, the original image data I(x, y) is geometrically transformed using the corresponding position (u, v) of each pixel on the ideal plane calculated in step S40. The specific transformation method uses a bicubic B-spline interpolation algorithm, and its mathematical expression is:
[0112]
[0113] Among them, B3(t) is the cubic B-spline basis function. This interpolation algorithm can better maintain the clarity and continuity of the image after geometric transformation.
[0114] Through this step of geometric transformation, the final non-planar adjusted projection image data I can be obtained. ′ (i,v), prepare for subsequent projection output.
[0115] The specific implementation of step S70 is as follows:
[0116] In order to achieve adaptive adjustment of the projection effect, the projection image data I calculated in step S60 needs to be ′(v,u) is sent to the projector for projection, and the geometric changes of the projection area surface are monitored in real time, and the surface model parameters and projection image parameters are dynamically updated.
[0117] First, the projection image data I after non-planar adjustment is ′ (u,v) is sent to the projector to complete the actual projection process. The projector maps the image data onto the projection area to achieve a non-planar projection effect.
[0118] Next, a sensor device such as a camera or a structured light camera is used to monitor the geometric changes of the projection area surface in real time. Once the shape of the projection area surface changes, steps S10 to S60 are immediately re-executed to obtain new elevation data, update the surface model parameters (k1(u,v), k2(u,v)) and the projection image parameters i ′ (u, v), thereby dynamically adjusting the projection effect to ensure that the projection always conforms to the actual geometric shape of the projection area.
[0119] Through real-time monitoring and adaptive adjustment of this step, it is possible to cope with dynamic changes in the geometry of the projection area, ensure that the projection effect continues to remain in the best state, and improve the adaptability and stability of the projection system.
[0120] The specific implementation of step S80 is as follows:
[0121] In order to further improve the projection quality, this step uses an iterative optimization algorithm to continuously optimize the surface model parameters and non-planar adjustment parameters.
[0122] First, an iterative optimization algorithm based on the gradient descent method can be used, with the projection quality Q as the optimization objective function. The projection quality Q can be comprehensively evaluated through evaluation indicators such as clarity, contrast, color saturation, and geometric distortion. The mathematical expression is:
[0123] Q=w1·Sharpness+w2·Contrast+w3·Saturation-w4·Distortion
[0124] Among them, w1, w2, w3, and w4 are the weight coefficients of the corresponding indicators.
[0125] In each iteration, the parameter I is adjusted according to the current surface model parameters (k1(u,v), k2(u,v)) and the non-planar ′ (u, v), calculate the difference ΔQ between the projected image and the ideal projection effect, and use the gradient information Adjust the model parameters and gradually reduce the difference, thereby improving the projection quality. The specific iterative update formula is:
[0126]
[0127] Among them, η is the dynamic step size factor, which can be adjusted according to the convergence of the optimization process to improve the convergence speed of the algorithm.
[0128] When the projection quality Q is higher than the preset quality threshold Q th When , it is considered that the ideal effect has been achieved and the iterative optimization is stopped.
[0129] The relevant variables are explained as follows: x, y, z: the three coordinate axes of the three-dimensional rectangular coordinate system; The collected discrete elevation data point set; x i ,y j ,z ij : the three-dimensional coordinates of the elevation data point in the i-th row and j-th column; M, N: the number of rows and columns of the elevation data point matrix; u(u, v): the non-planar three-dimensional surface model of the projection area, represented by a cubic B-spline surface; P ij : Coordinates of control points of cubic B-spline surface; Cubic B-spline basis functions, corresponding to the u and v directions respectively; n, m: the number of control points in the u and v directions of the cubic B-spline surface; k1, k2: the principal curvature and Gaussian curvature of each point on the surface model S(u, v); E, F, G: the first basic form coefficients of the surface S(u, v); S u ,S v : partial derivatives of the surface S(u,v) in the u and v directions; x, y: pixel coordinates in the original image coordinate system; u, v: pixel coordinates in the ideal plane projection coordinate system; a1, a2, a3, b1, b2, b3: coefficients of pixel coordinate mapping, related to curvature k1, k2; B x ,B y : The number of rows and columns of thread blocks; T x ,T y : the number of rows and columns of threads in each thread block; i, j, k, l: the row and column subscripts of thread blocks and threads; I(x, y): the original projection image data; I′(u, v): the projection image data after non-planar adjustment; W, H: the width and height of the original image; Q: the comprehensive evaluation index of projection quality; w1, w2, w3, w4: the weight coefficients of each evaluation index; Q th : target threshold of projection quality; ΔQ: the difference between the current projection quality and the ideal projection quality; The gradient of the projected quality function Q; t: the time step of the iteration; η: the dynamic step factor of the iteration.
[0130] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned method for adjusting the non-planarity of the projection area.
[0131] A third aspect of the present invention provides a projection area non-planar adjustment system, which includes the above-mentioned computer-readable storage medium.
[0132] Specifically, the principle of the present invention is to achieve high-quality non-planar adjustment of the projected image through four key technical links: three-dimensional elevation data modeling, GPU parallel computing, adaptive adjustment and iterative optimization. The specific principle is as follows:
[0133] 1. 3D elevation data modeling: First, a laser scanner is used to perform high-density scanning of the projection area to obtain a set of 3D elevation data points on the surface of the area. Through the surface fitting algorithm, the discrete elevation data points are converted into a smooth 3D surface model, which can accurately describe the complex geometric shape of the projection area. This method uses cubic B-spline surfaces for modeling, and can flexibly fit various complex non-planar geometric shapes by adjusting the position and weight of the control points. This provides a reliable geometric basis for subsequent non-planar image adjustment.
[0134] 2. GPU parallel computing: In order to achieve efficient parallel processing of the projected image, the original image data and surface model parameters are loaded into the GPU's video memory and constant memory respectively. The parallel computing architecture of the GPU can give full play to the computing potential of these data. Specifically, the entire projected image is divided into multiple thread blocks, each of which is responsible for processing a part of the pixels in the image. Inside each thread block, it is further subdivided into multiple threads, each of which is responsible for calculating the corresponding position of a pixel point on the ideal plane. Using the geometric parameters provided by the surface model, the coordinates of each pixel point on the ideal plane can be obtained by mapping calculations using differential geometry formulas. In order to ensure that the entire image data remains continuous during the geometric transformation process, data interaction and interpolation processing of the boundary area are performed within and between thread blocks. Through the efficient access mechanism of shared memory, the pixels within the thread block can be quickly connected; and for the boundary pixels between thread blocks, the bilinear interpolation method is used for smoothing to ensure that adjacent pixels maintain a smooth transition after remapping. This method based on GPU parallel computing not only greatly improves the computing efficiency, but also can generate high-quality geometric transformation results.
[0135] 3. Adaptive real-time adjustment: In order to cope with the real-time geometric changes in the projection area, this method adopts a real-time monitoring and adaptive adjustment mechanism. During the projection process, a sensor device such as a camera or a structured light camera is used to monitor the geometric changes of the projection area surface in real time. Once the surface shape changes, the elevation data is immediately re-acquired, the surface model parameters and the projection image parameters are updated, and the projection effect is dynamically adjusted to ensure that the projection always conforms to the actual geometric shape of the projection area. This real-time adaptive adjustment mechanism ensures that the projection quality can continue to maintain the best state and can perform well even in a dynamically changing environment.
[0136] 4. Iterative optimization algorithm: To further improve the projection quality, this method adopts an iterative optimization algorithm based on the gradient descent method, with the projection quality index as the optimization objective function. In each iteration, the difference between the projected image and the ideal projection effect is calculated based on the current surface model parameters and non-planar adjustment parameters, and the parameters are adjusted using the gradient information to gradually reduce the difference, thereby improving the projection quality. By dynamically adjusting the optimization step size, the convergence speed of the algorithm can be accelerated. When the projection quality reaches the preset target threshold, it is considered that the ideal projection effect has been achieved and the iterative optimization stops.
[0137] In summary, the non-planar adjustment method of the projection area of the present invention fully integrates key technologies such as laser scanning modeling, GPU parallel computing, real-time adaptive adjustment and iterative optimization, etc., can accurately obtain the geometric information of the projection area, efficiently realize the global non-planar adjustment of the projection image, and dynamically adapt to changes in the projection environment, ultimately significantly improving the projection quality and adaptability, and meeting the needs of various projection application scenarios.
[0138] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
[0139] A specific embodiment of the present invention is provided below: an exhibition hall is holding a virtual simulation exhibition, which requires a large-scale immersive projection in a complex architectural environment. The walls inside the exhibition hall present different degrees of curved and folded surface features, which brings great challenges to the realization of the projection effect.
[0140] Specifically, the environmental parameters of the exhibition hall are as follows:
[0141] 1. Projection area: about 300 square meters, covering the main walls of the entire exhibition hall.
[0142] 2. Wall geometry: The walls on the left and right sides are arc-shaped, while the central wall has a certain degree of unevenness.
[0143] 3. Projection resolution requirement: 1080P (1920×1080) and above to ensure clear details of the displayed content.
[0144] 4. Projection brightness requirement: ≥3000 lumens, ensuring good projection effect under certain ambient lighting.
[0145] 5. Projection quality requirements: Indicators such as clarity, contrast, color saturation, etc. should reach an ideal level of more than 95%, and geometric distortion should be less than 5%.
[0146] In order to meet the above requirements, the exhibition hall decided to adopt the non-planar adjustment technology of the projection area proposed in the present invention to achieve an immersive large-scale virtual simulation display by dynamically capturing the wall geometry and optimizing the projection effect in real time.
[0147] Implementation steps
[0148] 1. Elevation data collection and surface modeling
[0149] First, four SICK LMS500 laser scanners were deployed inside the exhibition hall to perform high-density scanning of the walls of the entire projection area. Each scanner has a scanning angle of 270 degrees, a scanning frequency of 50Hz, a scanning resolution of 0.25 degrees, and a measurement accuracy of better than ±5mm. Through the coordinated scanning of the four scanners, a complete three-dimensional elevation data point cloud of the entire projection area can be obtained.
[0150] After data collection is completed, the elevation data point cloud is modeled using the cubic B-spline surface fitting algorithm. Specifically, the elevation data points are first converted into a point set in a three-dimensional Cartesian coordinate system. Where i = 1, 2, ..., M, j = 1, 2, ..., N, M = 4800, N = 5400. Next, use the mathematical expression of the cubic B-spline surface:
[0151]
[0152] The non-planar surface model S(u,v) of the projection area is obtained by fitting. ij The position and weight of the projection area can well capture the complex geometric features of the wall, such as arcs, bumps, etc. After optimization, the final surface model S (u, v) can accurately describe the three-dimensional shape of the entire projection area.
[0153] 2. Curvature calculation and parameter storage
[0154] Based on the surface model S(u,v) established in step 1, we need to calculate the principal curvature k1 and Gaussian curvature k2 of each point in the projection area to prepare for subsequent non-planar adjustments.
[0155] The specific calculation process is as follows: First, using the differential geometry formula, the surface model S(u,v) is differentiated to obtain the first basic form coefficients E, F, G, and the partial derivative S u ,S v Then, substitute into the curvature formula:
[0156]
[0157] The principal curvature k1(u,v) and Gaussian curvature k2(u,v) of each point (u,v) can be calculated.
[0158] The calculated curvature parameters k1(u,v) and k2(u,v) are stored in the constant memory of the GPU so that subsequent parallel computing can access them efficiently. At the same time, the original image data I(x,y) to be projected is also copied to the GPU memory to prepare for the next geometric transformation.
[0159] 3. GPU parallel pixel mapping
[0160] Based on the data prepared in step 2, the CUDA programming model is used to implement parallel non-planar adjustment of the projected image on the GPU. Specifically, the entire 1920×1080 resolution projected image is divided into B x =120 rows B y = 90 columns with a total of 10800 thread blocks, each thread block is responsible for processing T x =16 rows T y = 12 columns with a total of 192 pixels.
[0161] For the (k, l)th thread in the (i, j)th thread block, it is responsible for calculating the (x, y)th pixel point (x = i*T x +k,y=j*T y +l) on the ideal plane. Based on the surface model parameters k1(u,v), k2(u,v) obtained in step 2, and the position of the current pixel on the surface, the mapping coordinates of the point on the ideal plane can be calculated using differential geometry formulas:
[0162] u=a1x+a2y+a3
[0163] v=b1x+b2y+b3
[0164] Among them, a1, a2, a3, b1, b2, b3 are coefficients that depend on k1 and k2. Through parallel calculation, the corresponding coordinates (u, v) of the entire projection image on the ideal plane can be obtained.
[0165] To ensure that adjacent pixels maintain continuity after remapping, the following data continuity processing is performed within and between thread blocks:
[0166] Each thread block stores the calculated pixel mapping position (u, v) in the 48KB shared memory of this block, and uses the low latency characteristics of shared memory to achieve fast data interaction within the thread block.
[0167] For pixels located at the boundary of thread blocks, bilinear interpolation processing is required with the corresponding boundary pixels of the four adjacent thread blocks above, below, left and right to calculate continuous mapping coordinates (u, v).
[0168] The thread block transfers the final pixel mapping result from the shared memory to the global memory for subsequent geometric transformation.
[0169] Through this method based on GPU parallel computing and data continuity processing, the mapping calculation of the entire projection image on the ideal plane can be completed efficiently.
[0170] 4. Geometric transformation and projection output
[0171] The last step is to perform a geometric transformation on the original image data I(x, y) according to the corresponding coordinates (u, v) of each pixel on the ideal plane calculated in step 3 to generate a non-planar adjusted projection image I ′ (u,v).
[0172] The specific transformation method uses the bicubic B-spline interpolation algorithm, and its mathematical expression is:
[0173]
[0174] Among them, B3(t) is the cubic B-spline basis function. This interpolation algorithm can better maintain the clarity and continuity of the image after geometric transformation.
[0175] After this step of geometric transformation, the final non-planar adjusted projection image data I can be obtained. ′ (u,v). The image data is sent to four 4K projectors for projection, which can achieve a large immersive projection effect on the entire wall.
[0176] 5. Real-time adaptive adjustment
[0177] In order to cope with the real-time geometric changes in the projection area, this method adopts a real-time monitoring and adaptive adjustment mechanism. During the projection process, the exhibition hall arranged 4 RealSense D435 depth cameras inside the projection area to monitor the geometric shape of the wall in real time.
[0178] Every 10 seconds, the system will analyze and compare the real-time elevation data collected by the depth camera. Once the surface shape of the projection area is found to have obvious changes, such as new objects blocking or wall deformation, it will immediately trigger the re-execution of steps 1 to 4 to obtain updated elevation data, re-establish the surface model, calculate new curvature parameters and pixel mapping relationships, and generate dynamically adjusted projection image data. ″ (u,v), is sent to the projector for real-time update.
[0179] Through this real-time adaptive adjustment mechanism, it can be ensured that the projection effect always conforms to the actual geometric shape of the projection area, and the best projection quality can be maintained even in a dynamically changing environment.
[0180] 6. Iterative Optimization
[0181] In order to further improve the projection quality, this method also adopts an iterative optimization algorithm based on the gradient descent method. Specifically, the evaluation index of the projection quality Q is defined as:
[0182] Q=0.4·Sharpness+0.3·Contrast+0.2·Saturation-0.1·Distortion
[0183] Among them, the higher the sharpness, contrast and color saturation indicators are, the better, and the lower the distortion indicator is, the better.
[0184] In each iteration, according to the current surface model parameters k1(u,v), k2(u,v) and projection image parameters I ″ (u,v), calculate the projection quality Q and the ideal projection quality Q target = 0.95, and using the gradient information Update parameters:
[0185]
[0186] Among them, η is the dynamic step size factor, which can be adjusted according to the convergence of the optimization process.
[0187] When the projection quality Q is higher than the target threshold Q target When =0.95, it is considered that the ideal effect has been achieved and the iterative optimization is stopped.
[0188] Through the iterative optimization of this step, the fitting accuracy of the surface model and the optimization effect of the non-planar adjustment parameters can be further improved, thereby significantly improving the final projection quality.
[0189] Performance testing and analysis
[0190] In order to verify the technical effect of the method of the present invention, detailed performance testing and analysis were carried out in the above implementation scenario, mainly including the following aspects:
[0191] 1. Geometric modeling accuracy
[0192] The elevation data point cloud obtained by laser scanning and the surface model S(u,v) obtained by cubic B-spline surface fitting can accurately describe the complex geometric shape of the entire projection area, including arcs, bumps and other features of the wall.
[0193] Compared with the method of using preset simple geometric models (such as planes, cylindrical surfaces, etc.), the geometric modeling accuracy of this method is more than 20% higher.
[0194] 2. Parallel computing performance
[0195] The parallel computing method implemented on the GPU using CUDA increases the computing speed by about 20 times compared to the serial processing based on the CPU.
[0196] At a resolution of 1920×1080, the entire non-planar adjustment process of the projected image takes only 10 milliseconds to complete, which can meet the requirements of real-time projection.
[0197] 3. Image Quality
[0198] After the non-planar adjustment of this method, the clarity, contrast, color saturation and other indicators of the projected image have reached an ideal level of more than 95%.
[0199] The geometric distortion is controlled within 5%, which is much better than the method of manual correction or preset template (usually around 10%).
[0200] Through real-time monitoring and adaptive adjustment, the projection quality can remain stable even when the projection area undergoes geometric changes.
[0201] 4. Iterative optimization effect
[0202] Using the iterative optimization algorithm of gradient descent method, after about 20 iterations, the projection quality index Q reached the ideal level above 0.95.
Claims
1. A method for adjusting a non-planar projection area, characterized in that: The following steps are involved: S10, scanning the projection area with a laser scanner to obtain surface elevation data, converting the obtained elevation data into a mathematical model, and establishing a surface model of the projection area using differential geometry and surface theory; S20, calculating the curvature and distortion of each point in the projection area according to the surface model; S30, loading the original image data into the GPU video memory, and loading the surface model parameters and curvature distortion data into the GPU constant memory for access by the CUDA core; S40, dividing the thread grid, assigning the image pixels to different thread blocks for parallel processing, each thread calculating the corresponding position of the assigned pixel point on the ideal plane according to the position of the pixel point on the surface model and the curvature distortion; S50, storing the calculated pixel position into the shared memory, achieving data continuity between the main area and the boundary area inside the thread block, ensuring that adjacent pixels on the surface maintain continuity after remapping, and storing the result back into the global memory after the thread block completes the internal data connection; S60, performing data continuity processing on the boundary area between thread blocks on the data in the global memory to achieve the continuity of the entire image data, and performing geometric transformation on the connected image data to generate projection image data after non-planar adjustment; S70, sending the adjusted projection image data to the projector to complete the projection, monitoring the changes of the projection area surface in real time, reacquiring the elevation data, dynamically adjusting the surface model parameters and the projection image parameters, and adaptively adjusting the projection effect; S80, using iterative optimization algorithm, continuously optimizes the surface model and non-planar adjustment parameters to improve projection quality.
2. A method for adjusting a non-planar projection area according to claim 1, characterized in that: The step S10 specifically includes: Step 101: Scan the projection area using a laser scanner to obtain three-dimensional elevation data of the surface of the area; Step 102: mathematically model the acquired elevation data, and use differential geometry and surface theory to establish a non-planar surface model of the projection area to accurately describe the geometric shape of the projection area.
3. A method for adjusting a non-planar projection area according to claim 1, characterized in that: The specific steps of step S20 include: Step 201: According to the established surface model, using the curvature formula in differential geometry, differential operation is performed on the surface model to obtain the principal curvature and Gaussian curvature of each position point; Step 202: Store the calculated curvature data in the constant memory of the GPU.
4. The method for adjusting a non-planar projection area according to claim 1, characterized in that: The specific steps of step S30 include: Step 301, copying the original image data to be projected into the video memory of the GPU; Step 302: Copy the surface model parameters to the constant memory of the GPU.
5. The method for adjusting the non-planarity of a projection area according to claim 1, characterized in that: The specific steps of step S40 include: Step 401: Divide the entire image into multiple thread blocks according to the characteristics of GPU hardware, and each thread block is responsible for processing a portion of pixels in the image; Step 402: Each thread block is further subdivided into multiple threads, and each thread is responsible for calculating the mapping position of a pixel point on the ideal plane; Step 403: using the surface model parameters and the coordinate position of the pixel point on the surface, the corresponding coordinates of the point on the ideal plane are calculated using differential geometry formulas.
6. The method for adjusting a non-planar projection area according to claim 1, characterized in that: The specific steps of step S50 include: Step 501: Each thread block stores the calculated pixel mapping position in the shared memory of the block, and uses the low latency and high bandwidth characteristics of the shared memory to ensure fast data interaction within the thread block; Step 502: Two types of pixels are processed inside the thread block: pixels in the main area are stored in the shared memory; pixels in the boundary area need to exchange data with adjacent thread blocks to ensure that adjacent pixels on the surface maintain continuity after remapping; Step 503: The thread block transfers the calculation result from the shared memory to the global memory for subsequent processing.
7. The method for adjusting a non-planar projection area according to claim 1, characterized in that: The specific steps of step S60 include: Step 601: Perform data connection operation between thread blocks on the pixel mapping result stored in the global memory to ensure that the boundary pixels between different thread blocks remain continuous after remapping; Step 602: Use the corresponding position of each pixel on the ideal plane to perform geometric transformation on the original image data to generate final non-planar adjusted projection image data.
8. The method for adjusting a non-planar projection area according to claim 1, characterized in that: The specific steps of step S70 include: Step 701, sending the projection image data calculated in step S60 and adjusted to the non-planar surface to the projector to complete the actual projection process; Step 702: Use a camera or other sensing device to monitor the geometric changes of the projection area surface in real time. Once the surface shape changes, immediately re-execute steps S10 to S60 to obtain new elevation data, update the surface model parameters and projection image parameters, and thus dynamically adjust the projection effect.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the method for adjusting the non-planarity of a projection area according to any one of claims 1 to 8.
10. A projection area non-planar adjustment system, characterized in that: A computer-readable storage medium comprising the computer-readable storage medium of claim 9.
Citation Information
Cited By
Virtual exhibition hall generation method and device based on arc-shaped screen
CN119722443A
