Image distortion correction method, chip and device
By combining the image processing module and the distortion correction module inside the SOC, the image rotation correction is performed using the cache space and lookup table, and the problems of limited image rotation angle and large resource usage in the prior art are solved, and complete and lossless image rotation is achieved Effect.
Patent Information
- Application Number
- CN202411232621.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-11-08
AI Technical Summary
The prior art can only support rotation of plus or minus 45 degrees when image rotation is rotated. Rotation at a large angle will cause image damage and occupy a large amount of CPU or GPU resources, and a complete corrected rotation image cannot be obtained.
The target image and rotation information are obtained through the image processing module inside the SOC, and the image is copied into the cache space using the hardware copy interface. The pixel position is pre-calculated and stored in the lookup table. The image is rotated and corrected based on the lookup table to avoid image damage and Reduce the overhead of CPU or GPU.
It is realized that the complete corrected rotation image is obtained while reducing the working overhead of the CPU or GPU, avoiding the problem of image loss and improving the efficiency and display quality of image rotation processing.
Smart Images

Figure CN118918049A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, chip and device for image distortion correction. Background Art
[0002] Image distortion correction is a method of removing distortion caused by the camera or lens system by transforming the image so that the straight lines in the image remain straight after correction. When it comes to four-point to four-point mapping, it usually refers to mapping the four corner points in the original image to the four corner points in the target image to achieve perspective correction. The image distortion correction module is a four-point to four-point mapping. The image distortion correction module is a hardware unit set inside the SOC. Its function is to generate a corrected image based on the received color blocks and conversion table.
[0003] However, the current image distortion correction module can only support rotation of plus or minus 45 degrees, and a larger angle of rotation will damage the image, resulting in missing images after rotation, etc. Moreover, image rotation currently requires a lot of CPU or GPU resources. Summary of the invention
[0004] In view of the above technical problems existing in the prior art, this application is proposed. This application aims to provide a method, chip and device for image distortion correction, which can avoid damage to the rotated image while reducing the work overhead of the CPU or GPU, so as to obtain a complete corrected rotated image.
[0005] According to the first scheme of the present application, a method for image distortion correction is provided, the method comprising obtaining a target image and rotation information of the target image by using an image processing module inside a SOC; copying the target image to a cache space through a hardware copy interface of the image processing module to perform a copy operation, wherein the cache space allows the target image to be freely rotated within the cache space; utilizing the image distortion correction module inside the SOC to pre-calculate the position of each pixel of the target image after rotation based on the rotation information, and storing the position information in a lookup table; rotating the target image in the cache space based on the lookup table to perform an image distortion correction operation, and outputting the obtained updated image.
[0006] According to a second scheme of the present application, a chip for performing image distortion correction is provided, the chip comprising an image processing module and an image distortion correction module, the image processing module having a hardware copy interface, and configured to: obtain a target image and rotation information of the target image; copy the target image to a cache space through the hardware copy interface to perform a copy operation, the cache space being capable of allowing the target image to rotate freely within the cache space; the image distortion correction module being further configured to: pre-calculate the position of each pixel of the target image after rotation based on the rotation information, and store the position information in a lookup table; rotate the target image in the cache space based on the lookup table to perform an image distortion correction operation, and output the obtained updated image.
[0007] According to a third solution of the present application, a device for image distortion correction is provided, wherein the device comprises a chip for image distortion correction as described in each embodiment of the present application.
[0008] Compared with the prior art, the beneficial effects of the embodiments of the present application are:
[0009] The method for image distortion correction provided in the embodiment of the present application copies the acquired target image to the cache space through the hardware copy interface of the image processing module. The cache space is pre-configured by the processor based on the size information of the target image. The target image can be rotated freely in the cache space without image loss. The image distortion correction module is then used to rotate the target image in the cache space based on the lookup table to obtain a corrected, complete and lossless rotated image. In this way, the work overhead of the CPU or GPU can be reduced, and the problem of incomplete image after rotation can be avoided.
[0010] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above description and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In the drawings, which are not necessarily drawn to scale, the same reference numerals may describe similar parts in different views. Similar reference numerals with letter suffixes or different letter suffixes may represent different examples of similar components. The accompanying drawings generally illustrate various embodiments by way of example and not by way of limitation, and together with the description and claims, are used to illustrate the disclosed embodiments. Such embodiments are illustrative and exemplary and are not intended to be exhaustive or exclusive embodiments of the present method, apparatus, system, or non-transitory computer-readable medium having instructions for implementing the method.
[0012] Figure 1 A flow chart of a method for image distortion correction according to an embodiment of the present application is shown.
[0013] Figure 2 A schematic diagram of image distortion correction according to an embodiment of the present application is shown.
[0014] Figure 3 Another schematic diagram of image distortion correction according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0015] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific implementation examples. The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation examples, but are not intended to limit the present application.
[0016] The words "first", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish. The words "include" or "comprises" and similar words used in this application mean that the elements before the word include the elements listed after the word, and do not exclude the possibility of covering other elements. In this application, the arrows shown in the figures of each step are only examples of the execution order, not limitations. The technical solution of this application is not limited to the execution order described in the embodiments. The various steps in the execution order can be combined, decomposed, or the order can be changed, as long as the logical relationship of the execution content is not affected.
[0017] All terms (including technical terms or scientific terms) used in this application have the same meaning as those understood by ordinary technicians in the field to which this application belongs, unless otherwise specifically defined. It should also be understood that terms defined in general dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or extremely formal sense, unless explicitly defined here. Techniques and equipment known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, the techniques and equipment should be considered as part of the specification.
[0018] Figure 1 A flow chart of a method for image distortion correction according to an embodiment of the present application is shown. The method is shown in steps S101 to S104. In the present application, the arrows shown in the figures of the various steps are merely examples of the execution order, not limitations. The technical solution of the present application is not limited to the execution order described in the embodiments. The various steps in the execution order can be combined, decomposed, or changed in order, as long as the logical relationship of the execution content is not affected.
[0019] In step S101, the target image and the rotation information of the target image are obtained by using the image processing module inside the SOC. Among them, the system on chip (SoC) refers to the integration of multiple hardware components on a single chip, such as a central processing unit (CPU), a memory controller, a graphics processing unit (GPU), etc., to realize a complete computing system. The SOC may contain a die, or may contain multiple identical or different wafers. In this embodiment, the image processing module may be configured with a hardware copy interface, and the function of quickly transmitting image data can be realized through the hardware copy interface.
[0020] Specifically, in the vehicle-mounted SOC system, the processor can obtain image information in real time or at a certain time interval, and the image information includes a target image that needs to be rotated. The target image can be, for example, an image on a dashboard or a central control screen. For example, the image can be adjusted by rotating along with changes in relevant vehicle driving information such as vehicle speed and fuel level. This is only used as an example and does not constitute a specific limitation on the target image.
[0021] The processor may obtain the rotation information of the target image based on the analysis of the target image. In some other embodiments, the rotation information includes the rotation angle, the size of the target image, the format of the target image, and the location of the cache space, and may also include the address information for storing the rotated target image, etc. This is only used as an example and does not constitute a limitation on the specific solution.
[0022] The processor may send the acquired target image and the rotation information of the target image and other related data to the image processing module, so that the image processing module can acquire the target image and the rotation information thereof.
[0023] Specifically, the rotation angle may be, for example, 20 degrees, 30 degrees, 45 degrees, 90 degrees, 135 degrees, 180 degrees, etc., without limitation.
[0024] In step S102, the target image is copied to the cache space through the hardware copy interface of the image processing module to perform a copy operation, wherein the cache space can allow the target image to be freely rotated in the cache space. Specifically, after acquiring the target image, the processor can pre-configure the cache space based on image information such as the size of the target image, and then copy the target image to the cache space through the hardware copy interface of the image processing module.
[0025] Exemplarily, the cache space may be a square area. In other embodiments, the cache space is a square cache center with a side length greater than or equal to the length of the longest diagonal of the target image. In this way, the target image can be freely rotated in the cache space, and the image loss problem will not occur during the rotation process.
[0026] Exemplarily, the buffer space may also be a circular area, wherein the diameter of the buffer space is greater than or equal to the length of the longest diagonal line of the target image. In this case, the target image can be rotated without image loss.
[0027] This is only an example and does not constitute a limitation on the specific solution.
[0028] The target image is copied to the cache space based on the hardware copy interface of the image processing module, which can realize the fast copy of the target image, thereby improving the efficiency of image rotation processing and reducing the occupation of resources such as CPU or GPU.
[0029] In step S103, the image distortion correction module inside the SOC is used to pre-calculate the position of each pixel of the target image after rotation based on the rotation information, and store the position information in the lookup table. That is, the image distortion correction module obtains the rotation information, calculates the rotation matrix according to the rotation angle and the size of the target image, and pre-calculates the position of each pixel in the rotated image, and stores the position information in the lookup table.
[0030] For example, first, the rotation information of the target image needs to be obtained, such as the rotation angle (e.g., θ) and the center point of rotation. For each pixel of the target image, its new position after rotation is calculated by the rotation matrix. The rotation matrix is used to convert the pixel position from the original target image coordinate system to the updated image coordinate system.
[0031] Assuming the rotation angle is θ and the rotation center is (x0, y0), the rotation matrix is:
[0032]
[0033] For the coordinates (x, y) of a pixel in the target image, its new coordinates (x′, y′) after rotation can be calculated by the following formula:
[0034]
[0035] Based on the above calculations, a lookup table is generated. Each entry in the lookup table stores the pixel position after rotation. Specifically, for each pixel (i, j) in the updated image, the lookup table stores its corresponding pixel position (x, y) in the rotated target image.
[0036] During the image distortion correction process, each target image pixel is mapped through a lookup table. For example, for each pixel (i, j) in the update image, the lookup table is used to find its corresponding position (x, y) in the target image; the pixel value is extracted from the target image and assigned to the pixel (i, j) in the update image.
[0037] This is only an exemplary description and does not constitute a limitation on the specific scheme.
[0038] In step S104, the target image in the cache space is rotated based on the lookup table to perform an image distortion correction operation, and the obtained updated image is output. Specifically, the image distortion correction module applies the lookup table to obtain the new position of each pixel after rotation, and maps the pixel value in the target image to the corresponding position in the new image to generate a rotated updated image. The cache space allows the target image to be rotated freely, so the updated image after rotation in the cache space is intact.
[0039] For example, Figure 2 As shown, the target image 200 needs to be rotated 45 degrees, and the target image 200 is quickly copied to the cache space 201 through the hardware copy interface of the image processing module. The cache space 201 is a square area, and the side length of the cache space 201 is equal to the length of the longest diagonal of the target image 200. The image distortion correction module generates a lookup table based on the relevant rotation information such as the size and rotation angle of the target image 200, and performs an image distortion correction operation on the target image 200 based on the lookup table, and rotates it 45 degrees to obtain the updated image shown in the target area 202. It can be seen that the four corners Aˊ, Bˊ, Cˊ and Dˊ of the updated image are all within the target area 202. The target area 202 has the same size as the cache space 201, and the area indicated by the arrow in the target area 202 is the background, which can be set to be colorless.
[0040] In some other embodiments, when the target image is rotated once using the image distortion correction module, the maximum rotation angle of the single rotation is 45 degrees. For example, if the target image needs to be rotated 55 degrees, the target image can be rotated 45 degrees and then 10 degrees according to the method provided in the embodiment of the present application to obtain an updated image. In this way, the target image can be rotated at any angle.
[0041] Then, the updated image is outputted to obtain a complete and lossless updated image after rotation. Based on the method provided in the embodiment of the present application, it is possible to realize the rotation of the target image at any angle, and to realize the rapid copying of the target image based on the image processing module, thereby improving the efficiency of the image rotation processing and reducing the work overhead of the CPU or GPU. Moreover, by realizing the rotation of the target image based on the cache space, a complete and lossless updated image can be obtained, thereby improving the display quality of the image displayed on the vehicle and enhancing the user experience.
[0042] In some other embodiments, when it is determined based on the rotation information that the rotation angle is greater than or equal to the preset angle, and the image processing module is capable of performing a first rotation operation, the image processing module is used to perform a first rotation operation on the target image to obtain a first image, and then the first image is copied to the cache space through the hardware copy interface. The preset angle may be 90 degrees, and the rotation angle may be 90 degrees, 93 degrees, 135 degrees, etc. Specifically, the first rotation operation may be an operation of rotating the target image by 90 degrees, and the image processing module capable of performing the first rotation operation may also be a 2D graphics rendering engine. The 2D graphics rendering engine has both a hardware copy interface and the ability to rotate the image by 90 degrees, which can improve the processing efficiency of rotating the image.
[0043] For example, the image processing module is a 2D graphics rendering engine, and the rotation angle is 135 degrees. Figure 2 As shown, the processor or other software can identify whether the rotation angle is greater than or equal to the preset angle based on the rotation information of the target image 300. When the rotation angle of the target image 300 is 135 degrees, it can be determined that the rotation angle 135 is equal to the preset angle 135 degrees. At this time, the target image 300 can be first rotated 90 degrees using a 2D graphics rendering engine to obtain a first image 301.
[0044] Then, the hardware copy interface of the 2D graphics rendering engine is used to quickly copy the first image 301 to the cache space 302. Finally, the image distortion correction module calculates the rotation matrix based on the rotation angle and size of the target image 300 or the first image 301, and pre-calculates the position of each pixel of the target image 300 or the first image 301 in the rotated image, and stores the position information in the lookup table. The image distortion correction module further rotates the first image 301 stored in the cache space 302 by 45 degrees using the lookup table, that is, performs a second rotation operation on the first image 301 in the cache space 302 to obtain an updated image 303 and output it. That is, in some other embodiments, the image distortion correction module performs a second rotation operation on the first image in the cache space based on the lookup table to obtain an updated image and output it.
[0045] For example, assuming that the rotation angle is 180 degrees and the preset angle is 135 degrees, at this time, the image processing module can be used to rotate the target image by 90 degrees to obtain the first image, and then the hardware copy interface of the image processing module can be used to quickly copy the first image to the cache space, and then the image distortion correction module can be used to generate a lookup table, and the lookup table can be used to rotate the first image by 45 degrees to obtain the third image, and then, the third image can be used as the target image, and the hardware copy interface in the image processing module can be used to quickly copy the third image to the cache space, and the image distortion correction module can be used to generate a lookup table based on the third image or the target image, and the third image can be rotated by 45 degrees based on the lookup table to obtain an updated image. That is, in some other embodiments, during the execution of the first rotation operation, the rotation angle is 90 degrees; during the execution of the second rotation operation, the rotation angle is 45 degrees.
[0046] This is only an exemplary description and does not constitute a limitation on the specific scheme.
[0047] In some other embodiments of the present application, when it is determined based on the rotation information that the rotation angle is greater than or equal to the preset angle, and the image processing module cannot perform the first rotation operation, the image distortion correction module is used to perform a second rotation operation on the target image in the cache space based on the lookup table to obtain a second image and output it; the image processing module obtains the second image and the rotation information of the second image, uses the second image as the target image, and performs the subsequent copy operation; the image distortion correction module performs an image distortion correction operation on the second image based on the lookup table to obtain an updated image and output it.
[0048] Specifically, when the image processing module is only configured with a hardware copy interface and does not have the function of rotating the target image, the target image can be quickly copied to the cache space using the hardware copy interface of the image processing module. For example, assuming that the rotation angle is 135 degrees, but the image processing module does not have the function of rotating the target image, at this time, the image distortion correction module is used to generate a lookup table based on the target image, and the target image is rotated 45 degrees to obtain a second image. Then, the image processing module obtains the second image and the rotation information of the second image, and uses the second image as the target image again, and uses the hardware copy interface of the image processing module again to copy the new target image to the cache space, and then uses the image distortion correction module to rotate the new target image 45 degrees, thereby obtaining a new second image. Finally, the new second image is used as the target image again, and the above process is repeated until the image distortion correction module rotates the image 45 degrees again to obtain the final complete and lossless updated image.
[0049] In the specific implementation process, the processor or other software can identify and calculate the rotation angle of the target image, and determine the rotation method of the target image according to whether the image processing module is configured with the function of rotating the target image. However, in the specific process of rotating the target image, it is implemented by hardware such as the image processing module and the image distortion correction module, which can reduce the work overhead of the CPU or GPU.
[0050] In this embodiment, the buffer space provides sufficient free space for the rotation of the target image, so that the updated image after rotation is intact, thereby improving the quality of the image rotation.
[0051] In some embodiments of the present application, a chip for image distortion correction is provided, the chip includes an image processing module and an image distortion correction module, the image processing module has a hardware copy interface, and is configured to obtain a target image and rotation information of the target image; the target image is copied to a cache space through the hardware copy interface to perform a copy operation, and the cache space allows the target image to rotate freely in the cache space; the image distortion correction module is further configured to: pre-calculate the position of each pixel of the target image after rotation based on the rotation information, and store the position information in a lookup table; rotate the target image in the cache space based on the lookup table to perform an image distortion correction operation, and output the obtained updated image. In this way, the CPU or GPU workload can be reduced, and the problem of incomplete image after rotation can be avoided.
[0052] In some other embodiments of the present application, the image processing module is further configured to perform a first rotation operation on the target image to obtain a first image, and then copy the first image to the cache space through the hardware copy interface when it is determined based on the rotation information that the rotation angle is greater than or equal to a preset angle and the image processing module is able to perform the first rotation operation; the image distortion correction module is further configured to perform a second rotation operation on the acquired first image based on a lookup table to obtain an updated image and output it.
[0053] In some other embodiments of the present application, the image processing module is further configured to perform a second rotation operation on the target image in the cache space based on the lookup table to obtain and output a second image when the rotation angle is greater than or equal to a preset angle based on the rotation information and the image processing module cannot perform the first rotation operation; obtain the second image and the rotation information of the second image, use the second image as the target image, and perform the subsequent copy operation; the image distortion correction module is further configured to perform an image distortion correction operation on the second image based on the lookup table to obtain and output an updated image. In this way, the updated image after rotation can be intact, which improves the quality of image rotation.
[0054] In some embodiments of the present application, a device for image distortion correction is provided, and the device includes the chip for image distortion correction described in each embodiment of the present application.
[0055] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0056] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
[0057] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) is integrated in the processor.
[0058] It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0059] It should also be understood that the first, second, third, fourth and various numerical numbers involved in this document are only distinctions made for the convenience of description and are not intended to limit the scope of the present application.
[0060] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0061] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
[0062] In various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0063] Those skilled in the art will appreciate that the various illustrative logical blocks (ILBs) and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0064] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices, chips, electronic devices and storage media can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0065] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0066] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0067] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0068] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for image distortion correction, characterized in that: The method comprises: Acquire a target image and rotation information of the target image by using an image processing module inside the SOC; Copying the target image to a cache space through a hardware copy interface of the image processing module to perform a copy operation, wherein the cache space can allow the target image to rotate freely within the cache space; Using the image distortion correction module inside the SOC, pre-calculate the position of each pixel of the target image after rotation based on the rotation information, and store the position information in a lookup table; The target image in the cache space is rotated based on the lookup table to perform an image distortion correction operation, and the obtained updated image is output.
2. The method according to claim 1, characterized in that The method further comprises: In the case where it is determined based on the rotation information that the rotation angle is greater than or equal to the preset angle and the image processing module is capable of performing the first rotation operation, The target image is subjected to a first rotation operation by using the image processing module to obtain a first image, and the first image is then copied to the cache space through the hardware copy interface.
3. The method according to claim 2, characterized in that The method further includes: using the image distortion correction module to perform a second rotation operation on the first image in the cache space based on the lookup table to obtain and output an updated image.
4. The method according to claim 1, characterized in that: The method further comprises: In the case where it is determined based on the rotation information that the rotation angle is greater than or equal to the preset angle and the image processing module cannot perform the first rotation operation, Using the image distortion correction module, based on the lookup table, a second rotation operation is performed on the target image in the cache space to obtain a second image and output it; The image processing module obtains the second image and rotation information of the second image, and uses the second image as a target image to perform the subsequent copy operation; The image distortion correction module performs an image distortion correction operation on the second image based on the lookup table to obtain an updated image and output it.
5. The method according to any one of claims 2 to 4, characterized in that: During the execution of the first rotation operation, the rotation angle is 90 degrees; During the second rotation operation, the rotation angle is no greater than 45 degrees.
6. The method according to claim 2, characterized in that The rotation information includes the rotation angle, the size of the target image, the format of the target image and the position of the cache space; the cache space is the cache center of a square whose side length is greater than or equal to the length of the longest diagonal of the target image.
7. A chip for image distortion correction, characterized in that: The chip includes an image processing module and an image distortion correction module. The image processing module has a hardware copy interface and is configured as follows: Acquire a target image and rotation information of the target image; Copying the target image to the cache space through the hardware copy interface to perform a copy operation, wherein the cache space can allow the target image to rotate freely within the cache space; The image distortion correction module is further configured to: pre-calculate the position of each pixel of the target image after rotation based on the rotation information, and store the position information in a lookup table; The target image in the cache space is rotated based on the lookup table to perform an image distortion correction operation, and the obtained updated image is output.
8. The chip according to claim 7, characterized in that: The image processing module is further configured to: when it is determined based on the rotation information that the rotation angle is greater than or equal to the preset angle and the image processing module is capable of performing the first rotation operation, perform the first rotation operation on the target image to obtain a first image, and then copy the first image to the cache space through the hardware copy interface; The image distortion correction module is further configured to: perform a second rotation operation on the acquired first image based on a lookup table to obtain and output an updated image.
9. The chip according to claim 7, characterized in that: The image processing module is further configured to: when it is determined based on the rotation information that the rotation angle is greater than or equal to the preset angle and the image processing module cannot perform the first rotation operation, Performing a second rotation operation on the target image in the cache space based on the lookup table to obtain a second image and output it; Acquire the second image and rotation information of the second image, and use the second image as a target image to perform the subsequent copy operation; The image distortion correction module is further configured to: perform an image distortion correction operation on the second image based on the lookup table to obtain an updated image and output it.
10. A device for image distortion correction, characterized in that: The device comprises a chip for image distortion correction as described in any one of claims 7 to 9.
Citation Information
Patent Citations
A high-precision image stepless rotation processing method in a display system
CN109685715A
FPGA-based binocular camera distortion correction system and method, and terminal device
CN112529795A
Integrated circuit and electronic device for distorting image
CN117057982A
Image remapping method and image processing device
WO2022127841A1
