CN117437126B - Image conversion method, computer device, and computer-readable storage medium - Google Patents
Image conversion method, computer device, and computer-readable storage medium Download PDFInfo
- Publication number
- CN117437126B CN117437126B CN202311771431.3A CN202311771431A CN117437126B CN 117437126 B CN117437126 B CN 117437126B CN 202311771431 A CN202311771431 A CN 202311771431A CN 117437126 B CN117437126 B CN 117437126B
- Authority
- CN
- China
- Prior art keywords
- pixel point
- original
- image
- target
- point coordinates
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000006243 chemical reaction Methods 0.000 title claims abstract description 21
- 238000000034 method Methods 0.000 title claims abstract description 20
- 238000013507 mapping Methods 0.000 claims abstract description 73
- 238000011426 transformation method Methods 0.000 claims abstract description 26
- 230000008569 process Effects 0.000 claims abstract description 6
- 230000009466 transformation Effects 0.000 claims description 46
- 238000004590 computer program Methods 0.000 claims description 9
- 238000012545 processing Methods 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 6
- 238000013519 translation Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000001131 transforming effect Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000003321 amplification Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000003199 nucleic acid amplification method Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4084—Scaling of whole images or parts thereof, e.g. expanding or contracting in the transform domain, e.g. fast Fourier transform [FFT] domain scaling
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
The invention provides an image transformation method, a computer device and a computer readable storage medium, comprising: acquiring original pixel point coordinates of an original image, and calculating target pixel point coordinates; judging whether each original pixel point coordinate is the same as the corresponding target pixel point coordinate, if not, establishing a mapping relation between the original pixel point coordinate and the corresponding target pixel point coordinate, and constructing an initial mapping table; determining the conversion sequence of each original pixel point according to the coverage relation of each pixel point in the image conversion process, and sorting the mapping sequence in the initial mapping table according to the conversion sequence of each original pixel point to form a sorting table; and sequentially acquiring the original pixel point coordinates according to the ordering table, acquiring target pixel point coordinates corresponding to the original pixel point coordinates from the initial mapping table, and assigning pixel values of the corresponding original pixel point coordinates to the target pixel point coordinates to form a target image. The invention can reduce the occupation of the memory space and the operation amount.
Description
Technical Field
The present invention relates to the field of image transformation, and in particular, to an image transformation method, a computer device, and a computer readable storage medium.
Background
In the field of video image processing, when a video image is transformed, different transformation functions are generally used to implement spatial transformation such as rotation, magnification, reduction, compression, and the like, on the image. Generally, when an image is transformed, a frame of the video image is first saved, a new memory with the same size as the frame of the video image is applied to a memory, a new coordinate of each point is calculated for the frame of the image in sequence by using a mathematical transformation formula of the effect, and then a pixel point of the old coordinate is copied to the new coordinate. However, this method requires applying for a more memory space, and each pixel of each frame of picture needs to be repeatedly calculated by a formula, at this time, the memory needs to store data of each pixel of an original image, and also stores data of each pixel of a new image, which occupies more memory space and has a larger operation amount of the processor.
One conventional image transformation method includes selecting a group of pixels smaller than a source image from the source image, storing the group of pixels in a memory, checking whether the group of pixels has at least one pixel requiring coordinate transformation by referring to a coordinate mapping table established in advance, transforming coordinates of the at least one pixel if the group of pixels has at least one pixel requiring coordinate transformation, and removing the group of pixels from the memory after the at least one pixel completes coordinate transformation. However, the image transformation method still needs to save a group of pixel columns, and also needs to apply for the memory space of the target image, and the occupied memory space is larger.
Disclosure of Invention
A first object of the present invention is to provide an image transformation method that reduces the occupation of memory space.
A second object of the present invention is to provide a computer apparatus implementing the above image conversion method.
A third object of the present invention is to provide a computer-readable storage medium to which the above image transformation method is applied.
In order to achieve the first object, the present invention provides an image transformation method, including: acquiring original pixel point coordinates of original pixel points of an original image, and calculating target pixel point coordinates of target pixel points according to a preset formula; judging whether each original pixel point coordinate is the same as the corresponding target pixel point coordinate, if not, establishing a mapping relation between the original pixel point coordinate and the corresponding target pixel point coordinate, and constructing an initial mapping table; determining the conversion sequence of each original pixel point according to the coverage relation of each pixel point in the image conversion process, and sorting the mapping sequence in the initial mapping table according to the conversion sequence of each original pixel point to form a sorting table; and sequentially acquiring the original pixel point coordinates according to the ordering table, acquiring the target pixel point coordinates corresponding to the current original pixel point coordinates from the initial mapping table, and assigning the pixel values of the corresponding original pixel point coordinates to the pixel values of the target pixel point coordinates to form a target image.
According to the scheme, the target pixel point coordinates are calculated according to a preset formula, a mapping relation is established between the original pixel point coordinates and the corresponding target pixel point coordinates, an initial mapping table is constructed, and after the initial mapping table is ordered, an ordering table is formed. The sorting table is a sorting table, and coordinates in the sorting table are sorted into the order in which the pixel points of the image need to be assigned. For example, when the target pixel coordinate needs to assign the pixel value of the corresponding original pixel coordinate to the target pixel, if the pixel value in the original pixel coordinate is already covered, the target pixel coordinate cannot find the original pixel of the corresponding original pixel coordinate. It is necessary to sort the original pixel point coordinates using a sorted list such that the coordinates that require assignment using the original pixel values are sorted backward. When the image transformation method is used for processing the image, as the assignment is only needed to be carried out on each pixel point on the original picture, only the memory space for storing the data of the original picture is needed to be applied, and the additional memory space is not needed to be applied for carrying out space transformation, so that the occupation of the memory space is reduced.
In a preferred scheme, if the original pixel point coordinates are the same as the corresponding target pixel point coordinates, the mapping relationship between the original pixel point coordinates and the corresponding target pixel point coordinates is not constructed.
Therefore, the original pixel point coordinates are the same as the corresponding target pixel point coordinates, and the pixel values of the original pixel point coordinates do not need to be moved, so that the mapping relation between the original pixel point coordinates and the corresponding target pixel point coordinates is not constructed, and the subsequent reading of the data quantity is reduced.
In a further scheme, before calculating the coordinates of the target pixel point of each target pixel point according to a preset formula, the method further comprises the following steps: setting up a central transformation point of the original image, and establishing a coordinate system for the original image.
It follows that a four-quadrant coordinate system can be established by the center transformation point.
In a further scheme, a plurality of symmetrical areas of the original image are determined according to the symmetrical relation of the original image; when calculating the target pixel point coordinates of each target pixel point according to a preset formula, only calculating the target pixel point coordinates corresponding to the original pixel point coordinates of one target symmetrical area.
It can be seen that a plurality of symmetric regions of the original image are confirmed according to the symmetric relation of the original image and a preset formula. For example, the symmetric region may be four-quadrant symmetric. By calculating the coordinates of the target pixel point corresponding to the coordinates of the original pixel point of only one target symmetric region, the calculation pressure of the processor can be reduced when the processor calculates.
In a further scheme, when an initial mapping table is formed, the mapping relation between the original pixel point coordinates of each residual symmetric region and the corresponding target pixel point coordinates is the same as the mapping relation between the original pixel point coordinates of the target symmetric region and the corresponding target pixel point coordinates.
Therefore, the mapping relationship between the original pixel point coordinates of the residual symmetric region and the corresponding target pixel point coordinates is a first mapping relationship, the mapping relationship between the original pixel point coordinates of the target symmetric region and the corresponding target pixel point coordinates is a second mapping relationship, and the first mapping relationship is identical to the second mapping relationship based on the symmetric mode, so that the calculation pressure of the processor can be reduced by only constructing the initial mapping table of one target symmetric region.
In a further scheme, when forming the ranking table, the mapping sequence of each original pixel point of each residual symmetric region is the same as and symmetric to the mapping sequence of the original pixel point of the target symmetric region.
Therefore, because the mapping order of the original pixel points of the residual symmetric region is the same as and symmetric to the mapping order of the original pixel points of the target symmetric region due to the symmetric relation, the mapping order of the original pixel points of the residual symmetric region can be directly obtained by symmetrically modifying the ordering table of the target symmetric region.
In a further scheme, when the target image is formed, the pixel value assignment operation of the original pixel point coordinates of each symmetrical region is synchronously performed.
Therefore, when the pixel values of the original pixel point coordinates of the target symmetrical area are assigned, the pixel values of the original pixel points of the residual symmetrical area are assigned.
In a further aspect, when forming the target image, the target image is formed in a pixel coverage manner based on the original image.
Therefore, the coordinate of the original pixel point of the target symmetrical area and the original pixel point of the residual symmetrical area have symmetrical relation due to the symmetrical relation, and assignment is performed at the same time, so that the calculated amount can be reduced, and the image transformation efficiency is improved.
In order to achieve the second object, the present invention provides a computer device including a processor and a memory, wherein the memory stores a computer program, and the computer program realizes the image conversion method when executed by the processor.
In order to achieve the third object described above, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed, implements the image conversion method described above.
Drawings
Fig. 1 is a flowchart of an embodiment of the image transformation method of the present invention.
Fig. 2 is a schematic diagram of an original image of an embodiment of the image transformation method of the present invention.
Fig. 3 is a schematic diagram of a transformation of an embodiment of the image transformation method of the present invention.
The invention is further described below with reference to the drawings and examples.
Detailed Description
Image transformation method embodiment:
in the image transformation processing of video, when each frame of picture needs to be transformed, a large amount of cache of a processor and computing power of the processor are required to be consumed. In the image transformation method in this embodiment, the coverage operation of the pixel points is directly performed on the original image, so that the processor does not need to apply for the memory of one frame of picture, and the use amount of the buffer space of the processor is reduced.
Referring to fig. 1, fig. 1 is a flowchart of an embodiment of an image transformation method of the present invention. Firstly, a transformation area is required to be set, a range needing transformation in an original image is determined, and the reading quantity of data is reduced, wherein the transformation area is an area needing transformation in the original image, and the area outside the transformation area is an area needing no transformation in the original image. In this embodiment, the four-quadrant symmetrical image transformation effect is taken as an example, and in the four-quadrant symmetrical image, the transformation process is four-quadrant symmetrical, so that the original image center transformation point needs to be set up, and a coordinate system needs to be established. Referring to fig. 2, a transformation area 11 is provided on the original image 1, and the transformation area 11 is circular. After setting the transformation area 11, a center transformation point 13 of the original image is established, and a coordinate system for the original image is established. The coordinate system may divide the portion of the original image that needs to be transformed into four quadrants.
In this embodiment, step S1 is first executed to obtain coordinates of each original pixel point of the original image, and calculate coordinates of each target pixel point according to a preset formula. Specifically, the preset formula may be an image transformation formula such as an amplification formula, a translation formula, and the like.
In another embodiment, a plurality of symmetric regions of the original image are determined from the symmetric relationship of the original image; when calculating the target pixel point coordinates of each target pixel point according to a preset formula, only calculating the target pixel point coordinates corresponding to the original pixel point coordinates of one target symmetrical area. In this embodiment, since the original image is divided into four quadrants by using the coordinate system, a plurality of symmetric regions of the original image may be determined according to the symmetric relation of the original image and a preset formula, for example, if the preset formula is an amplified transformation formula, the amplified transformation formula is amplified by taking the origin as the center, so that the plurality of symmetric regions of the original image are determined to be four quadrants;
if the transformation formula is a translation transformation formula, determining a transformation area of the original image, and then confirming coordinate axes in a constructed coordinate system according to the translation transformation direction, and establishing a symmetrical area of the original image through the coordinate axes. Since the translation transformation formula is only axisymmetric, two quadrants are a transformation area of the original image in the established coordinate system. And confirming the symmetrical area of the original image according to the original image and a preset formula, and then performing image transformation processing, so that the number of original pixel point coordinates required to be calculated can be reduced, and the calculation amount of a processor is reduced.
When the coordinates of each target pixel point are calculated according to a preset formula, the symmetrical relation of the original image is established, so that the coordinates of the target pixel points corresponding to the coordinates of the original pixel points of one target symmetrical area are calculated. Since a plurality of symmetric regions are confirmed by four quadrants in this embodiment, the absolute value of the coordinates of the symmetric original pixel points of each symmetric region is the same as that of the symmetric original pixel points of the target symmetric region, so that the pixel values of the rest symmetric regions are not calculated.
After generating each target pixel point coordinate, step S2 is executed to determine whether each original pixel point coordinate is the same as the target pixel point coordinate corresponding to each original pixel point coordinate. If the original pixel point coordinates are different from the corresponding target pixel point coordinates, executing step S3, establishing a mapping relation between the original pixel point coordinates and the corresponding current target pixel point coordinates, and establishing an initial mapping table. The initial mapping table comprises original pixel point coordinates and target pixel point coordinates corresponding to the original pixel point coordinates. The initial mapping table can be used for inquiring the target pixel point coordinate corresponding to the current original pixel point coordinate, and the displacement of the original coordinate pixel point coordinate and the target pixel point coordinate corresponding to the original coordinate pixel point coordinate.
In another embodiment, when only the target pixel coordinates corresponding to the original pixel coordinates of one target symmetric region are calculated, the mapping relationship from the initial mapping table to the target pixel corresponding to the original pixel coordinates of the one target symmetric region is included, the mapping relationship between the original pixel coordinates of each remaining symmetric region and the corresponding target pixel coordinates is a first mapping relationship, the mapping relationship between the original pixel coordinates of the target symmetric region and the corresponding target pixel coordinates is a second mapping relationship, and the first mapping relationship is the same as the second mapping relationship, so that the initial mapping table is also used by each remaining symmetric region.
If the original pixel point coordinates are the same as the corresponding target pixel point coordinates, the step S6 is executed without constructing the mapping relationship between the original pixel point coordinates and the corresponding target pixel point coordinates. Since the pixel point does not need to be moved when the original pixel point coordinates are the same as the target pixel point coordinates. In addition, the coordinates of the original pixel point coordinates and the coordinates of the target pixel point coordinates are screened, only the current original pixel point coordinates needing to be moved are reserved, the occupied area of the buffer memory of the processor can be reduced, and the processing amount of the processor data is reduced when the subsequent pixel points are moved.
After the initial mapping table is established in step S3, step S4 is executed to establish the ranking table. Specifically, the conversion sequence of each original pixel point is determined according to the coverage relation of each pixel point in the image conversion process, and the mapping sequence in the initial mapping table is ordered according to the conversion sequence of each original pixel point to form an ordering table. In the coverage relation of each pixel point, if the pixel value of the pixel point is covered by other pixel points, the pixel point is arranged at the front, and the original pixel point coordinates corresponding to the pixel point are arranged at the rear. For example, when the pixel value of the first original pixel point coordinate needs to be assigned to the pixel value of the first target pixel point coordinate, if the pixel value in the first original pixel point coordinate is replaced, the first target pixel point coordinate cannot find the original pixel value of the first current target pixel point coordinate. It is necessary to sort the coordinates of the original pixel using the sorting table, and if the pixel value of the pixel is required to be assigned, the coordinates of the pixel are arranged behind the target pixel using the pixel value of the pixel. The ordered list may be such that the pixel values of the original pixels are not lost while the coordinates of the image are moving.
In another embodiment, the ordered list is formed to include only the original pixel coordinates of one symmetric region. The mapping sequence of the original pixel points of each residual symmetrical area is the same as the mapping sequence of the original pixel points of the target symmetrical area. When only the coordinates of the target pixel point corresponding to the original pixel point coordinates of one target symmetric region are calculated, the rest symmetric regions also use the sorting table.
After the ordering table is established, step S5 is executed, each original pixel point coordinate is sequentially obtained according to the ordering table, the target pixel point coordinate corresponding to the original pixel point coordinate is obtained from the initial mapping table, and the pixel value of the corresponding original pixel point coordinate is assigned to the pixel value of the target pixel point coordinate, so that the target image is formed. When the target image is formed, the target image is formed in a pixel coverage mode on the basis of the original image, and the application does not need to apply for a memory space of the target image.
In another embodiment, the pixel value assignment operation of the original pixel point coordinates for each symmetric region is performed synchronously when forming the target image. For the four-quadrant symmetrical transformation condition, the rest symmetrical areas can modify the signs of the initial mapping table and the coordinates of the sorting table according to the symmetrical relation of the symmetrical areas, namely, the initial mapping table and the sorting table can be used for carrying out the pixel value assignment operation of the original pixel point coordinates. For example, in this embodiment, the target symmetric region is the second quadrant, and the remaining symmetric regions, such as the first quadrant, can be used by changing the x-coordinates of the original pixel coordinates of the initial mapping table and the ordered table to negative values.
Assume that a frame of image in the video needs to be enlarged by a convex lens, wherein the video with 1280 multiplied by 720 resolution is enlarged by the convex lens by taking the center point as the center and taking the video height as the diameter.
Firstly, after decoding, the original video single-frame image is stored in an RGB888 sampling mode, namely each pixel point consists of a red component of 8Bit, a green component of 8Bit and a blue component of 8 Bit.
The conventional image conversion method requires an additional application of a memory space having the same size as the original image, and is used as the target image. Then, a transformation area is calculated, for example, the transformation area is a circle, the absolute value of the distance from the pixel point to the center of the circle needs to be calculated from the point (0, 0), if the absolute value is smaller than the preset radius, the point is processed, new coordinates (x ', y') are calculated according to a convex lens formula, R, G, B values of the pixel points (x ', y') of the original image are assigned to the positions of the new image (x, y), namely, the processing of one pixel point is completed, and then the steps are repeated for the next pixel point until all the pixel points of the frame image are processed. The method requires pre-applying for the memory space of two RGB888 images with 1280 x 720 resolution, the memory space occupies large space, and the size of the memory occupied space is 1280 x 720 x 3 x 2= 5529600Bytes. The processor needs to calculate the distance between the whole frame image and the original point, and calculate the pixel points of the transformation area, wherein the number of times of calculation is 1280×720= 921600 times. The convex lens formula coordinate transformation calculation is also needed to be carried out in the circle, and the calculation times are pi×360×360= 406944 times. Wherein 360 is the radius of the circle. If the video has n frames, the picture with n frames is needed to carry out the above processing.
When the image transformation method of the present embodiment is applied, only the RGB888 image space with 1280×720 resolution, a second-quadrant initial mapping table and a second-quadrant ordering table are required. Since the image magnified by the convex lens is converted into the image with central symmetry, the coordinate of the second quadrant is calculated, and the coordinate conversion of the other quadrants is applied to the coordinate conversion result of the first quadrant to change the sign. The sum of the memory occupied by the initial mapping table and the sorting table is 2 x pi 360 x 360/4= 610726Bytes. The total memory space required is 1280 x 720 x 3+610726= 3456000 Bytes.
When the processor calculates, only the absolute value of the distance between the original pixel points in the second quadrant and the convex lens formula conversion in the second quadrant are needed to be calculated, and the operation pressure of the processor is reduced by three quarters.
The sorting table and the initial mapping table of the remaining quadrants are moved, and the symbols of the sorting table and the initial mapping table are changed for use.
Referring to fig. 3, fig. 3 is a schematic diagram of a transformation of an embodiment of the image transformation method of the present invention. Assuming that the fourth quadrant has four pixel point coordinates A, B, C, D, wherein D is not in a circle, namely is not in a transformation range, so that a mapping relation of the D point coordinates is not required to be constructed; assuming that the pixel value of the point C needs to be assigned to the point B and the pixel value of the point B needs to be assigned to the point a, in the sorted list, the point a coordinates need to be stored before the point B coordinates, and the point B coordinates need to be placed before the point C coordinates. When the target image is generated, the A point coordinate is firstly obtained through the ordering table, the coordinate to be assigned of the A point coordinate is obtained through the initial mapping table, and then the A point coordinate is assigned to the coordinate to be assigned of the A point coordinate. And the B point coordinate can be read through the ordering table, the A point coordinate corresponding to the B point is read through the initial mapping table, and then the pixel value of the B point coordinate is assigned to the A point coordinate. When the C point coordinate is obtained through the ordering table, the B point coordinate corresponding to the C point is read through the initial mapping table, and the pixel value of the C point coordinate is assigned to the B point coordinate.
When the image transformation method of the embodiment processes the image, only the memory space of one original picture is required to be applied, and no additional memory space is required to be applied for space transformation, so that the occupation of the memory space is reduced.
Computer apparatus embodiment:
the computer device of the present embodiment includes a processor and a memory, the memory stores a computer program, and the processor implements the image transformation method described above when executing the computer program.
Computer devices may include, but are not limited to, processors and memory. Those skilled in the art will appreciate that a computer apparatus may include more or fewer components, or may combine certain components, or different components, e.g., a computer apparatus may also include input and output devices, network access devices, buses, etc.
Computer-readable storage medium embodiments:
the image transforming method in the computer apparatus described in the above embodiment may be stored in a computer-readable storage medium in the form of a computer program which, when executed by a processor, performs the steps of the image transforming method embodiment in the computer apparatus described above. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing is merely a preferred embodiment of the present invention, but the inventive design concept is not limited thereto, and many other equivalent embodiments can be included without departing from the scope of the invention, as will be apparent to those skilled in the art.
Claims (9)
1. An image transformation method, comprising:
acquiring original pixel point coordinates of original pixel points of an original image, and calculating target pixel point coordinates of target pixel points according to a preset formula;
the method is characterized in that:
judging whether the original pixel point coordinates are the same as the corresponding target pixel point coordinates or not, if not, establishing a mapping relation between the original pixel point coordinates and the corresponding target pixel point coordinates, and constructing an initial mapping table;
determining the conversion sequence of each original pixel point according to the coverage relation of each pixel point in the image conversion process, and sorting the mapping sequence in the initial mapping table according to the conversion sequence of each original pixel point to form a sorting table;
in the coverage relation of each pixel point, one pixel point is covered by other pixel points, the pixel points covered by other pixel points are arranged in front, and the original pixel points corresponding to the pixel points covered by other pixel points are arranged in back;
sequentially acquiring each original pixel point coordinate according to the sorting table, acquiring the target pixel point coordinate corresponding to the current original pixel point coordinate from the initial mapping table, and assigning the pixel value of the corresponding original pixel point coordinate to the pixel value of the target pixel point coordinate to form a target image;
when the target image is formed, the target image is formed in a pixel coverage mode on the basis of the original image.
2. The image transformation method according to claim 1, wherein:
if the original pixel point coordinates are the same as the corresponding target pixel point coordinates, the mapping relation between the original pixel point coordinates and the corresponding target pixel point coordinates is not constructed.
3. The image transformation method according to claim 1, wherein:
before calculating the coordinates of the target pixel points of each target pixel point according to a preset formula, the method further comprises the following steps: setting up a central transformation point of the original image, and setting up a coordinate system for the original image.
4. A method of image transformation according to claim 3, characterized in that:
before establishing the coordinate system for the original image, further performing: determining a plurality of symmetrical areas of the original image according to the symmetrical relation of the original image;
when calculating the target pixel point coordinates of each target pixel point according to a preset formula, only calculating the target pixel point coordinates corresponding to the original pixel point coordinates of one target symmetrical area.
5. The image transformation method according to claim 4, wherein:
when the initial mapping table is formed, the mapping relation between the original pixel point coordinates of each residual symmetrical area and the corresponding target pixel point coordinates is the same as the mapping relation between the original pixel point coordinates of the target symmetrical area and the corresponding target pixel point coordinates.
6. The image transformation method according to claim 5, wherein:
when the ordering table is formed, the mapping sequence of the original pixel points of each residual symmetrical area is the same as the mapping sequence of the original pixel points of the target symmetrical area.
7. The image transformation method according to claim 5 or 6, characterized in that:
and when the target image is formed, pixel value assignment operation of each symmetrical region on the original pixel point coordinates is synchronously performed.
8. Computer device, characterized in that it comprises a processor and a memory, the memory storing a computer program which, when executed by the processor, implements the image transformation method according to any one of claims 1 to 7.
9. A computer readable storage medium having stored thereon a computer program characterized by:
the computer program when executed implements the image transformation method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311771431.3A CN117437126B (en) | 2023-12-21 | 2023-12-21 | Image conversion method, computer device, and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311771431.3A CN117437126B (en) | 2023-12-21 | 2023-12-21 | Image conversion method, computer device, and computer-readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117437126A CN117437126A (en) | 2024-01-23 |
CN117437126B true CN117437126B (en) | 2024-04-12 |
Family
ID=89556967
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311771431.3A Active CN117437126B (en) | 2023-12-21 | 2023-12-21 | Image conversion method, computer device, and computer-readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117437126B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6035075A (en) * | 1997-04-10 | 2000-03-07 | Nec Corporation | Image deforming method and apparatus |
CN111369446A (en) * | 2018-12-26 | 2020-07-03 | 杭州海康威视数字技术股份有限公司 | Image rotation method and device |
CN113160321A (en) * | 2021-02-22 | 2021-07-23 | 中国科学院上海微系统与信息技术研究所 | Geometric mapping method and device for real-time image sequence |
CN114418847A (en) * | 2021-12-31 | 2022-04-29 | 统信软件技术有限公司 | Image scaling implementation method, processing device and computing equipment |
CN116071421A (en) * | 2021-10-31 | 2023-05-05 | 华为技术有限公司 | Image processing method, device and computer readable storage medium |
-
2023
- 2023-12-21 CN CN202311771431.3A patent/CN117437126B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6035075A (en) * | 1997-04-10 | 2000-03-07 | Nec Corporation | Image deforming method and apparatus |
CN111369446A (en) * | 2018-12-26 | 2020-07-03 | 杭州海康威视数字技术股份有限公司 | Image rotation method and device |
CN113160321A (en) * | 2021-02-22 | 2021-07-23 | 中国科学院上海微系统与信息技术研究所 | Geometric mapping method and device for real-time image sequence |
CN116071421A (en) * | 2021-10-31 | 2023-05-05 | 华为技术有限公司 | Image processing method, device and computer readable storage medium |
CN114418847A (en) * | 2021-12-31 | 2022-04-29 | 统信软件技术有限公司 | Image scaling implementation method, processing device and computing equipment |
Non-Patent Citations (1)
Title |
---|
鱼眼视频图像畸变的实时校正方法;吕耀文 等;吉林大学学报(理学版);20170126(第01期);第103-108页 * |
Also Published As
Publication number | Publication date |
---|---|
CN117437126A (en) | 2024-01-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107204034B (en) | A kind of image processing method and terminal | |
CN109934773B (en) | Image processing method, device, electronic equipment and computer readable medium | |
JP2002328881A (en) | Image processor, image processing method and portable video equipment | |
CN111107274B (en) | Image brightness statistical method and imaging device | |
KR20180074631A (en) | Writing-data generating method and charged particle beam writing apparatus | |
CN109194878A (en) | Video image anti-fluttering method, device, equipment and storage medium | |
CN111767752B (en) | Two-dimensional code identification method and device | |
CN112233009A (en) | Picture rendering method, device, equipment and storage medium | |
JP2013125519A (en) | Image processing apparatus, data structure, and image generating apparatus | |
CN117437126B (en) | Image conversion method, computer device, and computer-readable storage medium | |
JP2017182480A (en) | Image processing device and image processing method | |
CN108230454B (en) | Panorama picture cutting method and device and storage medium | |
JPH1049665A (en) | Device and method for image processing | |
EP0574245A2 (en) | Method and apparatus for variable expansion and variable shrinkage of an image | |
CN115190263B (en) | Video scaling method, device, equipment and storage medium | |
JPH08137908A (en) | Method and device for retrieving picture | |
CN113744364B (en) | Image processing method and device | |
CN111105356B (en) | Image processing method, device and computer readable storage medium | |
CN113824894A (en) | Exposure control method, device, equipment and storage medium | |
CN116309160B (en) | Image resolution restoration method, device, equipment and storage medium | |
US11893706B2 (en) | Image correction device | |
CN116823619A (en) | Method and system for generating base map by overlapping atlas | |
CN115689888A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
JP2000020735A (en) | Texture image generation device | |
JPH05101175A (en) | Enlargement and reduction processing system for digital binary image |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |