Image processing method and device

By acquiring and calculating the polar coordinates of image pixel points and combining mapping parameters, nonlinear deformation processing is realized, solving the problem of poor deformation effect in the prior art, and generating more complex and natural image special effects.

CN111292245BActive Publication Date: 2025-03-11DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201811496667.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-12-07
Publication Date
2025-03-11
Estimated Expiration
2040-03-14

AI Technical Summary

Technical Problem

The prior art is difficult to achieve nonlinear deformation effects through linear deformation such as rotation and translation, resulting in poor deformation effects of certain images.

Method used

By obtaining the first polar coordinates of the pixel point of the image to be processed, and calculating the second polar coordinates of the pixel point according to the mapping parameters, the processed image is generated, thereby realizing nonlinear deformation.

Benefits of technology

Nonlinear deformation processing on the image is realized, the problem of poor deformation effect in the prior art is solved, and more complex and natural image special effects can be generated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111292245B_ABST
    Figure CN111292245B_ABST
Patent Text Reader

Abstract

The present disclosure discloses an image processing method, device, electronic device and computer-readable storage medium. The image processing method comprises: obtaining an image to be processed; obtaining the first polar coordinates of the pixel points of the image to be processed; obtaining mapping parameters; calculating the second polar coordinates of the pixel points according to the first polar coordinates and the mapping parameters; and generating a processed image according to the second polar coordinates. The embodiment of the present disclosure calculates the positions of the pixel points of the deformed image through the polar coordinates and mapping parameters of the original image, thereby solving the technical problem of complex implementation of nonlinear deformation in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and in particular to an image processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of computer technology, the application scope of smart terminals has been widely improved. For example, you can listen to music, play games, chat online, take photos, etc. With regard to the photography technology of smart terminals, its photography pixels have reached more than 10 million pixels, with high clarity and photography effects comparable to professional cameras.

[0003] At present, when taking photos with smart terminals, not only can the built-in camera software at the factory be used to achieve the traditional camera effects, but also the application program (Application, referred to as: APP) can be downloaded from the network to achieve the camera effects with additional functions, such as APPs that can realize functions such as dark light detection, beauty camera and super pixel. By combining various basic image processing, various special effects can be formed, such as beauty, filter, big eyes and thin face, etc.

[0004] Existing image special effects generally use special effect resources to process images, such as adding a filter effect or a skin smoothing effect. The corresponding deformation special effects generally rotate and translate the image. For some special effects, since their deformation is not linear, it is difficult to achieve them only through rotation and translation, which becomes a problem that needs to be solved urgently. Summary of the invention

[0005] In a first aspect, an embodiment of the present disclosure provides an image processing method, comprising: obtaining an image to be processed; obtaining first polar coordinates of pixel points of the image to be processed; obtaining mapping parameters; calculating second polar coordinates of the pixel points based on the first polar coordinates and the mapping parameters; and generating a processed image based on the second polar coordinates.

[0006] Furthermore, the obtaining of the image to be processed includes: obtaining a current image frame of the video as the image to be processed.

[0007] Furthermore, the obtaining of the first polar coordinates of the pixel point of the image to be processed includes: obtaining the first UV coordinates of the pixel point; converting the first UV coordinates into first Cartesian coordinates; and converting the first Cartesian coordinates into first polar coordinates.

[0008] Further, the obtaining of mapping parameters includes: obtaining a mapping type; and obtaining mapping parameters corresponding to the mapping type.

[0009] Furthermore, the mapping type is isometric mapping, and the mapping parameters are focal length and incident angle.

[0010] Furthermore, calculating the second polar coordinates of the pixel point according to the first polar coordinates and mapping parameters includes: calculating an offset of the pixel point according to the mapping parameters; and calculating the second polar coordinates of the pixel point according to the offset and the first polar coordinates.

[0011] Furthermore, the calculating the offset of the pixel point according to the mapping parameters includes: obtaining a mapping function; and substituting the mapping parameters into the mapping function to calculate the offset of the pixel point.

[0012] Furthermore, generating a processed image according to the second polar coordinates includes: assigning the first attribute value of the pixel point to the pixel point at the position of the second polar coordinates to generate the processed image.

[0013] Furthermore, assigning the first attribute value of the pixel point to the pixel point at the position of the second polar coordinate to generate a processed image includes: converting the second polar coordinate into a second UV coordinate; assigning the first attribute value of the pixel point to the pixel point at the position of the second UV coordinate to generate a processed image.

[0014] Furthermore, converting the second polar coordinates into second UV coordinates includes: converting the second coordinates into second Cartesian coordinates; and normalizing the second Cartesian coordinates into second UV coordinates.

[0015] Furthermore, the obtaining of the first polar coordinates of the pixel points of the image to be processed includes: obtaining the first polar coordinates of any pixel point of the image to be processed.

[0016] In a second aspect, an embodiment of the present disclosure provides an image processing device, including:

[0017] An image acquisition module, used for acquiring an image to be processed;

[0018] A first coordinate acquisition module, used to acquire the first polar coordinates of the pixel point of the image to be processed;

[0019] A mapping parameter acquisition module, used to acquire mapping parameters;

[0020] A second coordinate calculation module, used for calculating the second polar coordinates of the pixel point according to the first polar coordinates and mapping parameters;

[0021] An image processing module is used to generate a processed image according to the second polar coordinates.

[0022] Furthermore, the image acquisition module is also used to: acquire a current image frame of the video as an image to be processed.

[0023] Furthermore, the first coordinate acquisition module further includes:

[0024] A first UV coordinate acquisition module, used to acquire the first UV coordinate of the pixel point;

[0025] A first conversion module, used for converting the first UV coordinate into a first Cartesian coordinate;

[0026] The second conversion module is used to convert the first Cartesian coordinates into first polar coordinates.

[0027] Furthermore, the mapping parameter acquisition module further includes:

[0028] Type acquisition module, used to obtain the mapping type;

[0029] The mapping parameter acquisition submodule is used to obtain the mapping parameters corresponding to the mapping type.

[0030] Furthermore, the mapping type is isometric mapping, and the mapping parameters are focal length and incident angle.

[0031] Furthermore, the second coordinate calculation module further includes:

[0032] An offset calculation module, used to calculate the offset of the pixel point according to the mapping parameters;

[0033] The second coordinate calculation submodule is used to calculate the second polar coordinates of the pixel point according to the offset and the first polar coordinates.

[0034] Furthermore, the offset calculation module includes:

[0035] A mapping function acquisition module is used to acquire a mapping function;

[0036] The offset calculation submodule is used to bring the mapping parameters into a mapping function to calculate the offset of the pixel point.

[0037] Furthermore, the image processing module further includes:

[0038] An assignment module is used to assign the first attribute value of the pixel point to the pixel point at the position of the second polar coordinate to generate a processed image.

[0039] Furthermore, the assignment module further includes:

[0040] A third coordinate conversion module, used for converting the second polar coordinate into a second UV coordinate;

[0041] The assignment submodule is used to assign the first attribute value of the pixel point to the pixel point at the position of the second UV coordinate to generate a processed image.

[0042] Furthermore, the third coordinate conversion module further includes:

[0043] a fourth coordinate conversion module, used for converting the second coordinate into a second Cartesian coordinate;

[0044] The fifth coordinate conversion module is used to normalize the second Cartesian coordinate and convert it into a second UV coordinate.

[0045] Furthermore, the first coordinate acquisition module is also used for:

[0046] Obtain the first polar coordinates of any pixel point of the image to be processed.

[0047] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor; and

[0048] A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform any of the image processing methods described in the first aspect.

[0049] In a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium, characterized in that the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute any image processing method described in the first aspect.

[0050] The present disclosure discloses an image processing method, device, electronic device and computer-readable storage medium. The image processing method comprises: obtaining an image to be processed; obtaining the first polar coordinates of the pixel points of the image to be processed; obtaining mapping parameters; calculating the second polar coordinates of the pixel points according to the first polar coordinates and the mapping parameters; and generating a processed image according to the second polar coordinates. The embodiment of the present disclosure calculates the positions of the pixel points of the deformed image through the polar coordinates and mapping parameters of the original image, thereby solving the technical problem of complex implementation of nonlinear deformation in the prior art.

[0051] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0053] Figure 1 A flowchart of an image processing method embodiment provided by an embodiment of the present disclosure;

[0054] Figure 2 A schematic diagram of isometric mapping in an image processing method provided in an embodiment of the present disclosure;

[0055] Figure 3 A schematic diagram of radial offset in the image processing method provided in an embodiment of the present disclosure;

[0056] Figure 4 A schematic diagram of the structure of an embodiment of an image processing device provided by an embodiment of the present disclosure;

[0057] Figure 5 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0058] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.

[0059] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0060] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0061] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0062] Figure 1 This is a flowchart of the first embodiment of the image processing method provided by the embodiment of the present disclosure. The image processing method provided by this embodiment can be executed by an image processing device. The image processing device can be implemented as software, or as a combination of software and hardware. The image processing device can be integrated in a device in the image processing system, such as an image processing server or an image processing terminal device. Figure 1 As shown, the method comprises the following steps:

[0063] Step S101, obtaining an image to be processed;

[0064] In one embodiment, the image to be processed can be obtained through an image sensor, and the image sensor refers to various devices that can collect images, and typical image sensors are video cameras, cameras, and the like. In this embodiment, the image sensor can be a camera on a terminal device, such as a front or rear camera on a smart phone. The image collected by the camera can be directly displayed on the display screen of the mobile phone. In this step, the image video captured by the image sensor is obtained for further processing of the image in the next step.

[0065] In this embodiment, the acquisition of the image to be processed may be to acquire the current image frame of the video captured by the current terminal device. Since the video is composed of multiple image frames, the processing of the image in this embodiment may be to process the image frames of the video.

[0066] Step S102: obtaining the first polar coordinates of the pixel points of the image to be processed;

[0067] In one embodiment, the image to be processed is mapped from the UV image to the texture image, that is, the image to be processed is rendered after obtaining the color value of the pixel point at the corresponding position of the texture image on the UV graph. Therefore, in this embodiment, the obtaining of the first polar coordinates of the pixel point of the image to be processed includes: obtaining the first UV coordinate of the pixel point; converting the first UV coordinate into a first Cartesian coordinate; converting the first Cartesian coordinate into a first polar coordinate. The Cartesian coordinates are the coordinates used by the texture image. Let the UV coordinate be (u, v), the texture image be a p*q image, where P is the number of pixels in the horizontal direction of the texture image, q is the number of pixels in the vertical direction of the texture image, and the origin of the Cartesian coordinate system of the texture image coincides with the origin of the UV coordinate system of the UV image, then the Cartesian coordinates (x, y) of any point on the texture image are (u*p, v*q), and thus its polar coordinates (ρ, α) are The following is a specific example to illustrate the conversion process of the above coordinates: the value range of the UV coordinate is [0,1], the texture image is a 1280*720 image, and the coordinates of the pixel point of the image to be processed in the UV image are (0.5,0.5), then the Cartesian coordinates of the pixel point on the texture image are calculated to be (0.5*1280,0.5*720)=(640,360), then the polar coordinates of the point are

[0068] The coordinate transformation in the above example is based on the coincidence of the origins of the three coordinate systems. If the origins of the UV coordinate system and the Cartesian coordinate system do not coincide, the above angle α needs to be further processed. When x<0, When x>0,

[0069] In one embodiment, the step of obtaining the first polar coordinates of the pixel point of the image to be processed includes: obtaining the first polar coordinates of any pixel point of the image to be processed. That is to say, the image processing method disclosed herein can process any pixel point in the image, and can choose to process the entire image or a portion of the image.

[0070] Step S103: obtaining mapping parameters;

[0071] In one embodiment, a parameter required for pixel point mapping is obtained, and the parameter may be a parameter defining the degree of the pixel point mapping, such as the degree of offset.

[0072] In one embodiment, the acquisition of mapping parameters includes: acquiring the type of mapping; acquiring mapping parameters corresponding to the type of mapping. In this embodiment, it is preferred to acquire the type of mapping, and the type of mapping may be a user-defined type. Each type of mapping corresponds to a different mapping function, and the mapping function is used to calculate the position of a pixel after deformation. In this case, the mapping parameters are the parameters of the mapping function, which are used to define the form of the function itself. Optionally, the mapping type is isometric mapping, and the mapping parameters are the focal length and incident angle of the isometric mapping. For the meaning of isometric mapping, please refer to the attached figure. Figure 2 As shown, 201 is a mapping model. In this embodiment, the mapping model is a spherical lens, 202 is the original image, 203 is the mapped image, a pixel point A of the original image has a mapping point B on the mapping model, BO is the incident light of point B, θ is the incident angle, point G is the pixel point of point A after being offset by the mapping model, C is the origin of the original image, E is the origin of the mapped image, the length of GE is d, and the focal length of the mapping model is OE=f, then d=f*θ, that is, the distance from the pixel to the origin after mapping is directly proportional to the incident angle. It can be understood that the above mapping method is only an example. In fact, any mapping method can be applied to the present disclosure. For example, the function of the orthogonal mapping model is d=f*sin(θ), etc. The mapping parameters required for different mapping methods may be different, which will not be repeated here. Step S104: Calculate the second polar coordinates of the pixel point based on the first polar coordinates and mapping parameters;

[0073] In one embodiment, the second polar coordinates of the pixel point are calculated according to the angle in the first polar coordinates and the mapping parameters.

[0074] In one embodiment, the offset of the pixel is calculated according to the mapping parameters, and the second polar coordinate of the pixel is calculated according to the offset and the first polar coordinate. The calculating the offset of the pixel according to the mapping parameters includes obtaining an offset function; substituting the mapping parameters into the offset function to calculate the offset of the pixel. In this embodiment, the offset can be the radial offset of the pixel in the lens in step S103, such as Figure 3 As shown, it is the bottom view of the lens, and Figure 2 The bottom surface of the lens in corresponds to Figure 2In the figure, point B is the projection point on the bottom surface, G' is the projection of point G on the bottom surface, where OG'=OG, which is the offset of the pixel point in response to the coordinate origin. From the example in step S103, OG=d=f*θ can be calculated, where f is a constant, and θ is also a constant, so d can be calculated. In this embodiment, the pixel point only undergoes radial offset, so the angle α in the first polar coordinate does not change, and the second polar coordinate can be obtained as (f*θ,α); or, θ is not a constant, and the circular radius R of the lens used as the mapping model is a constant. In this case, θ can be calculated by the circular radius R. The specific calculation process is as follows: Figure 2 Since point B is the projection of point A on the circular surface, the coordinates of point B on the XY coordinate axis are the same as those of point A, both (x, y). Let the coordinates of point B on the Z axis be z. Since point B is a point on the circular surface, R 2 =x 2 +y 2 +z 2 , you can get And BD=z, and but The second polar coordinate is

[0075] It can be understood that the above-mentioned calculation method of the second polar coordinates is only an example and does not constitute a limitation of the present disclosure. In fact, other offsets can be added to the pixel points. For example, in addition to the radial offset, a radial offset can also be added. In this case, it is only necessary to define a radial offset angle or a calculation function of the radial offset angle. By adding the offset angle on the basis of α, the second polar coordinates can be calculated. In actual use, the offset in any direction and the calculation function of the offset can be defined as needed to form various processing effects, which will not be repeated here.

[0076] Step S105: generating a processed image according to the second polar coordinates.

[0077] In one embodiment, the processing image is generated according to the second polar coordinates, including: assigning the first attribute value of the pixel to the pixel at the position of the second polar coordinates to generate the processed image. In this embodiment, the first attribute value of the pixel on the image to be processed is directly obtained, and the first attribute value can typically be the value of the three-channel color component in the RGB color space, and the color value is assigned to the pixel at the position of the second polar coordinates to generate the processed image. In one embodiment, there may be no pixel or multiple pixels covered at the position of the second polar coordinates. For example, in a 1280*720 image, the number of pixels is 1280*720, and the coordinates are also so many, but the calculated coordinates are not necessarily exactly at the position of the pixel. At this time, the pixel closest to the second polar coordinates can be calculated, and the position of the pixel is used as the assignment object of the color value. It can be understood that the above-mentioned first attribute value can also be other attributes. Optionally, the attribute can be a pixel attribute such as brightness, saturation, hue, etc., which will not be repeated here.

[0078] In one embodiment, assigning the first attribute value of the pixel point to the pixel point at the position of the second polar coordinate to generate a processed image includes: converting the second polar coordinate to a second UV coordinate, assigning the first attribute value of the pixel point to the pixel point at the position of the second UV coordinate to generate a processed image. In this embodiment, converting the second polar coordinate to a second UV coordinate may include: converting the second coordinate to a second Cartesian coordinate; normalizing the second Cartesian coordinate to convert it into the second UV coordinate. Generally, it is necessary to render a texture map through a UV map, so after obtaining the second polar coordinate, the second polar coordinate can be converted to a UV coordinate. The conversion method is opposite to the above-mentioned method of converting UV coordinates to polar coordinates. Cartesian coordinates are first calculated through polar coordinates, and then Cartesian coordinates are converted to UV coordinates to obtain a UV image after the original UV image is processed. At this time, the processed UV image is directly used to render the processed texture image to obtain the processed image.

[0079] In one embodiment, the above-mentioned assignment process can also be deformed to form more effects. Optionally, the color value of the pixel point of the first polar coordinate is mixed with the color value of the template image in a certain ratio to obtain a deformation mixing effect. Typically, the pixel point of the first polar coordinate is mixed with the color card image in a ratio of 1:1, and the mixed color is assigned to the pixel point at the position of the second polar coordinate. This is equivalent to adding a layer of filter to the deformed image, which can obtain a better image processing effect.

[0080] The present disclosure discloses an image processing method, device, electronic device and computer-readable storage medium. The image processing method comprises: obtaining an image to be processed; obtaining the first polar coordinates of the pixel points of the image to be processed; obtaining mapping parameters; calculating the second polar coordinates of the pixel points according to the first polar coordinates and the mapping parameters; and generating a processed image according to the second polar coordinates. The embodiment of the present disclosure calculates the positions of the pixel points of the deformed image through the polar coordinates and mapping parameters of the original image, thereby solving the technical problem of complex implementation of nonlinear deformation in the prior art.

[0081] In the above, although the various steps in the above method embodiment are described in the above order, those skilled in the art should be aware that the steps in the embodiments of the present disclosure are not necessarily executed in the above order, and they may also be executed in other orders such as reverse order, parallel order, and cross order. Moreover, on the basis of the above steps, those skilled in the art may also add other steps. These obvious variations or equivalent replacement methods should also be included in the protection scope of the present disclosure and will not be repeated here.

[0082] Figure 4 A schematic diagram of the structure of an image processing device embodiment provided by the present disclosure, such as Figure 4 As shown, the device 400 includes: an image acquisition module 401, a first coordinate acquisition module 402, a mapping parameter acquisition module 403, a second coordinate calculation module 404 and an image processing module 405.

[0083] An image acquisition module 401 is used to acquire an image to be processed;

[0084] A first coordinate acquisition module 402, used to acquire the first polar coordinates of the pixel point of the image to be processed;

[0085] A mapping parameter acquisition module 403 is used to acquire mapping parameters;

[0086] A second coordinate calculation module 404, used to calculate the second polar coordinates of the pixel point according to the first polar coordinates and mapping parameters;

[0087] The image processing module 405 is configured to generate a processed image according to the second polar coordinates.

[0088] Furthermore, the image acquisition module 401 is also used to: acquire a current image frame of the video as an image to be processed.

[0089] Furthermore, the first coordinate acquisition module 402 further includes:

[0090] A first UV coordinate acquisition module, used to acquire the first UV coordinate of the pixel point;

[0091] A first conversion module, used for converting the first UV coordinate into a first Cartesian coordinate;

[0092] The second conversion module is used to convert the first Cartesian coordinates into first polar coordinates.

[0093] Furthermore, the mapping parameter acquisition module 403 further includes:

[0094] Type acquisition module, used to obtain the mapping type;

[0095] The mapping parameter acquisition submodule is used to obtain the mapping parameters corresponding to the mapping type.

[0096] Furthermore, the mapping type is isometric mapping, and the mapping parameters are focal length and incident angle.

[0097] Furthermore, the second coordinate calculation module 404 further includes:

[0098] An offset calculation module, used to calculate the offset of the pixel point according to the mapping parameters;

[0099] The second coordinate calculation submodule is used to calculate the second polar coordinates of the pixel point according to the offset and the first polar coordinates.

[0100] Furthermore, the offset calculation module includes:

[0101] A mapping function acquisition module is used to acquire a mapping function;

[0102] The offset calculation submodule is used to bring the mapping parameters into a mapping function to calculate the offset of the pixel point.

[0103] Furthermore, the image processing module 405 further includes:

[0104] An assignment module is used to assign the first attribute value of the pixel point to the pixel point at the position of the second polar coordinate to generate a processed image.

[0105] Furthermore, the assignment module further includes:

[0106] A third coordinate conversion module, used for converting the second polar coordinate into a second UV coordinate;

[0107] The assignment submodule is used to assign the first attribute value of the pixel point to the pixel point at the position of the second UV coordinate to generate a processed image.

[0108] Furthermore, the third coordinate conversion module further includes:

[0109] a fourth coordinate conversion module, used for converting the second coordinate into a second Cartesian coordinate;

[0110] The fifth coordinate conversion module is used to normalize the second Cartesian coordinate and convert it into a second UV coordinate.

[0111] Furthermore, the first coordinate acquisition module 402 is further used for:

[0112] Obtain the first polar coordinates of any pixel point of the image to be processed.

[0113] Figure 4 The device shown can perform Figure 1 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 1 The implementation process and technical effects of this technical solution refer to Figure 1 The description in the illustrated embodiment will not be repeated here.

[0114] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0115] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0116] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0117] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0118] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0119] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0120] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains at least two Internet Protocol addresses; sends a node evaluation request including the at least two Internet Protocol addresses to a node evaluation device, wherein the node evaluation device selects an Internet Protocol address from the at least two Internet Protocol addresses and returns it; receives the Internet Protocol address returned by the node evaluation device; wherein the obtained Internet Protocol address indicates an edge node in a content distribution network.

[0121] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: receives a node evaluation request including at least two Internet Protocol addresses; selects an Internet Protocol address from the at least two Internet Protocol addresses; and returns the selected Internet Protocol address; wherein the received Internet Protocol address indicates an edge node in a content distribution network.

[0122] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0123] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0124] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0125] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

Claims

1. An image processing method, characterized in that: include: Get the image to be processed; Obtaining the first polar coordinates of the pixel points of the image to be processed; Acquire mapping parameters; wherein the mapping parameters are focal length and incident angle of isometric mapping; Calculating the offset of the pixel point according to the first polar coordinates, and calculating the second polar coordinates of the pixel point according to the offset and mapping parameters; generating a processed image according to the second polar coordinates; The step of generating a processed image according to the second polar coordinates includes: Assigning the first attribute value of the pixel point to the pixel point at the position of the second polar coordinate to generate a processed image; wherein, when the position of the second polar coordinate does not correspond to a pixel point, the pixel point closest to the position of the second polar coordinate is used as the assignment object of the first attribute value; The step of assigning the first attribute value of the pixel point to the pixel point at the position of the second polar coordinate specifically includes: The color value of the pixel point is mixed with the color value of the template image, and the mixed color value is assigned to the pixel point at the position of the second polar coordinate; the first attribute value includes the color value.

2. The image processing method according to claim 1, characterized in that: The step of obtaining the image to be processed comprises: Get the current image frame of the video as the image to be processed.

3. The image processing method according to claim 1, characterized in that: The step of obtaining the first polar coordinates of the pixel points of the image to be processed includes: Obtaining the first UV coordinate of the pixel point; Converting the first UV coordinate to a first Cartesian coordinate; The first Cartesian coordinate is converted to a first polar coordinate.

4. The image processing method according to claim 1, wherein: The obtaining of mapping parameters includes: Get the type of mapping; Get the mapping parameters corresponding to the mapping type.

5. The image processing method according to claim 4, characterized in that: The type of mapping is isometric mapping.

6. The image processing method according to claim 1, characterized in that: The calculating the offset of the pixel point according to the mapping parameter comprises: Get the mapping function; The mapping parameters are brought into a mapping function to calculate the offset of the pixel point.

7. The image processing method according to claim 1, characterized in that: The step of assigning the first attribute value of the pixel point to the pixel point at the position of the second polar coordinate to generate a processed image includes: Convert the second polar coordinates into second UV coordinates; The first attribute value of the pixel point is assigned to the pixel point at the position of the second UV coordinate to generate a processed image.

8. The image processing method according to claim 7, characterized in that: The converting the second polar coordinates into second UV coordinates comprises: converting the second coordinate to a second Cartesian coordinate; Normalize the second Cartesian coordinate to the second UV coordinate.

9. The image processing method according to claim 1, characterized in that: The step of obtaining the first polar coordinates of the pixel points of the image to be processed includes: Obtain the first polar coordinates of any pixel point of the image to be processed.

10. An image processing device, characterized in that: include: An image acquisition module, used for acquiring an image to be processed; A first coordinate acquisition module, used to acquire the first polar coordinates of the pixel point of the image to be processed; A mapping parameter acquisition module, used to acquire mapping parameters; wherein the mapping parameters are the focal length and incident angle of isometric mapping; A second coordinate calculation module, used to calculate the offset of the pixel point according to the first polar coordinate, and calculate the second polar coordinate of the pixel point according to the offset and a mapping parameter; An image processing module, used for generating a processed image according to the second polar coordinates; Wherein, the image processing module also includes: an assignment module, configured to assign the first attribute value of the pixel point to the pixel point at the position of the second polar coordinate to generate a processed image; wherein, when the position of the second polar coordinate does not correspond to a pixel point, the pixel point closest to the position of the second polar coordinate is used as an assignment object of the first attribute value; Wherein, the assignment module is specifically used for: The color value of the pixel point is mixed with the color value of the template image, and the mixed color value is assigned to the pixel point at the position of the second polar coordinate; the first attribute value includes the color value.

11. An electronic device, comprising: a memory for storing non-transitory computer-readable instructions; as well as A processor is used to run the computer-readable instructions so that the processor implements the image processing method according to any one of claims 1 to 9 when executing.

12. A computer-readable storage medium for storing non-transitory computer-readable instructions, which, when executed by a computer, causes the computer to execute the image processing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Processing method of projector spherical display output image

    CN103035015A

  • Image deformation method and apparatus, and electronic equipment

    CN108830787A