Imaging correction method, device, display device, storage medium and program product
By obtaining the center point coordinates and distortion coefficients of the test picture when the display device is started and calculating the distorted pixel point coordinates, the problem of inconsistent optical distortion of the display device lens is solved, and the image correction is achieved is optimized, which improves the accuracy of image correction.
Patent Information
- Application Number
- CN202310644594.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-01
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2043-06-01
AI Technical Summary
In the prior art, the optical distortion degree of the lens of the display device is inconsistent, resulting in the inability to effectively correct the images in each display device through a single distortion function.
When the display device is started, obtain the coordinates of the center point of the test picture, determine multiple distortion values and distortion coefficients, select the target sampling point to obtain the coordinates of the original pixel point, calculate the coordinates of the distorted pixel point, and perform image correction based on the actual deformation.
This achieves the optimization of image distortion for each display device, improving the accuracy and effect of image correction.
Smart Images

Figure CN116664437B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image processing, and in particular, to an image correction method, apparatus, display device, storage medium, and computer program product. Background Art
[0002] In the traditional method, for the correction of image distortion caused by lens optical distortion, during the development stage of the display device, first, the optical distortion offset data of each sub-pixel is measured, and then based on the actually measured optical distortion offset data of each sub-pixel, the corresponding distortion function is deduced and applied to the system side to correct the image distortion.
[0003] However, since the distortion function is set on the system side during the development stage of the display device, and the optical distortion degrees of the lenses in the display device are also different, it is impossible to correct the images in each display device through a single distortion function. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide an image correction method, apparatus, head-mounted display device, computer-readable storage medium, and computer program product that can realize customized optimization of image distortion.
[0005] In a first aspect, the present application provides an image correction method. Applied to a display device, the method includes:
[0006] When the display device is starting up, obtain the currently displayed test picture;
[0007] Calculate the center point coordinates of the test picture;
[0008] According to the center point coordinates, determine a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount;
[0009] Select a target sampling point and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture;
[0010] According to a plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates, calculate the distorted pixel point coordinates of the target sampling point;
[0011] According to the distorted pixel point coordinates, calculate the actual deformation amount of the test picture;
[0012] According to the actual deformation amount, correct the test picture.
[0013] In one embodiment, the test picture includes a preset undistorted rectangular area, and calculating the current center point coordinates of the test picture includes:
[0014] Calculating the current center point coordinates of the test picture according to the midpoints of the four sides of the preset undistorted rectangular area.
[0015] In one embodiment, determining a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount according to the center point coordinates includes:
[0016] Dividing the test picture into a plurality of concentric regions according to the horizontal axis, the vertical axis and the center point coordinates, wherein the center point coordinates of each region are the same as the center point coordinates of the test picture; the plurality of concentric regions include a preset undistorted rectangular area, and the horizontal axis and the vertical axis are set based on the center point coordinates of the test picture;
[0017] Calculating a first distortion amount and the remaining distortion amounts except the first distortion amount according to the center point coordinates, the distortion coefficient corresponding to the first distortion amount being a preset first distortion coefficient, and the first distortion amount being the vertical distance from the center point coordinates to the boundary of the preset undistorted rectangular area;
[0018] Determining the distortion coefficient corresponding to the remaining distortion amounts according to the first distortion amount and the remaining distortion amounts except the first distortion amount;
[0019] Determining whether it is necessary to adjust the distortion coefficient according to a preset requirement;
[0020] In the case where it is necessary to adjust the distortion coefficient, adjusting the distortion coefficient to obtain an adjusted distortion coefficient.
[0021] In one embodiment, determining whether it is necessary to adjust the distortion coefficient according to a preset requirement includes:
[0022] Setting an X-axis and a Y-axis for each region in the divided test picture according to the center point coordinates of the test picture, and setting sampling points for each region;
[0023] Determining whether it is necessary to adjust the distortion coefficient according to the sampling points on each region.
[0024] In one embodiment, the sampling points include a first type of sampling points, and the first type of sampling points are the intersection points of the X-axis set on each region and the boundary of the corresponding region; the distortion coefficient includes a horizontal distortion coefficient; determining whether it is necessary to adjust the distortion coefficient according to the sampling points on each region includes:
[0025] Judging whether the first type of sampling points in each region are on the same horizontal line;
[0026] In the case where the first type of sampling points are not on the same horizontal line, it is determined that the horizontal distortion coefficient needs to be adjusted.
[0027] In one embodiment, the sampling points include second type of sampling points, and the second type of sampling points are the intersections of the set Y-axis and the boundaries of the corresponding regions on each region; the distortion coefficients include vertical distortion coefficients; and determining whether to adjust the distortion coefficients according to the sampling points on each region further includes:
[0028] Determining whether the second type of sampling points in each region are on the same vertical line;
[0029] In the case where the second type of sampling points are not on the same vertical line, it is determined that the vertical distortion coefficient needs to be adjusted.
[0030] In one embodiment, determining whether to adjust the distortion coefficients according to the sampling points on each region further includes:
[0031] In the case where the first type of sampling points are on the same horizontal line and the second type of sampling points are on the same vertical line, it is determined that the distortion coefficients do not need to be adjusted.
[0032] In a second aspect, the present application further provides an image correction device. Applied to a display device, the device includes:
[0033] A picture acquisition module, configured to acquire a currently displayed test picture when the display device is starting up;
[0034] A first coordinate calculation module, configured to calculate the center point coordinates of the test picture;
[0035] A coefficient determination module, configured to determine a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount according to the center point coordinates;
[0036] A second coordinate calculation module, configured to select a target sampling point and acquire the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture;
[0037] A deformation amount calculation module, configured to calculate the pixel point coordinates after distortion of the target sampling point according to a plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates;
[0038] A deformation amount calculation module, configured to calculate the actual deformation amount of the test picture according to the pixel point coordinates after distortion;
[0039] A correction module, configured to correct the test picture according to the actual deformation amount.
[0040] In a third aspect, the present application further provides a head-mounted display device. The head-mounted display device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0041] When the display device is starting up, obtain the currently displayed test picture;
[0042] Calculate the center point coordinates of the test picture;
[0043] According to the center point coordinates, determine a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount;
[0044] Select a target sampling point and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture;
[0045] According to a plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates, calculate the distorted pixel point coordinates of the target sampling point;
[0046] According to the distorted pixel point coordinates, calculate the actual deformation amount of the test picture;
[0047] According to the actual deformation amount, correct the test picture.
[0048] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0049] When the display device is starting up, obtain the currently displayed test picture;
[0050] Calculate the center point coordinates of the test picture;
[0051] According to the center point coordinates, determine a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount;
[0052] Select a target sampling point and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture;
[0053] According to a plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates, calculate the distorted pixel point coordinates of the target sampling point;
[0054] According to the distorted pixel point coordinates, calculate the actual deformation amount of the test picture;
[0055] Modify the test image according to the actual deformation amount.
[0056] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0057] When the display device is starting up, obtain the currently displayed test image;
[0058] Calculate the center point coordinates of the test image;
[0059] According to the center point coordinates, determine a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount;
[0060] Select a target sampling point and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test image;
[0061] According to a plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates, calculate the distorted pixel point coordinates of the target sampling point;
[0062] According to the distorted pixel point coordinates, calculate the actual deformation amount of the test image;
[0063] Modify the test image according to the actual deformation amount.
[0064] The above image correction method, device, head-mounted display device, storage medium, and computer program product, when the display device is starting up, obtain the currently displayed test image; calculate the center point coordinates of the test image; according to the center point coordinates, determine a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount; select a target sampling point and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test image; according to a plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates, calculate the distorted pixel point coordinates of the target sampling point; according to the distorted pixel point coordinates, calculate the actual deformation amount of the test image; modify the test image according to the actual deformation amount. By using this method, it is possible to calculate the actual deformation amount of the test image based on the currently displayed test image when the display device starts up, so as to modify the test image according to the actual deformation amount, and realize the optimization of image distortion for each display device. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is an application environment diagram of the image correction method in an embodiment;
[0066] Figure 2 It is a flowchart of the image correction method in an embodiment;
[0067] Figure 3 Structural diagram of the image correction module in one embodiment;
[0068] Figure 4 Schematic diagram of an undistorted image in one embodiment;
[0069] Figure 5 Schematic diagram of a barrel - distorted image in one embodiment;
[0070] Figure 6 Schematic diagram of a pincushion - distorted image in one embodiment;
[0071] Figure 7 Schematic diagram of calculating the actual deformation amount in one embodiment;
[0072] Figure 8 Schematic diagram of calculating the center point coordinates in one embodiment;
[0073] Figure 9 Flow schematic diagram of determining the distortion coefficient in one embodiment;
[0074] Figure 10 Schematic diagram of the division of concentric regions in one embodiment;
[0075] Figure 11 Flow schematic diagram of adjusting the distortion coefficient in one embodiment;
[0076] Figure 12 Schematic diagram of the horizontal distortion coefficient and the vertical distortion coefficient in one embodiment;
[0077] Figure 13 Flow schematic diagram of using a display device in one embodiment;
[0078] Figure 14 Flow schematic diagram of an image correction method in another embodiment;
[0079] Figure 15 Structural block diagram of the image correction device in one embodiment;
[0080] Figure 16 Internal structural diagram of a head - mounted display device in one embodiment. Detailed implementation manners
[0081] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0082] With the development of technology, more and more people start to use head-mounted display devices to view images, such as VR displays. However, when using a display device to view images, there is a certain degree of distortion. In the traditional method, for the correction of image distortion caused by lens optical distortion, it is adjusted by setting a distortion function during the display device development stage, and the optical distortion degrees of the lenses used in the display devices are also different, resulting in the inability to correct the images in each display device through a single distortion function.
[0083] To solve this problem, the image correction method of the present application is proposed, which can be applied to the application environment as Figure 1 shown. Among them, the display device 102 communicates with the server 104 through a network. The data storage system can store the pictures that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed in the cloud or other network servers. The display device 102 can be provided with a memory, which can be used to store the pictures that the display device 102 needs to process.
[0084] When the display device 102 is starting up, it obtains the test picture sent by the server 104, calculates the center point coordinates of the test picture according to the test picture, determines a plurality of distortion amounts and the distortion coefficients corresponding to each distortion amount according to the center point coordinates; selects the target sampling points, and obtains the original pixel point coordinates of the target sampling points; the target sampling points are the vertices of the respective boundaries of the test picture; according to the plurality of distortion amounts, the distortion coefficients corresponding to each distortion amount and the original pixel point coordinates, calculates the distorted pixel point coordinates of the target sampling points; calculates the actual deformation amount of the test picture according to the distorted pixel point coordinates; and corrects the test picture according to the actual deformation amount.
[0085] Among them, the test picture can be stored in the server 104, or can be pre-stored in the memory of the display device 102.
[0086] The display device 102 includes but is not limited to various portable wearable devices. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0087] In one embodiment, as Figure 2 shown, a kind of image correction method is provided, taking the display device 102 in Figure 1 as an example for illustration, including the following steps:
[0088] Step 202, when the display device is starting up, obtain the currently displayed test picture.
[0089] In some embodiments, the display device may be a head-mounted display device, and the head-mounted display device includes an image correction module. Specifically, the structure diagram of the image correction module can be referred to Figure 3 , including an image reflection unit 31, an eye tracking unit 32, an optical display unit 33 and a computing unit 34, wherein the optical display unit 33 includes an optical lens 331, a display screen 332,
[0090] The image reflection unit 31 includes two parts, a mirror surface and an opaque and scratch-resistant material. It can be designed with a pull-out protective cover, which can be used to protect the optical lens and display screen in the optical display unit when the head-mounted display device is not turned on; when the head-mounted display device is turned on, it is used to reflect the image from the display screen to provide the eye tracking unit with distortion information of the test image and send it to the computing unit to achieve image correction.
[0091] The eye tracking unit 32 includes a camera, which detects distortion information of the test image and is used to calculate the rotation angle and gaze direction of the user's eyes.
[0092] The optical display unit 33 includes an optical lens 331 and a display screen 332 , and performs near-eye display through the combination of the optical lens and the display screen.
[0093] The computing unit 34 is used to perform image correction or estimate the user's gaze point position based on the information detected by the eye tracking unit.
[0094] A test image is set in the display device. The test image has a collinear feature. When the test image is displayed normally, the midpoints of the four sides of the test image and the two vertices of the corresponding boundary are on a straight line, indicating that the test image has a collinear feature. Specifically, the display of the test image in the undistorted state can be referred to Figure 4 .
[0095] Exemplarily, when the head mounted display device is starting up, the currently displayed test picture can be obtained from the server or the memory of the head mounted display device. The currently displayed test picture may be in a distorted state or in an undistorted state.
[0096] Image distortion is a type of optical distortion. Optical distortion refers to an optical aberration that causes physical straight lines to deform and bend. Image distortion generally includes two types: barrel distortion and pincushion distortion. Barrel distortion is a distortion phenomenon caused by the lens in which the image appears to expand in a barrel shape. This is usually more likely to occur on wide-angle lenses. Pincushion distortion is a phenomenon in which the image "shrinks" toward the middle caused by the lens. This is usually more likely to occur on telephoto lenses. Specifically, images with barrel distortion can be referred to Figure 5 ; The image with pincushion distortion can be referenced Figure 6。
[0097] Step 204, calculate the center point coordinates of the test picture.
[0098] Among them, the center point coordinates of the test picture are the center of the test image.
[0099] In some embodiments, the eye tracking unit in Figure 3 can be used to monitor the test picture to calculate the center point coordinates of the test picture. Specifically, in the case of distortion of the test picture, the center coordinates of the test picture can be calculated by setting an undistorted rectangular area in the test picture for calculation.
[0100] Step 206, determine a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount according to the center point coordinates.
[0101] Exemplarily, the distortion amount is calculated according to the center point coordinates, and the distortion coefficient corresponding to each distortion amount can be determined according to the magnitudes of the plurality of distortion amounts.
[0102] In some embodiments, the test picture can be divided into a plurality of concentric regions, and the corresponding center is the center point coordinates of the test picture. Specifically, the regions can be sequentially divided outward based on the center point coordinates of the test picture to obtain the distortion amounts of each region, and the distortion coefficient corresponding to each distortion amount can be determined according to the distortion amounts of each region.
[0103] Step 208, select target sampling points and obtain the original pixel point coordinates of the target sampling points; the target sampling points are the respective boundary vertices of the test picture.
[0104] Exemplarily, the target sampling points are selected from the test picture, and the vertices of each boundary in the test picture can be selected. Generally, the vertices of each boundary in the test picture include 4 vertices of the test picture and 4 center points of the test picture boundary. Therefore, there are a total of 8 target sampling points. Specifically, the positions of the target sampling points on the test picture can refer to Figure 7 。
[0105] In some embodiments, after the target sampling points are selected, the original pixel point coordinates of the target sampling points can be obtained, which are the coordinates of the target sampling points in the case of no distortion.
[0106] Step 210, calculate the distorted pixel point coordinates of the target sampling points according to the plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates.
[0107] In some embodiments, a test picture can be divided into multiple concentric regions, and the corresponding center is the center point coordinates of the test picture. When there are a certain number of concentric regions, there can be the same number of distortion amounts, as well as the distortion coefficients corresponding to each distortion amount. Thus, according to the multiple distortion amounts, the distortion coefficients corresponding to each distortion amount, and the original pixel coordinates of the selected target sampling points, the pixel coordinates of the distorted target sampling points can be calculated.
[0108] Step 212: Calculate the actual deformation amount of the test picture according to the distorted pixel coordinates.
[0109] In some embodiments, the actual deformation amount of the test picture can be calculated according to the pixel coordinates of the distorted target sampling points. Specifically, the target sampling points include the vertices of the test picture at each boundary, and the actual deformation amount of the test picture can be calculated according to the vertical distance between the highest point and the lowest point of the corresponding boundary of the test picture.
[0110] To better understand the process of calculating the actual deformation amount, an example is given for illustration. Specifically, referring to Figure 7 , a schematic diagram for calculating the actual deformation amount is shown, which is a calculation of the actual deformation amount of the test picture in the case of barrel distortion. Among them, there are a total of four actual deformation amounts in the test picture, which are d T , d D , d L and d R . If the X-axis and Y-axis are divided according to the center point coordinates of the test picture, the corresponding d T and d D are the difference values of the test picture on the Y-axis, which can be simply referred to as Y d ; the corresponding d L and d R are the difference values of the test picture on the X-axis, which can be simply referred to as X d .
[0111] Specifically, the calculation method of the actual deformation amount can be calculated according to the vertical distance between the highest point and the lowest point of the corresponding boundary of the test picture.
[0112] Step 214: Correct the test picture according to the actual deformation amount.
[0113] Exemplarily, when the magnitude of the actual deformation amount is equal to 0 or approaches 0, it is determined that the test picture is in an undistorted state; when the magnitude of the actual deformation amount is greater than 0, it is determined that the test picture is in a distorted state.
[0114] In some embodiments, after calculating the actual deformation amount of the test picture, image distortion compensation can be performed through the image processing chip in the display device to correct Xd and Y d until the actual deformation amount is equal to 0 or approaches 0.
[0115] Exemplarily, the image processing chip can be a sensor chip or a video processing chip. Specifically, the type of the image processing chip can be selected according to the actual situation, and the present invention does not limit this here.
[0116] In the above image correction method, when the display device is starting up, obtain the currently displayed test picture; calculate the center point coordinates of the test picture; determine multiple distortion amounts and the distortion coefficient corresponding to each distortion amount according to the center point coordinates; select the target sampling points, and obtain the original pixel point coordinates of the target sampling points; the target sampling points are the vertices of the respective boundaries of the test picture; calculate the pixel point coordinates after distortion of the target sampling points according to the multiple distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates; calculate the actual deformation amount of the test picture according to the pixel point coordinates after distortion; and correct the test picture according to the actual deformation amount. By using this method, it is possible to calculate the actual deformation amount of the test picture according to the currently displayed test picture when the display device starts up, so as to correct the test picture according to the actual deformation amount, and realize the optimization of image distortion for each display device.
[0117] In one embodiment, the test picture includes a preset undistorted rectangular area, and step 104 includes:
[0118] Calculate the current center point coordinates of the test picture according to the midpoints of the four sides of the preset undistorted rectangular area.
[0119] In some embodiments, regardless of whether the test picture has barrel or pincushion optical distortion, the farther the area is from the center of the lens, the more serious its image distortion is. Therefore, in the case of barrel distortion and pincushion distortion, the distortion of the sampling points closer to the center point is smaller. Based on this, it is set that the test picture includes a preset undistorted rectangular area. Specifically, reference can be made to Figure 7 , which shows a schematic diagram of calculating the center point coordinates. When the test picture has barrel distortion, the preset undistorted rectangular area may include P A , P B , P C , P D , P E These five points. Among them, P A , P B , P D , P E Are the boundary centers of the undistorted rectangular area, and P Cis the center point coordinate. Considering that the characteristics of each optical lens are different, the size of this rectangular area is not specifically defined. Specifically, the smaller the rectangular area, the finer the area for image distortion adjustment, but the greater the workload for image data processing; conversely, the larger the rectangle, the coarser the area for image distortion adjustment, but the smaller the workload for image data processing.
[0120] In this embodiment, the current center point coordinate of the test picture can be calculated according to the midpoints of the four sides of the preset undistorted rectangular area, so as to calculate the actual deformation amount of the test picture according to the center point coordinate, and the test picture can be corrected according to the actual deformation amount, realizing the optimization of image distortion for each display device.
[0121] In one embodiment, refer to Figure 9 , which shows a schematic flow chart for determining the distortion coefficient. Step 208 includes:
[0122] Step 902, divide the test picture into multiple concentric regions according to the horizontal axis, vertical axis, and the center point coordinate, wherein the center point coordinates of each region are the same as the center point coordinate of the test picture; the multiple concentric regions include a preset undistorted rectangular area, and the horizontal axis and the vertical axis are set based on the center point coordinate of the test picture.
[0123] In some embodiments, the horizontal axis and the vertical axis are set based on the center point coordinate of the test picture, so as to divide the test picture into multiple concentric regions according to the center point coordinate, horizontal axis, and vertical axis of the test picture. Specifically, the regions divided by the test picture may include a preset undistorted rectangular area, and the test picture can be divided into a preset number of concentric regions according to the size of the preset undistorted rectangular area. Specifically, the division of the concentric regions in the test picture can refer to Figure 10 , including the center point coordinate P0 and 4 concentric regions, including the r0 region, r1 region, r2 region, and r3 region.
[0124] Exemplarily, the more regions the test picture is divided into, the finer the area for image distortion adjustment, but the greater the workload for image data processing. Specifically, the size of the preset number can be set according to the actual situation, and the present invention does not limit this here.
[0125] Specifically, in the process of dividing the concentric regions in the test image, the size of each region can be set to be the same, or it can be set by itself according to the actual situation, and the present invention does not limit this here.
[0126] Step 904: Calculate the first distortion amount and the remaining distortion amounts except the first distortion amount according to the center point coordinates. The distortion coefficient corresponding to the first distortion amount is a preset first distortion coefficient, and the first distortion amount is the vertical distance from the center point coordinates to the boundary of the preset undistorted rectangular area.
[0127] In some embodiments, according to the center point coordinates of the test image, the first distortion amount and the remaining distortion amounts except the first distortion amount can be calculated. Among them, the first distortion amount is the vertical distance from the center point coordinates to the boundary of the preset undistorted rectangular area. Since the shape of the preset undistorted rectangle is rectangular, there are two values corresponding to the first distortion amount. The remaining distortion amounts are the vertical distances from the center point coordinates to the boundaries of the remaining areas except the preset undistorted rectangular area. Specifically, since the first distortion amount is the vertical distance from the center point coordinates to the boundary of the preset undistorted rectangular area, the first distortion amount is determined as a reference value, and the corresponding distortion coefficient is the preset first distortion coefficient. The preset first distortion coefficient can be selected according to empirical values, and the present invention does not limit this here.
[0128] Step 906: Determine the distortion coefficient corresponding to the remaining distortion amounts according to the first distortion amount and the remaining distortion amounts except the first distortion amount.
[0129] In some embodiments, the first distortion amount can be a reference value. The distortion coefficient corresponding to the remaining distortion amounts can be calculated according to the first distortion amount and the remaining distortion amounts except the first distortion amount. Among them, the distortion coefficient can be obtained according to the value of the remaining distortion amount divided by the first distortion amount.
[0130] To better understand the calculation method of the distortion coefficient, the following is an example for illustration. Suppose there are 4 distortion amounts in the test image, namely the first distortion amount r0, the second distortion amount r1, the third distortion amount r2, and the fourth distortion amount r3. Then the calculation method of the distortion coefficient k1 corresponding to the second distortion amount r1 is k1 = r1 ÷ r0; the calculation method of the distortion coefficient k2 corresponding to the third distortion amount r2 is k2 = r2 ÷ r0; the calculation method of the distortion coefficient k3 corresponding to the fourth distortion amount r3 is k3 = r3 ÷ r0.
[0131] Step 908: Determine whether it is necessary to adjust the distortion coefficient according to the preset requirements.
[0132] In some embodiments, it can be determined whether it is necessary to adjust the distortion coefficient according to the preset requirements. Specifically, the preset requirements can be to set sampling points, and according to the coordinate information of the set sampling points, it is determined whether it is necessary to adjust the distortion coefficient.
[0133] Step 910: In the case where it is necessary to adjust the distortion coefficient, adjust the distortion coefficient to obtain the adjusted distortion coefficient.
[0134] In some embodiments, when it is determined that the distortion coefficient needs to be adjusted, the distortion coefficient is adjusted to obtain an adjusted distortion coefficient until the adjusted distortion coefficient meets the preset requirements, and then the adjustment of the distortion coefficient is stopped. Based on the adjusted distortion coefficient, the pixel coordinates of the distorted target sampling points are calculated.
[0135] In this embodiment, based on the center point coordinates, the first distortion amount and the remaining distortion amount are calculated. Based on the first distortion amount and the remaining distortion amount, the distortion coefficient corresponding to the remaining distortion amount is determined, and according to the preset requirements, it is judged whether the distortion coefficient needs to be adjusted, so as to more accurately adjust the distortion coefficient, and thus more accurately perform image correction based on the distortion coefficient.
[0136] In one embodiment, step 906 includes:
[0137] Based on the center point coordinates of the test picture, an X-axis and a Y-axis are set for each region in the divided test picture, and sampling points for each region are set.
[0138] Based on the sampling points in each region, it is determined whether the distortion coefficient needs to be adjusted.
[0139] In some embodiments, the method of setting sampling points in each region may be: taking the center point coordinates of the test picture as the origin, setting an X-axis and a Y-axis for each concentric region in the test picture to obtain the sampling points for each region, and based on the sampling points for each region, it is determined whether the distortion coefficient needs to be adjusted.
[0140] In this embodiment, based on the center point coordinates of the test picture, a horizontal axis and a vertical axis are set. Based on the center point coordinates, the horizontal axis and the vertical axis of the test picture, the test picture is divided into multiple concentric regions. Based on the center point coordinates of the test picture, an X-axis and a Y-axis are set for each region in the divided test picture, and sampling points for each region are set. Based on the sampling points in each region, it is determined whether the distortion coefficient needs to be adjusted. By dividing the test picture into multiple concentric regions and setting sampling points for each region, it is possible to more accurately determine whether the distortion coefficient needs to be adjusted based on the sampling points for each region of the test picture.
[0141] In one embodiment, the sampling points include first-type sampling points, and the first-type sampling points are the intersection points of the X-axis set for each region and the boundary of the corresponding region; the distortion coefficient includes a horizontal distortion coefficient; determining whether the distortion coefficient needs to be adjusted based on the sampling points in each region includes:
[0142] Judging whether the first-type sampling points in each region are on the same horizontal line;
[0143] In the case where the first type of sampling points are not on the same horizontal line, it is determined that the horizontal distortion coefficient needs to be adjusted.
[0144] Among them, the distortion amount can include the horizontal distortion amount, and the corresponding distortion coefficient includes the horizontal distortion coefficient; the sampling points can include the first type of sampling points, and the first type of sampling points are the intersections of the set X-axis and the boundaries of the corresponding regions on each region. Specifically, it is determined whether the first type of sampling points in each region are on the same horizontal line; in the case where the first type of sampling points in each region of the test image are not on the same horizontal line, it is determined that the horizontal distortion coefficient needs to be adjusted. Specifically, the horizontal distortion coefficient can be adjusted according to the empirical value until the first type of sampling points in each adjusted region are on the same horizontal line.
[0145] In this embodiment, by selecting the intersections of the set X-axis and the boundaries of the corresponding regions on each region as the first type of sampling points, and determining whether the first type of sampling points are on the same horizontal line, in the case where the first type of sampling points are not on the same horizontal line, the horizontal distortion coefficient is adjusted, so as to obtain a more accurate horizontal distortion coefficient, and according to the more accurate horizontal distortion coefficient, more accurate image correction is realized.
[0146] In one embodiment, the sampling points include the second type of sampling points, and the second type of sampling points are the intersections of the set Y-axis and the boundaries of the corresponding regions on each region; the distortion coefficient includes the vertical distortion coefficient; the determining whether the distortion coefficient needs to be adjusted according to the sampling points on each region further includes:
[0147] Determine whether the second type of sampling points in each region are on the same vertical line;
[0148] In the case where the second type of sampling points are not on the same vertical line, it is determined that the vertical distortion coefficient needs to be adjusted.
[0149] Among them, the distortion amount can include the vertical distortion amount, and the corresponding distortion coefficient includes the vertical distortion coefficient; the sampling points can include the second type of sampling points, and the second type of sampling points are the intersections of the set Y-axis and the boundaries of the corresponding regions on each region. Specifically, it is determined whether the second type of sampling points in each region are on the same vertical line; in the case where the second type of sampling points in each region of the test image are not on the same vertical line, it is determined that the vertical distortion coefficient needs to be adjusted. Specifically, the vertical distortion coefficient can be adjusted according to the empirical value until the second type of sampling points in each adjusted region are on the same vertical line.
[0150] In this embodiment, by selecting the intersection points of the set Y-axis on each region and the boundaries of the corresponding regions as the second type of sampling points, and determining whether the second type of sampling points are on the same vertical line, in the case where the second type of sampling points are not on the same vertical line, the vertical distortion coefficient is adjusted, so as to obtain a more accurate vertical distortion coefficient, and based on the more accurate vertical distortion coefficient, more accurate image correction is achieved.
[0151] In one embodiment, the determining whether to adjust the distortion coefficient according to the sampling points on each region further includes:
[0152] In the case where the first type of sampling points are on the same horizontal line and the second type of sampling points are on the same vertical line, it is determined that the distortion coefficient does not need to be adjusted.
[0153] In some embodiments, if the first type of sampling points and the second type of sampling points in the test picture meet the preset requirements, it is determined that the distortion coefficient does not need to be adjusted. Specifically, when the distortion coefficient needs to be adjusted, after adjusting the distortion coefficient to obtain the adjusted distortion coefficient, it is necessary to determine again whether the first type of sampling points are on the same horizontal line and whether the second type of sampling points are on the same vertical line until the first type of sampling points corresponding to the adjusted distortion coefficient are on the same horizontal line and the second type of sampling points are on the same vertical line.
[0154] In this embodiment, in the case where the first type of sampling points are on the same horizontal line and the second type of sampling points are on the same vertical line, it indicates that the distortion coefficient does not need to be adjusted. Based on multiple distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates, the distorted pixel point coordinates of the target sampling point are calculated, so as to calculate the actual deformation amount of the test picture, and based on the actual deformation amount, the test picture is corrected, realizing the tailored optimization of image distortion for each display device.
[0155] To better understand the adjustment process of the distortion coefficient, an example is used for illustration. Refer to Figure 11 , which shows a schematic diagram of the adjustment process of the distortion coefficient.
[0156] Step 1102, when the display device is starting up, obtain the currently displayed test picture.
[0157] Step 1104, calculate the center point coordinates of the test picture.
[0158] Step 1106, divide the test picture into multiple concentric regions, select the first type of sampling points and the second type of sampling points for each region, and calculate the sampling point coordinates.
[0159] Specifically, refer to Figure 12, a schematic diagram showing the horizontal distortion coefficient and the vertical distortion coefficient. Taking the division of the test picture into 4 concentric regions as an example, the middle region is a preset undistorted rectangular region, and the preset first distortion coefficient includes the first horizontal distortion coefficient and the first vertical distortion coefficient The distortion coefficients corresponding to the remaining distortion amounts are the second distortion coefficient, the third distortion coefficient, and the fourth distortion coefficient respectively; the second distortion coefficient includes the second horizontal distortion coefficient and the second vertical distortion coefficient The third distortion coefficient includes the third horizontal distortion coefficient and the first vertical distortion coefficient The fourth distortion coefficient includes the third horizontal distortion coefficient and the first vertical distortion coefficient According to the original pixel point coordinates of the sampling points, multiple distortion amounts, and the corresponding distortion coefficients, calculate the distorted pixel point coordinates of the sampling points.
[0160] Specifically, taking 4 concentric regions as an example, the formula for calculating the distorted pixel point coordinates of the sampling points according to the original pixel point coordinates of the sampling points, multiple distortion amounts, and the corresponding distortion coefficients is as follows:
[0161]
[0162]
[0163] Among them, (X u , X u ) are the original pixel point coordinates, (X d , X d ) are the distorted pixel point coordinates, k offset-x is the compensation adjustment value for the X-axis, k offset-y is the compensation adjustment value for the Y-axis. The magnitudes of the compensation adjustment value for the X-axis and the compensation adjustment value for the Y-axis can be set according to empirical values. Generally, the set values are relatively small, or the set value magnitudes are 0.
[0164] Step 1108, determine whether the first type of sampling points in each region are on the same horizontal line.
[0165] Step 1110, if the first type of sampling points in each region are not on the same horizontal line, then adjust the horizontal distortion coefficients of each region.
[0166] Step 1112, determine whether the second type of sampling points in each region are on the same vertical line.
[0167] Step 1114, if the second type of sampling points in each region are not on the same vertical line, then adjust the vertical distortion coefficients of each region.
[0168] Step 1116: Determine whether the distortion coefficients of each region have been adjusted. If not, it indicates that the first type of sampling points corresponding to the distortion coefficients are on the same horizontal line, and the second type of sampling points are on the same vertical line. In the case where the distortion coefficients of each region have been adjusted, recalculate the sampling point coordinates of each region according to the adjusted distortion coefficients.
[0169] To better understand the process of adjusting the distortion coefficients, an example is given for illustration. Refer to Figure 13 , which shows a schematic flow diagram of using a display device.
[0170] Step 1302: When the display device is started, perform collinear feature detection.
[0171] Specifically, when the display device is starting up, use the infrared sensor in the eye tracking unit to detect the test picture to calculate the center point coordinates of the test picture; the test picture has collinear features.
[0172] Step 1304: Calculate the actual deformation amount of the test picture and perform image distortion correction.
[0173] Exemplarily, according to the center point coordinates and the test picture with collinear features, after calculating the actual deformation amount of the test picture, perform image distortion correction; specifically, how to calculate the actual deformation amount of the test picture can refer to the content of the above embodiments.
[0174] Step 1306: Obtain the geometric features of the user's eye movement for calibration.
[0175] Specifically, obtain the geometric features of the user's eye, which are the basis for performing customized and accurate fixation point calculations for the user.
[0176] Step 1308: Detect the user's pupil to obtain the pupil center coordinates of the user.
[0177] Specifically, use the infrared sensor to detect the pupil features of the user to calculate the pupil center coordinates of the current user.
[0178] Step 1310: Detect the user's cornea.
[0179] Specifically, use the infrared sensor to detect the corneal reflection phenomenon of the user and calculate the reflection spot coordinates of the current user.
[0180] Step 1312: Calculate the user's gaze position.
[0181] Specifically, according to the pupil coordinates and the corneal reflection spot coordinates of the user, deduce the user's gaze position.
[0182] Step 1314, render the user's gaze position.
[0183] Specifically, perform screen rendering according to the user's current gaze position.
[0184] To better understand the complete process of image correction in the embodiments of the present invention, a complete example is used for illustration. Refer to Figure 14 , which shows a schematic flowchart of an image correction method in another embodiment, including the following steps:
[0185] Step 1402, when the display device is starting up, obtain the currently displayed test image and calculate the current center point coordinates of the test image.
[0186] Among them, the test image includes a preset undistorted rectangular area, and the current center point coordinates of the test image can be calculated according to the midpoints of the four sides of the preset undistorted rectangular area.
[0187] Step 1404, divide the test image into multiple concentric regions; according to the center point coordinates of the test image, set the X-axis and Y-axis for each region in the divided test image, and set the sampling points for each region.
[0188] Specifically, based on the center point coordinates of the test image, set the horizontal axis and the vertical axis, and divide the test image into multiple concentric regions according to the center point coordinates, horizontal axis and vertical axis of the test image. The method of setting sampling points in each region can be to set the X-axis and Y-axis for each concentric region in the test image with the center point coordinates of the test image as the origin, so as to obtain the sampling points for each region.
[0189] Step 1406, calculate the first distortion amount and the remaining distortion amount except the first distortion amount according to the center point coordinates, so as to calculate the distortion coefficient corresponding to the remaining distortion amount according to multiple distortion amounts.
[0190] Specifically, the method of calculating the distortion amount and the distortion coefficient can refer to the above steps 904 to 906, and will not be described here.
[0191] Step 1408, if the first type of sampling points are not on the same horizontal line, then determine that the horizontal distortion coefficient needs to be adjusted.
[0192] Among them, the first type of sampling points are the intersection points of the X-axis set for each region and the boundary of the corresponding region. It can be determined whether the first type of sampling points are on the same horizontal line according to the coordinate values of the first type of sampling points. If the first type of sampling points are not on the same horizontal line, then adjust the horizontal distortion coefficient.
[0193] Step 1410, if the second type of sampling points are not on the same vertical line, then determine that the vertical distortion coefficient needs to be adjusted.
[0194] Among them, the second type of sampling points are the intersection points of the set Y-axis and the boundaries of the corresponding regions on each region. It is possible to determine whether the second type of sampling points are on the same vertical line according to the coordinate values of the second type of sampling points. If the second type of sampling points are not on the same vertical line, then adjust the vertical distortion coefficient.
[0195] Step 1412, when the first type of sampling points are on the same horizontal line and the second type of sampling points are on the same vertical line, determine that there is no need to adjust the distortion coefficient.
[0196] Specifically, when there is a situation of adjusting the distortion coefficient, after adjusting the distortion coefficient to obtain the adjusted distortion coefficient, it is necessary to determine again whether the first type of sampling points are on the same horizontal line and whether the second type of sampling points are on the same vertical line until the first type of sampling points corresponding to the adjusted distortion coefficient are on the same horizontal line and the second type of sampling points are on the same vertical line, then do not adjust the distortion coefficient.
[0197] Step 1414, select a target sampling point, and obtain the original pixel point coordinates of the target sampling point; calculate the distorted pixel point coordinates of the target sampling point according to multiple distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates.
[0198] Specifically, the method for calculating the distorted pixel point coordinates of the target sampling point can refer to Steps 208 to 210, which will not be described here.
[0199] Step 1416, calculate the actual deformation amount of the test picture according to the distorted pixel point coordinates, and correct the test picture.
[0200] Specifically, the method for calculating the actual deformation amount of the test picture can refer to Steps 212 to 214, which will not be described here.
[0201] In this embodiment, when the display device is starting up, obtain the currently displayed test picture; calculate the center point coordinates of the test picture; determine multiple distortion amounts and the distortion coefficient corresponding to each distortion amount according to the center point coordinates; select a target sampling point, and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture; calculate the distorted pixel point coordinates of the target sampling point according to multiple distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates; calculate the actual deformation amount of the test picture according to the distorted pixel point coordinates; correct the test picture according to the actual deformation amount. By adopting this method, it is possible to calculate the actual deformation amount of the test picture according to the currently displayed test picture when the display device starts up, so as to correct the test picture according to the actual deformation amount, and realize the tailored optimization of image distortion for each display device.
[0202] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this document, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least some of the steps or stages in other steps or other steps.
[0203] Based on the same inventive concept, an embodiment of the present application further provides an image correction device for implementing the above-mentioned image correction method. The implementation solution provided by this device to solve the problem is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following image correction device can refer to the limitations on the image correction method in the above text, and will not be repeated here.
[0204] In one embodiment, as Figure 15 shown, an image correction device is provided, which is applied to a display device and includes: a picture acquisition module 1502, a first coordinate calculation module 1504, a coefficient determination module 1506, a coordinate acquisition module 1508, a second coordinate calculation module 1510, a deformation amount calculation module 1512, and a correction module 1514, where:
[0205] The picture acquisition module 1502 is configured to acquire a currently displayed test picture when the display device is starting up;
[0206] The first coordinate calculation module 1504 is configured to calculate the center point coordinates of the test picture;
[0207] The coefficient determination module 1506 is configured to determine a plurality of distortion amounts and a distortion coefficient corresponding to each distortion amount according to the center point coordinates;
[0208] The coordinate acquisition module 1508 is configured to select a target sampling point and acquire the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture;
[0209] The second coordinate calculation module 1510 is configured to calculate the distorted pixel point coordinates of the target sampling point according to a plurality of distortion amounts, the distortion coefficients corresponding to the distortion amounts, and the original pixel point coordinates;
[0210] A deformation quantity calculation module 1512, configured to calculate an actual deformation quantity of the test picture according to the coordinates of the distorted pixel points;
[0211] A correction module 1514, configured to correct the test picture according to the actual deformation quantity.
[0212] In some embodiments, the test picture includes a preset undistorted rectangular area, and the first coordinate calculation module 1504 includes:
[0213] A first coordinate calculation sub-module, configured to calculate the current center point coordinates of the test picture according to the midpoints of the four sides of the preset undistorted rectangular area.
[0214] In some embodiments, the coefficient determination module 1506 includes:
[0215] A region division sub-module, configured to divide the test picture into a plurality of concentric regions according to the horizontal axis, the vertical axis, and the center point coordinates, wherein the center point coordinates of each region are the same as the center point coordinates of the test picture; the plurality of concentric regions include a preset undistorted rectangular area, and the horizontal axis and the vertical axis are set based on the center point coordinates of the test picture;
[0216] A distortion quantity calculation sub-module, configured to calculate a first distortion quantity and the remaining distortion quantities except the first distortion quantity according to the center point coordinates, wherein the distortion coefficient corresponding to the first distortion quantity is a preset first distortion coefficient, and the first distortion quantity is the vertical distance from the center point coordinates to the boundary of the preset undistorted rectangular area;
[0217] A first distortion coefficient determination sub-module, configured to determine the distortion coefficients corresponding to the remaining distortion quantities according to the first distortion quantity and the remaining distortion quantities except the first distortion quantity;
[0218] A coefficient adjustment determination sub-module, configured to determine whether to adjust the distortion coefficient according to a preset requirement;
[0219] A first distortion coefficient adjustment sub-module, configured to adjust the distortion coefficient to obtain an adjusted distortion coefficient when the distortion coefficient needs to be adjusted.
[0220] In some embodiments, the coefficient adjustment determination sub-module includes:
[0221] A sampling point setting unit, configured to set an X axis and a Y axis for each region in the divided test picture according to the center point coordinates of the test picture, and set sampling points for each region;
[0222] A coefficient adjustment determination unit, configured to determine whether to adjust the distortion coefficient according to the sampling points on each region.
[0223] In some embodiments, the sampling points include first - type sampling points, where the first - type sampling points are the intersection points of the set X - axis and the boundaries of the corresponding regions on each region. The coefficient adjustment determination unit includes:
[0224] A first judgment sub - unit, configured to judge whether the first - type sampling points of each region are on the same horizontal line;
[0225] A first coefficient determination sub - unit, configured to determine that the horizontal distortion coefficient needs to be adjusted when the first - type sampling points are not on the same horizontal line.
[0226] In some embodiments, the sampling points include second - type sampling points, where the second - type sampling points are the intersection points of the set Y - axis and the boundaries of the corresponding regions on each region; the distortion coefficient includes a vertical distortion coefficient; the coefficient adjustment determination unit further includes:
[0227] A second judgment sub - unit, configured to judge whether the second - type sampling points of each region are on the same vertical line;
[0228] A second coefficient determination sub - unit, configured to determine that the vertical distortion coefficient needs to be adjusted when the second - type sampling points are not on the same vertical line.
[0229] In some embodiments, the coefficient adjustment determination unit further includes:
[0230] A third coefficient determination sub - unit, configured to determine that the distortion coefficient does not need to be adjusted when the first - type sampling points are on the same horizontal line and the second - type sampling points are on the same vertical line.
[0231] Each module in the above - mentioned image correction device can be implemented in whole or in part by software, hardware, and their combination. Each of the above - mentioned modules can be embedded in the processor in the head - mounted display device in hardware form or be independent of it, or be stored in the memory in the head - mounted display device in software form, so as to facilitate the processor to call and execute the operations corresponding to each of the above - mentioned modules.
[0232] In one embodiment, a head - mounted display device is provided. The head - mounted display device can be a terminal, and its internal structure diagram can be as Figure 16As shown. The head-mounted display device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the head-mounted display device is used to provide computing and control capabilities. The memory of the head-mounted display device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the head-mounted display device is used to exchange information between the processor and external devices. The communication interface of the head-mounted display device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an image correction method. The display screen of the head-mounted display device can be a liquid crystal display screen or an electronic ink display screen. The input device of the head-mounted display device can be a touch layer covering the display screen, or buttons, a trackball, or a touchpad provided on the housing of the head-mounted display device, or an external keyboard, touchpad, or mouse, etc.
[0233] Those skilled in the art can understand that Figure 16 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the head-mounted display device to which the solution of this application is applied. The specific head-mounted display device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0234] In one embodiment, a head-mounted display device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0235] When the display device is starting up, obtain the currently displayed test picture;
[0236] Calculate the center point coordinates of the test picture;
[0237] According to the center point coordinates, determine a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount;
[0238] Select a target sampling point and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture;
[0239] According to a plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates, calculate the distorted pixel point coordinates of the target sampling point;
[0240] Calculate the actual deformation amount of the test picture according to the coordinates of the distorted pixel points;
[0241] Correct the test picture according to the actual deformation amount.
[0242] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0243] When the display device is starting up, obtain the currently displayed test picture;
[0244] Calculate the center point coordinates of the test picture;
[0245] Determine multiple distortion amounts and the distortion coefficients corresponding to each of the distortion amounts according to the center point coordinates;
[0246] Select a target sampling point and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture;
[0247] Calculate the coordinates of the distorted pixel points of the target sampling point according to multiple distortion amounts, the distortion coefficients corresponding to each of the distortion amounts, and the original pixel point coordinates;
[0248] Calculate the actual deformation amount of the test picture according to the coordinates of the distorted pixel points;
[0249] Correct the test picture according to the actual deformation amount.
[0250] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0251] When the display device is starting up, obtain the currently displayed test picture;
[0252] Calculate the center point coordinates of the test picture;
[0253] Determine multiple distortion amounts and the distortion coefficients corresponding to each of the distortion amounts according to the center point coordinates;
[0254] Select a target sampling point and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture;
[0255] Calculate the coordinates of the distorted pixel points of the target sampling point according to multiple distortion amounts, the distortion coefficients corresponding to each of the distortion amounts, and the original pixel point coordinates;
[0256] Calculate the actual deformation amount of the test picture according to the coordinates of the distorted pixel points;
[0257] Correct the test picture according to the actual deformation amount.
[0258] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0259] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., and are not limited thereto.
[0260] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0261] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. An image correction method, characterized in that, Applied to a display device, the method includes: When the display device is starting up, obtain the currently displayed test picture; Calculate the center point coordinates of the test picture; According to the center point coordinates, determine a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount; Select a target sampling point and obtain the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test picture; According to a plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates, calculate the distorted pixel point coordinates of the target sampling point; According to the distorted pixel point coordinates, calculate the actual deformation amount of the test picture; According to the actual deformation amount, correct the test picture; Wherein, the test picture includes a preset undistorted rectangular area, and calculating the current center point coordinates of the test picture includes: calculating the current center point coordinates of the test picture according to the midpoints of the four sides of the preset undistorted rectangular area; Wherein, according to the center point coordinates, determining a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount includes: dividing the test picture into a plurality of concentric regions according to the horizontal axis, the vertical axis, and the center point coordinates, wherein the center point coordinates of each region are the same as the center point coordinates of the test picture, and the plurality of concentric regions include a preset undistorted rectangular area, and the horizontal axis and the vertical axis are set based on the center point coordinates of the test picture; according to the center point coordinates, calculate a first distortion amount and the remaining distortion amounts except the first distortion amount, the distortion coefficient corresponding to the first distortion amount is a preset first distortion coefficient, and the first distortion amount is the vertical distance from the center point coordinates to the boundary of the preset undistorted rectangular area; according to the first distortion amount and the remaining distortion amounts except the first distortion amount, determine the distortion coefficients corresponding to the remaining distortion amounts.
2. The method according to claim 1, wherein After determining the distortion coefficients corresponding to the remaining distortion amounts according to the first distortion amount and the remaining distortion amounts except the first distortion amount, according to the center point coordinates, determining a plurality of distortion amounts and the distortion coefficient corresponding to each distortion amount further includes: According to preset requirements, determine whether it is necessary to adjust the distortion coefficient; When it is necessary to adjust the distortion coefficient, adjust the distortion coefficient to obtain an adjusted distortion coefficient.
3. The method according to claim 2, wherein The determining whether it is necessary to adjust the distortion coefficient according to preset requirements includes: According to the center point coordinates of the test picture, set an X-axis and a Y-axis for each region in the divided test picture, and set the sampling points of each region; According to the sampling points on each region, determine whether it is necessary to adjust the distortion coefficient.
4. The method according to claim 3, wherein The sampling points include first-class sampling points, and the first-class sampling points are the intersections of the X-axis set for each region and the boundary of the corresponding region; The distortion coefficients include horizontal distortion coefficients; the determining whether it is necessary to adjust the distortion coefficient according to the sampling points on each region includes: Judge whether the first-class sampling points of each region are on the same horizontal line; In the case where the first type of sampling points are not on the same horizontal line, it is determined that the horizontal distortion coefficient needs to be adjusted.
5. The method according to claim 4, characterized in that The sampling points include second type of sampling points, and the second type of sampling points are the intersection points of the set Y-axis and the boundaries of the corresponding regions on each region; The distortion coefficients include a vertical distortion coefficient; determining whether the distortion coefficient needs to be adjusted according to the sampling points on each region further includes: Judging whether the second type of sampling points in each region are on the same vertical line; In the case where the second type of sampling points are not on the same vertical line, it is determined that the vertical distortion coefficient needs to be adjusted.
6. The method according to claim 5, wherein Determining whether the distortion coefficient needs to be adjusted according to the sampling points on each region further includes: In the case where the first type of sampling points are on the same horizontal line and the second type of sampling points are on the same vertical line, it is determined that the distortion coefficient does not need to be adjusted.
7. An image correction device, characterized in that, Applied to a display device, the device includes: An image acquisition module, configured to acquire a currently displayed test image when the display device is starting up; A first coordinate calculation module, configured to calculate the center point coordinates of the test image; A coefficient determination module, configured to determine a plurality of distortion amounts and a distortion coefficient corresponding to each distortion amount according to the center point coordinates; A coordinate acquisition module, configured to select a target sampling point and acquire the original pixel point coordinates of the target sampling point; the target sampling point is the vertex of each boundary of the test image; A second coordinate calculation module, configured to calculate the distorted pixel point coordinates of the target sampling point according to a plurality of distortion amounts, the distortion coefficient corresponding to each distortion amount, and the original pixel point coordinates; A deformation amount calculation module, configured to calculate the actual deformation amount of the test image according to the distorted pixel point coordinates; A correction module, configured to correct the test image according to the actual deformation amount; Wherein, the test image includes a preset undistorted rectangular area, and calculating the current center point coordinates of the test image includes: calculating the current center point coordinates of the test image according to the midpoints of the four sides of the preset undistorted rectangular area; Wherein, determining a plurality of distortion amounts and a distortion coefficient corresponding to each distortion amount according to the center point coordinates includes: dividing the test image into a plurality of concentric regions according to the horizontal axis, the vertical axis, and the center point coordinates, wherein the center point coordinates of each region are the same as the center point coordinates of the test image, and the plurality of concentric regions include a preset undistorted rectangular area, and the horizontal axis and the vertical axis are set based on the center point coordinates of the test image; calculating a first distortion amount and the remaining distortion amounts except the first distortion amount according to the center point coordinates, the distortion coefficient corresponding to the first distortion amount is a preset first distortion coefficient, and the first distortion amount is the vertical distance from the center point coordinates to the boundary of the preset undistorted rectangular area; determining the distortion coefficients corresponding to the remaining distortion amounts according to the first distortion amount and the remaining distortion amounts except the first distortion amount.
8. A head-mounted display device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, the steps of the image correction method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the image correction method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the steps of the image correction method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Projection device, projection system, and image correction method
CN110784691A