Image correction method and device, equipment, storage medium and program product

By saving the source data to the storage space according to its local characteristics, and calculating the real position coordinate points of the source pixel point using the address conversion formula, the problem of low resolution and frame rate in camera image correction of isometric projection model is solved, and efficient image correction and better visual effects are achieved.

CN120088172APending Publication Date: 2025-06-03SHENZHEN COMEN MEDICAL INSTR
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411998827.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

Images captured by cameras using isometric projection models cannot be displayed at high resolution and high frame rates during the correction process, mainly due to computational complexity and random read delay problems in hardware implementations.

Method used

By saving the source data to the preset storage space according to its local characteristics, and using the preset address conversion formula to calculate the real position coordinate points of the source pixel point corresponding to the target pixel point, the pixel value of the source pixel point is efficiently read in the storage space and image correction is completed.

Benefits of technology

It improves the reading efficiency during the image correction process, solves the problem that images cannot be displayed at high resolution and high frame rate, and achieves image correction that is more in line with human visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088172A_ABST
    Figure CN120088172A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses an image correction method, device and equipment, a storage medium and a program product.The image correction method comprises the steps that a first position coordinate point of a target pixel point is obtained, and a second position coordinate point of a source pixel point corresponding to the target pixel point is calculated according to the first position coordinate point; and converting the second position coordinate point by using a preset address conversion formula to obtain a real position coordinate point of a source pixel point corresponding to the target pixel point, and extracting a pixel value of the source pixel point from the storage space according to the real position coordinate point to complete correction of the target pixel point. As the source data is stored in the preset storage space according to the locality characteristic of processing the source data, the pixels needing to be corrected can be arranged in the same row as much as possible; therefore, the problem that the image cannot be displayed at high resolution and high frame rate in the process of correcting the image shot by the camera adopting the isometric projection model is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image correction method, device, equipment, storage medium and program product. Background Art

[0002] With the development of technology, high-definition electronic medical endoscopes have become essential medical devices for diagnosing and treating human diseases. Since the moving space inside the human stomach and intestines is limited for image acquisition devices, in order to obtain more scene information, the endoscope lens uses a fisheye lens with a short focal length and a large viewing angle, enabling the image sensor to collect gastrointestinal image information in a large range at close range. However, the image is accompanied by large distortion. Distortion correction of the image can make the image more in line with the human visual effect and improve the recognition rate of the image. The conventional method is as follows: First, cache the image, and then use the correction algorithm to calculate the coordinate address to correct the image.

[0003] Cameras using the equidistant projection model are relatively common in practical applications because the projection position grows evenly and the imaging effect is good; the operation process of such 3D image geometric correction algorithms is complex, the amount of calculation is large, and there is a certain randomness in the calculated result coordinates. In hardware implementation, due to the storage characteristics of dynamic memory, there is a problem of large random read delay, resulting in the inability to display the image at high resolution and high frame rate. Summary of the Invention

[0004] In view of this, the present invention provides an image correction method, device, equipment, storage medium and program product to solve the problem that the image cannot be displayed at high resolution and high frame rate during the process of correcting the image captured by a camera using the equidistant projection model.

[0005] In a first aspect, an embodiment of the present invention provides an image correction method, which includes the following steps: saving the source data to a preset storage space according to the locality characteristics of processing the source data; obtaining the first position coordinate point of the destination pixel point; calculating the second position coordinate point of the source pixel point corresponding to the destination pixel point according to the first position coordinate point; converting the second position coordinate point using a preset address conversion formula to obtain the true position coordinate point of the source pixel point corresponding to the destination pixel point; and taking out the pixel value of the source pixel point from the storage space according to the true position coordinate point to complete the correction of the destination pixel point.

[0006] The data correction method provided in this embodiment includes: obtaining the first position coordinate point of the target pixel point; calculating the second position coordinate point of the source pixel point corresponding to the target pixel point according to the first position coordinate point; converting the second position coordinate point by using a preset address conversion formula to obtain the true position coordinate point of the source pixel point corresponding to the target pixel point; and taking out the pixel value of the source pixel point from the storage space according to the true position coordinate point, so as to complete the correction of the target pixel point. Since the source data is stored in a preset storage space according to the locality characteristics of processing the source data, the pixels to be corrected can be arranged in the same row as much as possible, thereby improving the reading efficiency of taking out the pixel value of the source pixel point from the storage space according to the true position coordinate point, and solving the problem that the image cannot be displayed at a high resolution and high frame rate during the process of correcting the image captured by a camera using an equidistant projection model.

[0007] In an alternative embodiment, storing the source data in a preset storage space according to the locality characteristics of processing the source data includes: obtaining the source data; determining the locality characteristics of processing the source data; and adjusting the storage order of the source data so that the source data is stored in the preset storage space according to the locality characteristics.

[0008] That is to say, by obtaining the locality characteristics of processing the source data and adjusting the storage order of the source data, the source data can be stored in the preset storage space according to the locality characteristics, so that the data to be processed can be arranged in the same row as much as possible, improving the reading efficiency.

[0009] In an alternative embodiment, adjusting the storage order of the source data so that the source data is stored in the preset storage space according to the locality characteristics includes: obtaining the theoretical number of split rows; splitting each row of pixels of the source data according to the theoretical number of split rows to obtain a plurality of segmented data; storing the plurality of segmented data corresponding to each row of pixels in different storage queues according to a preset order; and writing the data order of the storage queues into the storage space.

[0010] This can conveniently and accurately store the source data in the preset storage space according to the locality characteristics.

[0011] In an alternative embodiment, storing the plurality of segmented data corresponding to each row of pixels in different storage queues according to a preset order includes: storing the plurality of segmented data corresponding to each row of pixels in a plurality of first-in-first-out queues; and writing the data order of the storage queues into the storage space includes: writing the plurality of first-in-first-out queues into the storage space in sequence.

[0012] This can conveniently and accurately store the source data in the preset storage space according to the locality characteristics.

[0013] In an alternative embodiment, calculating the second position coordinate point of the source pixel point corresponding to the target pixel point according to the first position coordinate point includes: obtaining a preset calibration parameter; obtaining a preset equidistant projection model formula; inputting the first position coordinate point and the calibration parameter into the equidistant projection model formula to calculate the second position coordinate point of the source pixel point corresponding to the target pixel point.

[0014] Thus, the second position coordinate point of the source pixel point corresponding to the target pixel point can be accurately obtained.

[0015] In an alternative embodiment, the calibration parameter is determined according to the lens and the image format.

[0016] Thus, the image correction method can be applied to different types of lenses.

[0017] In a second aspect, an embodiment of the present invention further provides an image correction device, which includes a storage module, an acquisition module, a source pixel point position determination module, a source pixel point position adjustment module, and a calibration module; the storage module is used to save the source data to a preset storage space according to the locality characteristics of processing the source data; the acquisition module is used to acquire the first position coordinate point of the target pixel point; the source pixel point position determination module is used to calculate the second position coordinate point of the source pixel point corresponding to the target pixel point according to the first position coordinate point; the source pixel point position adjustment module is used to convert the second position coordinate point by using a preset address conversion formula to obtain the true position coordinate point of the source pixel point corresponding to the target pixel point; the calibration module is used to retrieve the pixel value of the source pixel point from the storage space according to the true position coordinate point to complete the correction of the target pixel point.

[0018] In a third aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the image correction method according to the first aspect or any corresponding embodiment thereof.

[0019] In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the image correction method according to the first aspect or any corresponding embodiment thereof.

[0020] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the image correction method according to the first aspect or any corresponding embodiment thereof. Description of the Drawings

[0021] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0022] Figure 1 It is a schematic diagram of the front-end structure of the endoscope body;

[0023] Figure 2 It is a flowchart of the data correction method according to an embodiment of the present invention;

[0024] Figure 3 It is a flowchart of another image correction method according to an embodiment of the present invention;

[0025] Figure 4 It is a schematic diagram of an example of image segmentation and caching;

[0026] Figure 5 It is a flowchart of yet another data correction method according to an embodiment of the present invention;

[0027] Figure 6 It is a schematic diagram of an equidistant projection camera model;

[0028] Figure 7 It is a schematic diagram of a spherical equidistant projection model;

[0029] Figure 8 It is a flowchart of an example of the data correction method according to an embodiment of the present invention;

[0030] Figure 9 It is a structural block diagram of the data correction device according to an embodiment of the present invention;

[0031] Figure 10 It is a schematic diagram of the hardware structure of the computer device according to an embodiment of the present invention;

[0032] Among them, 1. Water vapor nozzle; 2. Light guide window; 3. Objective lens; 4. Instrument channel outlet; 5. Auxiliary water outlet. Specific Embodiments

[0033] Due to the internal mechanism problems of the double data rate synchronous dynamic random access memory (DDR) dynamic memory, there are differences in the data read / write return speeds between rows. Specifically, data in the same row can be directly operated on, while for data read / write in different rows, a new row needs to be activated before the operation. Therefore, the data return delay for cross-row read / write is large. That is to say, when sending a read address to the DDR to read data, if this address is in the same row as the address of the previous read operation, the data is directly returned; if it is in a different row from the address of the previous operation, the row address of the previous operation needs to be closed, and then the new current row address needs to be opened, resulting in a large data return delay for cross-row read / write.

[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0035] According to an embodiment of the present invention, an embodiment of a data saving method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0036] In this embodiment, a data correction method is provided, which can be used in a computer device. Taking the correction process of the fisheye source image collected by the endoscopic image system as an example, the data correction method is described in this embodiment. The endoscopic image system mainly consists of a mirror body, a light source, an image processing and display part, and a trolley. Figure 1 is a schematic diagram of the front-end structure of the endoscopic mirror body, which is located at the very front end of the endoscope and is responsible for collecting high-definition images. This part mainly consists of a water vapor nozzle, a light guide window, an objective lens, an instrument channel outlet, and an auxiliary water outlet; the mechanical structure of the objective lens will affect the process of collecting image data by the high-definition CMOS image sensor. The fisheye lens collects scene information in a larger range through a large viewing angle. At the same time, the image will be distorted to a certain extent and needs to be corrected before display.

[0037] Figure 2 is a flowchart of the data correction method according to an embodiment of the present invention. As Figure 2 shown, this process includes the following steps:

[0038] Step S201: Save the source data to a preset storage space according to the locality characteristics of processing the source data.

[0039] In this embodiment, the source data may be the fisheye source image collected by the endoscopic image system.

[0040] Specifically, the locality principle is mainly divided into two types: temporal locality and spatial locality. Temporal locality means that if an information item is being accessed, then it is very likely to be accessed again in the near future. Spatial locality means that if an information item is accessed, then the information items adjacent to it in the spatial address are very likely to be accessed in the near future. In the embodiment of the present invention, the locality characteristic refers to spatial locality.

[0041] Taking the correction of the fisheye source image as an example, the locality characteristic will be described below.

[0042] Table 1

[0043] Rectified image coordinates (x, y) Source image coordinates (u, v) (0,0) (129,230) (0,1) (128,231) (0,2) (127,232) (0,3) (127,233) (0,4) (126,233) (0,5) (126,234) (0,6) (125,230) (0,7) (125,231) (0,8) (125,232) (0,9) (124,233) (0,10) (124,234)

[0044] When correcting the image, not all pixels in the source image are taken out. Instead, according to the position of the corrected image, the pixel position of the source image is calculated in reverse using the correction algorithm, and then the pixel value at that position is output. As shown in Table 1, the coordinate (0, 0) in the corrected image represents the top-leftmost position of the corrected image, and this position needs to be filled with the pixel at the coordinate (129, 230) in the source image. According to the source image coordinates in Table 1, the abscissas of the pixels to be taken out in the source image are relatively close, and the ordinates are also relatively close, that is, the pixels to be taken out in the source image have locality characteristics.

[0045] After adjusting the storage order of the source data, the source data is stored in a preset storage space according to the locality characteristic. In Table 1, the corrected image coordinates (x, y) are the pixel coordinates to be corrected in the storage space. As can be seen from Table 1, after adjusting the storage order of the source data, the pixel coordinates to be corrected in the storage space belong to the same row, that is, the pixels to be corrected are arranged in the same row as much as possible, thereby improving the reading efficiency.

[0046] Step S202: Obtain the first position coordinate point of the target pixel point.

[0047] In this embodiment, the first position coordinate point of the target pixel point is the coordinate point of the pixel to be corrected.

[0048] Step S203: Calculate the second position coordinate point of the source pixel point corresponding to the target pixel point according to the first position coordinate point.

[0049] In this embodiment, the second position coordinate point of the source pixel point corresponding to the target pixel point can be calculated according to any scheme in the prior art based on the first position coordinate point.

[0050] Step S204: Convert the second position coordinate point by using a preset address conversion formula to obtain the true position coordinate point of the source pixel corresponding to the target pixel point.

[0051] This is because in Step S201, the coordinate positions of the pixels in the source image stored in the storage space are adjusted; while the second position coordinate point obtained through Steps S202 - S203 is before adjustment. Therefore, the second position coordinate point is converted by using a preset address conversion formula.

[0052] Table 2

[0053] Rectified image coordinates (x, y) Source image coordinates (u, v) Transformed address (row, col) (0,0) (129,230) (129,230) (0,1) (128,231) (129,111) (0,2) (127,232) (121,952) (0,3) (127,233) (121,953) (0,4) (126,233) (121,833) (0,5) (126,234) (121,834) (0,6) (125,230) (121,710) (0,7) (125,231) (121,711) (0,8) (125,232) (121,712) (0,9) (124,233) (121,593) (0,10) (124,234) (121,594)

[0054] In Table 2, the middle column (u, v) is the position of the source image pixel point obtained after being calculated by the correction algorithm, and the rightmost column (row, col) is the address value after (u, v) is reordered through the cache and stored in the dynamic memory. The two variables row and u correspond one by one. By observing the numerical changes in the two columns, the change times of row are less than those of u. It can be concluded that after the cache sequence rearrangement, the number of access rows is reduced.

[0055] Step S205: Fetch the pixel value of the source pixel from the storage space according to the true position coordinate point to complete the correction of the target pixel point.

[0056] The data correction method provided in this embodiment can complete the correction of the target pixel point by obtaining the first position coordinate point of the target pixel point; calculating the second position coordinate point of the source pixel corresponding to the target pixel point according to the first position coordinate point; converting the second position coordinate point by using a preset address conversion formula to obtain the true position coordinate point of the source pixel corresponding to the target pixel point; and fetching the pixel value of the source pixel from the storage space according to the true position coordinate point. Since the source data is saved in a preset storage space according to the locality characteristics of processing the source data, the pixels to be corrected can be arranged in the same row as much as possible, thereby improving the reading efficiency of fetching the pixel value of the source pixel from the storage space according to the true position coordinate point, and solving the problem that the image cannot be displayed at high resolution and high frame rate during the process of correcting the image captured by a camera using an equidistant projection model.

[0057] In this embodiment, an image correction method is provided, which can be used in a computer device. Figure 3 It is a flowchart of another image correction method according to an embodiment of the present invention. As Figure 3 shown, this process includes the following steps:

[0058] Step S301: Save the source data in a preset storage space according to the locality characteristics of processing the source data.

[0059] In an alternative embodiment, saving the source data to a preset storage space according to the locality characteristics of processing the source data includes the following steps S3011 to S3013.

[0060] Step S3011: Obtain the source data.

[0061] Step S3012: Determine the locality characteristics of processing the source data.

[0062] Step S3013: Adjust the storage order of the source data so that the source data is saved to the preset storage space according to the locality characteristics.

[0063] In an alternative embodiment, adjusting the storage order of the source data so that the source data is saved to the preset storage space according to the locality characteristics includes the following steps S1 to S4.

[0064] Step S1: Obtain the theoretical number of split rows.

[0065] Specifically, the theoretical number of split rows can be a power of 2. By way of example, as Figure 3 shown, the theoretical number of split rows is 8.

[0066] Step S2: Split each row of pixels of the source data according to the theoretical number of split rows to obtain a plurality of segmented data.

[0067] By way of example, as Figure 4 shown, split the first row of pixels of the source image according to the theoretical number of split rows 8 to obtain 8 segmented data, namely segmented data 1, segmented data 2, segmented data 3, segmented data 4, segmented data 5, segmented data 6, segmented data 7 and segmented data 8; split the second row of pixels of the source image according to the theoretical number of split rows 8 to obtain 8 segmented data, namely segmented data 9, segmented data 10... segmented data 16; split the third row of pixels of the source image according to the theoretical number of split rows 8 to obtain 8 segmented data, namely segmented data 17, segmented data 18... segmented data 24.

[0068] Step S3: Save the multiple segmented data corresponding to each row of pixels to different storage queues respectively according to a preset order.

[0069] Specifically, saving the multiple segmented data corresponding to each row of pixels to different storage queues respectively according to a preset order includes: saving the multiple segmented data corresponding to each row of pixels to multiple first-in-first-out queues respectively.

[0070] By way of example, as Figure 4As shown, the segmented data 1 to segmented data 8 obtained by segmenting the first row of pixels are respectively saved into 8 first-in, first-out queues. Specifically, the segmented data 1 is written into the first-in, first-out queue 1, the segmented data 2 is written into the first-in, first-out queue 2, the segmented data 3 is written into the first-in, first-out queue 3, the segmented data 4 is written into the first-in, first-out queue 4, the segmented data 5 is written into the first-in, first-out queue 5, the segmented data 6 is written into the first-in, first-out queue 6, the segmented data 7 is written into the first-in, first-out queue 7, and the segmented data 8 is written into the first-in, first-out queue 8.

[0071] The segmented data 9 to segmented data 16 obtained by segmenting the first row of pixels are respectively saved into 8 first-in, first-out queues. Specifically, the segmented data 9 is written into the first-in, first-out queue 1, the segmented data 10 is written into the first-in, first-out queue 2, the segmented data 11 is written into the first-in, first-out queue 3, the segmented data 12 is written into the first-in, first-out queue 4, the segmented data 13 is written into the first-in, first-out queue 5, the segmented data 14 is written into the first-in, first-out queue 6, the segmented data 16 is written into the first-in, first-out queue 7, and the segmented data 16 is written into the first-in, first-out queue 8.

[0072] The segmented data 17 to segmented data 24 obtained by segmenting the first row of pixels are respectively saved into 8 first-in, first-out queues. Specifically, the segmented data 17 is written into the first-in, first-out queue 1, the segmented data 18 is written into the first-in, first-out queue 2, the segmented data 19 is written into the first-in, first-out queue 3, the segmented data 20 is written into the first-in, first-out queue 4, the segmented data 21 is written into the first-in, first-out queue 5, the segmented data 22 is written into the first-in, first-out queue 6, the segmented data 23 is written into the first-in, first-out queue 7, and the segmented data 24 is written into the first-in, first-out queue 8.

[0073] Step S4: Write the data in the storage queue into the storage space in order.

[0074] Specifically, writing the data in the storage queue into the storage space in order includes: writing multiple first-in, first-out queues into the storage space in turn.

[0075] Exemplarily, as Figure 4 shown, first write the data in the first-in, first-out queue 1 into the storage space, then write the data in the first-in, first-out queue 2 into the storage space... Finally, write the data in the first-in, first-out queue 8 into the storage space.

[0076] As Figure 4As shown, when correcting an image, if not all pixels in the source image are corrected, but the first segmented data of each row of pixels in the source image is selected for correction, that is, the segmented data 1 of the first row of pixels, the segmented data 9 of the second row of pixels, and the segmented data 17 of the third row of pixels are corrected. If the storage order of the source data is not adjusted, during the process of reading and writing data during correction, since the segmented data 1, the segmented data 9, and the segmented data 17 are in different rows, a new row needs to be activated before the operation can be performed, resulting in a large delay. After the storage order of the source data is adjusted by the method of the embodiment of the present invention, the segmented data 1, the segmented data 9, and the segmented data 17 are in the same row, so during the process of reading and writing data during correction, the delay is small.

[0077] Step S302: Obtain the first position coordinate point of the target pixel point.

[0078] Step S303: Calculate the second position coordinate point of the source pixel point corresponding to the target pixel point according to the first position coordinate point.

[0079] Step S304: Convert the second position coordinate point using a preset address conversion formula to obtain the true position coordinate point of the source pixel point corresponding to the target pixel point.

[0080] Step S305: Retrieve the pixel value of the source pixel point from the storage space according to the true position coordinate point to complete the correction of the target pixel point.

[0081] In the data correction method provided in this embodiment, since the source data is saved to a preset storage space according to the locality characteristics of processing the source data, it is possible to arrange the pixels to be corrected in the same row as much as possible, thereby improving the reading efficiency of retrieving the pixel value of the source pixel point from the storage space according to the true position coordinate point, and solving the problem that the image cannot be displayed at a high resolution and high frame rate during the process of correcting an image captured by a camera using an equidistant projection model.

[0082] In this embodiment, a data correction method is provided, which can be used in a computer device. Figure 5 It is a flowchart of another data correction method according to an embodiment of the present invention. As Figure 5 shown, this process includes the following steps:

[0083] Step S501: Save the source data to a preset storage space according to the locality characteristics of processing the source data.

[0084] Step S502: Obtain the first position coordinate point of the target pixel point.

[0085] Step S503: Calculate the second position coordinate point of the source pixel point corresponding to the target pixel point according to the first position coordinate point.

[0086] In an alternative embodiment, calculating the second position coordinate point of the source pixel point corresponding to the target pixel point according to the first position coordinate point includes the following steps:

[0087] Step S5031: Obtain a preset calibration parameter.

[0088] Step S5032: Obtain a preset equidistant projection model formula.

[0089] Step S5033: Input the first position coordinate point and the calibration parameter into the equidistant projection model formula, and calculate the second position coordinate point of the source pixel point corresponding to the target pixel point.

[0090] Exemplarily, Figure 6 is a schematic diagram of an equidistant projection camera model. As Figure 6 shown, different external light rays enter the hemispherical surface at the same incremental incident angle θ, and the pixel points formed by projecting onto the fisheye image plane are also equal in the image height increment r. The mapping relationship between the incident angle θ and the image height r is: r = f·θ. The spherical equidistant projection model approximately equates the fisheye lens to a hemispherical surface. As Figure 7 shown, for any point P(x, y, z) in space, the ray connecting the center O of the hemispherical surface intersects the hemispherical surface at point p`(X, Y, Z). The p` point is finally projected onto the xoy fisheye image plane as point m(u, v). The image height of point m is r, which is determined by the incident angle θ and the focal length f. The radius of the hemispherical surface is R. From the geometric relationship of the projection model, the following relationship can be obtained:

[0091]

[0092] Among them, the R parameter is related to the lens and can be adjusted according to different lenses. The distortion correction process uses inverse mapping. The source image coordinate point (u, v) is calculated through the position coordinate point (x, y) of the target image, and this pixel is used for filling. For decimal coordinate points, nearest neighbor interpolation is used for rounding.

[0093] Step S504: Convert the second position coordinate point using a preset address conversion formula to obtain the true position coordinate point of the source pixel point corresponding to the target pixel point.

[0094] Exemplarily, the address conversion formula is: where N is the number of data rows to be segmented, which can be a power of 2. The integer division, remainder operation, and multiplication operation in the formula are converted into binary truncation and shift operations.

[0095] Step S505: Retrieve the pixel value of the source pixel point from the storage space according to the true position coordinate point to complete the correction of the target pixel point.

[0096] To illustrate the data correction method of the embodiments of the present invention more clearly, a specific example is given. Figure 8 It is a flowchart of an example of the data correction method according to the embodiments of the present invention. As Figure 8 shown, the data correction method includes the following steps:

[0097] 1. Determine appropriate correction parameters R and the optimal number of split rows N through host computer software simulation. The image acquisition system obtains the fisheye source image as the input source of the image correction system. The pixels of the fisheye source image pass through multiple FIFOs as a first-level cache, and the pixel sorting is readjusted. Then, the pixels are written into the DDR in a new order for image frame caching;

[0098] 2. Build an image distortion correction algorithm module. First, use the cumulative counting method to generate the row and column coordinates (x, y) of the corrected result image, and perform operations on the coordinate spherical equidistant projection algorithm to calculate the pixel coordinate values (u, v) of the source image;

[0099] 3. Build an address conversion module according to the number of split rows N. The address conversion mapping relationship is: (N is the number of data rows to be split, which can be a power of 2. Convert the integer division, remainder, and multiplication operations in the formula into binary truncation and shift operations). The pixel coordinate values (u, v) of the source image are finally converted into the address (row, col) after passing through the address conversion module;

[0100] 4. Take out the source image pixels from the final generated DDR coordinate address (row, col) via the DDR controller, output the corrected image, and complete the image correction processing process.

[0101] As Figure 8 shown, the image processing process proposed in this embodiment is a streaming process. Complex trigonometric function operations and square root operations can be performed using a Cordic module, which is suitable for deployment in an FPGA to implement pipeline operations, with low latency and a small energy consumption ratio.

[0102] The data correction method provided in this embodiment adjusts the storage order of the source data by obtaining the locality characteristics of processing the source data, so that the source data is stored in a preset storage space according to the locality characteristics, thereby enabling the pixels to be corrected to be arranged in the same row as much as possible and improving the reading efficiency.

[0103] In this embodiment, a data protection device is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0104] This embodiment provides a data correction device, as Figure 9 shown, including:

[0105] A storage module 901, configured to save source data to a preset storage space according to the locality characteristics of processing the source data;

[0106] An acquisition module 902, configured to acquire the first position coordinate point of the target pixel point;

[0107] A source pixel point position determination module 903, configured to calculate the second position coordinate point of the source pixel point corresponding to the target pixel point according to the first position coordinate point;

[0108] A source pixel point position adjustment module 904, configured to convert the second position coordinate point by using a preset address conversion formula to obtain the true position coordinate point of the source pixel point corresponding to the target pixel point;

[0109] A correction module 905, configured to take out the pixel value of the source pixel point from the storage space according to the true position coordinate point to complete the correction of the target pixel point.

[0110] In some alternative embodiments, the storage module 901 includes a source data acquisition unit, a locality characteristic determination unit, and a storage order adjustment unit; the source data acquisition unit is configured to acquire source data; the locality characteristic determination unit is configured to determine the locality characteristics of processing the source data; the storage order adjustment unit is configured to adjust the storage order of the source data so that the source data is saved to a preset storage space according to the locality characteristics.

[0111] In some alternative embodiments, the storage order adjustment unit includes a row splitting number acquisition subunit, a splitting subunit, a segmented data saving subunit, and a storage queue saving subunit. The row splitting number acquisition subunit is configured to acquire the theoretical number of split rows; the splitting subunit is configured to split each row of pixels of the source data according to the theoretical number of split rows to obtain a plurality of segmented data; the segmented data saving subunit is configured to save the plurality of segmented data corresponding to each row of pixels to different storage queues in a preset order; the storage queue saving subunit is configured to write the data order of the storage queues into the storage space.

[0112] In some alternative embodiments, the segmented data saving subunit is specifically configured to: save the plurality of segmented data corresponding to each row of pixels to a plurality of first-in-first-out queues respectively.

[0113] In some alternative embodiments, the storage queue saving subunit is specifically configured to: write the plurality of first-in-first-out queues into the storage space in sequence.

[0114] In some alternative embodiments, the source pixel position determination module 903 is specifically configured to: obtain a preset calibration parameter; obtain a preset equidistant projection model formula; input the first position coordinate point and the calibration parameter into the equidistant projection model formula, and calculate a second position coordinate point of the source pixel corresponding to the target pixel.

[0115] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding embodiments above, and will not be elaborated here.

[0116] The data protection device and the data calibration device in this embodiment are presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0117] An embodiment of the present invention further provides a computer device having the above-mentioned Figure 9 shown data calibration device.

[0118] Please refer to Figure 10 , Figure 10 is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention. As Figure 10 shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 10 In

[0119] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Among them, processor 10 may further include a hardware chip. The above-mentioned hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The above-mentioned programmable logic device may be a complex programmable logic device, a field programmable gate array, a general array logic, or any combination thereof.

[0120] Among them, the memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiments.

[0121] The memory 20 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely provided with respect to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0122] The memory 20 may include volatile memory, for example, random access memory; the memory may also include non-volatile memory, for example, flash memory, a hard disk, or a solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0123] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 may be connected through a bus or other means. Figure 10 Taking the connection through the bus as an example.

[0124] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function control of the computer device, such as an image sensor. The output device 40 is a display device. The above display devices include but are not limited to liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touch screen.

[0125] Embodiments of the present invention also provide a computer-readable storage medium. The method according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored as such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0126] A part of the present invention can be applied as a computer program product, for example, computer program instructions, which when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should be able to understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0127] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. An image correction method, characterized in that: The method comprises: Saving the source data to a preset storage space according to the local characteristics of processing the source data; Obtain the first position coordinate point of the target pixel; Calculate a second position coordinate point of a source pixel point corresponding to the destination pixel point according to the first position coordinate point; The second position coordinate point is converted using a preset address conversion formula to obtain a real position coordinate point of a source pixel point corresponding to the destination pixel point; The pixel value of the source pixel point is taken out from the storage space according to the real position coordinate point to complete the correction of the destination pixel point.

2. The image correction method according to claim 1, characterized in that: The step of saving the source data to a preset storage space according to the local characteristics of processing the source data includes: Get source data; determining local characteristics of processing the source data; The storage order of the source data is adjusted so that the source data is saved in a preset storage space according to the locality characteristics.

3. The method according to claim 2, characterized in that The step of adjusting the storage order of the source data so that the source data is stored in a preset storage space according to the locality characteristics includes: Get the theoretical number of split rows; Divide each row of pixels of the source data according to the theoretical number of divided rows to obtain a plurality of segmented data; The plurality of segmented data corresponding to each row of pixels are stored in different storage queues according to a preset order; The data of the storage queue is sequentially written into the storage space.

4. The image correction method according to claim 3, characterized in that: The step of storing the plurality of segmented data corresponding to each row of pixels in different storage queues in a preset order comprises: The plurality of segmented data corresponding to each row of pixels are respectively stored in a plurality of first-in-first-out queues; The sequentially writing the data of the storage queue into the storage space comprises: The plurality of first-in-first-out queues are written into the storage space in sequence.

5. The image correction method according to claim 1, characterized in that: The step of calculating a second position coordinate point of a source pixel point corresponding to the destination pixel point according to the first position coordinate point comprises: Obtaining preset calibration parameters; Get the preset isometric projection model formula; The first position coordinate point and the correction parameter are input into the equidistant projection model formula to calculate and obtain the second position coordinate point of the source pixel point corresponding to the destination pixel point.

6. The image correction method according to claim 5, characterized in that: The correction parameters are determined according to the lens and the image format.

7. An image correction device, characterized in that: The device comprises: A storage module, used for saving the source data to a preset storage space according to the local characteristics of processing the source data; An acquisition module, used to acquire a first position coordinate point of a target pixel; A source pixel point position determination module, used for calculating a second position coordinate point of a source pixel point corresponding to the destination pixel point according to the first position coordinate point; A source pixel point position adjustment module, used to transform the second position coordinate point using a preset address transformation formula to obtain a real position coordinate point of the source pixel point corresponding to the destination pixel point; The correction module is used to retrieve the pixel value of the source pixel point in the storage space according to the real position coordinate point to complete the correction of the destination pixel point.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the image correction method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the image correction method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the image correction method according to any one of claims 1 to 6.