CN113763229A - Image processing method, image processing device, electronic equipment and storage medium - Google Patents

Image processing method, image processing device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113763229A
CN113763229A CN202010486694.XA CN202010486694A CN113763229A CN 113763229 A CN113763229 A CN 113763229A CN 202010486694 A CN202010486694 A CN 202010486694A CN 113763229 A CN113763229 A CN 113763229A
Authority
CN
China
Prior art keywords
pixel point
kaleidoscope
coordinates
image
coordinate
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.)
Pending
Application number
CN202010486694.XA
Other languages
Chinese (zh)
Inventor
杨太保
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010486694.XA priority Critical patent/CN113763229A/en
Publication of CN113763229A publication Critical patent/CN113763229A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T3/18

Abstract

The application provides an image processing method, an image processing device, an electronic device and a storage medium, wherein the method comprises the following steps: extracting coordinates of a first pixel point of an image to be processed; determining the coordinates of a second pixel point corresponding to the coordinates of the first pixel point through a preset kaleidoscope function, and arranging the second pixel point according to the coordinates of the second pixel point to form a kaleidoscope effect corresponding to the kaleidoscope function; and constructing to obtain the kaleidoscope image comprising the second pixel point according to the coordinates of the second pixel point. In the method, the kaleidoscope effect realized based on the image to be processed can be obtained, so that the kaleidoscope effect can be directly applied to pictures and video frames, the application scene of the kaleidoscope effect is improved, in addition, the coordinate of the first pixel point is directly extracted from the image to be processed, and the coordinate of the first pixel point contains the characteristic of the image to be processed, so that the richness of the kaleidoscope effect is improved, and the utilization value of the kaleidoscope effect is enhanced.

Description

Image processing method, image processing device, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of image processing, in particular to an image processing method and device, an electronic device and a storage medium.
Background
With the performance of mobile equipment becoming higher and higher, the powerful computing power of removal can be utilized, the whole screen is covered with single pattern according to certain law to produce a kaleidoscope effect, make originally boring picture or video more and more interesting.
In the related technology, the kaleidoscope effect is generated by adopting a vector graph, which is a conventional technical means, specifically, related vector graph parameters are defined, an open source algorithm is utilized to generate a kaleidoscope effect map, and the kaleidoscope effect map can be further added into a picture or a video frame to increase the kaleidoscope effect on the picture or the video frame.
However, in the conventional scheme, only a kaleidoscope effect including a simple vector pattern can be generated, and the effect is monotonous and the utility value is low. In addition, the kaleidoscope effect is further covered on the picture or the video frame after being generated, and cannot be directly generated by the content contained in the picture or the video frame, so that the application scene of the kaleidoscope effect is greatly limited.
Disclosure of Invention
The embodiment of the application provides an image processing method, an image processing device, electronic equipment and a storage medium, and aims to solve the problems of monotonous effect, low utilization value and limited application scene of a kaleidoscope in the related art.
In a first aspect, an embodiment of the present application provides an image processing method, including:
extracting coordinates of a first pixel point of an image to be processed;
determining the coordinates of a second pixel point corresponding to the coordinates of the first pixel point through a preset kaleidoscope function, wherein the kaleidoscope function is used for mapping the coordinates of the first pixel point into the coordinates of the second pixel point, and when the second pixel point is arranged according to the coordinates of the second pixel point, a kaleidoscope effect corresponding to the kaleidoscope function is formed;
and constructing to obtain a kaleidoscope image comprising the second pixel point according to the coordinates of the second pixel point.
In an optional implementation manner, the determining, by a preset kaleidoscope function, coordinates of a second pixel point corresponding to the coordinates of the first pixel point, where the kaleidoscope function is a periodic function, includes:
subtracting a difference value obtained by subtracting a preset central coordinate in the image to be processed from the coordinate of the first pixel point to serve as a direction vector;
determining a second element corresponding to a first element in the direction vector according to the periodic function and a preset mapping direction, wherein the mapping direction comprises the direction of any coordinate axis in a coordinate system where the periodic function is located, and the origin coordinate of the coordinate system where the periodic function is located is the central coordinate;
and replacing the corresponding first element in the direction vector by the second element, and taking the replaced direction vector as the coordinate of the second pixel point.
In an optional embodiment, the determining, by the periodic function and a preset mapping direction, a second element corresponding to a first element in the direction vector, where the direction vector is in a euclidean space coordinate system, includes:
mapping the direction vector to a target space coordinate system, and determining a target direction vector corresponding to the direction vector;
and determining a second element corresponding to the first element in the target direction vector through the periodic function and the mapping direction.
In an optional implementation manner, the constructing a kaleidoscope image including the second pixel point according to the coordinates of the second pixel point includes:
mapping the second pixel point to the Euclidean space coordinate system according to the coordinate of the second pixel point, and determining a third pixel point corresponding to the second pixel point;
determining the color value of the second pixel point as the sum of the color value of the third pixel point and the color value of the pixel point corresponding to the center coordinate;
and constructing and obtaining the kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
In an optional implementation manner, the determining, by a preset kaleidoscope function, coordinates of a second pixel point corresponding to the coordinates of the first pixel point by using a kaleidoscope function is a pseudo-random number generation function, and includes:
inputting the coordinates of the first pixel point into the pseudo random number generation function to obtain a plurality of pseudo random numbers, wherein the pseudo random numbers meet the requirement of uniform distribution;
constructing the pseudo random numbers into coordinates of the second pixel points, wherein the number of the second pixel points is equal to that of the first pixel points;
and establishing a corresponding relation between the second pixel point and the first pixel point.
In an optional implementation manner, the constructing a kaleidoscope image including the second pixel point according to the coordinates of the second pixel point includes:
determining the color value of the first pixel point as the color value of a second pixel point corresponding to the first pixel point according to the corresponding relation;
and constructing and obtaining the kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
In a second aspect, an embodiment of the present application provides an image processing apparatus, including:
the acquisition module is configured to extract coordinates of a first pixel point of the image to be processed;
the mapping module is configured to determine coordinates of a second pixel point corresponding to the coordinates of the first pixel point through a preset kaleidoscope function, wherein the kaleidoscope function is used for mapping the coordinates of the first pixel point to the coordinates of the second pixel point, and when the second pixel point is arranged according to the coordinates of the second pixel point, a kaleidoscope effect corresponding to the kaleidoscope function is formed;
and the display module is configured to construct and obtain a kaleidoscope image comprising the second pixel point according to the coordinates of the second pixel point.
In an alternative embodiment, the kaleidoscope function is a periodic function, and the mapping module comprises:
the difference value calculation submodule is configured to take a difference value obtained by subtracting a preset central coordinate in the image to be processed from the coordinate of the first pixel point as a direction vector;
the periodic function submodule is configured to determine a second element corresponding to a first element in the direction vector through the periodic function and a preset mapping direction, the mapping direction includes the direction of any coordinate axis in a coordinate system where the periodic function is located, and the origin coordinate of the coordinate system where the periodic function is located is the center coordinate;
and the replacing submodule is configured to replace the corresponding first element in the direction vector with the second element and take the replaced direction vector as the coordinate of the second pixel point.
In an alternative embodiment, the direction vector is in a euclidean space coordinate system, and the periodic function sub-module includes:
the space mapping unit is configured to map the direction vectors to a target space coordinate system, and determine target direction vectors corresponding to the direction vectors;
and the periodic function unit is configured to determine a second element corresponding to the first element in the target direction vector through the periodic function and the mapping direction.
In an alternative embodiment, the display module includes:
the space mapping submodule is configured to map the second pixel point to a Euclidean space coordinate system according to the coordinate of the second pixel point, and determine a third pixel point corresponding to the second pixel point;
the adding submodule is configured to determine the color value of the second pixel point as the addition result of the color value of the third pixel point and the color value of the pixel point corresponding to the center coordinate;
and the first display submodule is configured to construct and obtain a kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
In an alternative embodiment, the kaleidoscope function is a pseudo random number generation function, and the mapping module comprises:
the generation submodule is configured to input the coordinates of the first pixel point into the pseudo-random number generation function to obtain a plurality of pseudo-random numbers, and the pseudo-random numbers meet uniform distribution;
the construction submodule is configured to construct the pseudo random numbers into coordinates of the second pixel points, and the number of the second pixel points is equal to that of the first pixel points;
and the establishing submodule is configured to establish a corresponding relation between the second pixel point and the first pixel point.
In an alternative embodiment, the display module includes:
the determining submodule is configured to determine the color value of the first pixel point as the color value of a second pixel point corresponding to the first pixel point according to the corresponding relation;
and the second display submodule is configured to construct and obtain a kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
In a third aspect, an embodiment of the present application further provides an electronic device, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, and when executed by the processor, the computer program implements the steps of the image processing method provided in the first aspect of the present application.
In a fourth aspect, embodiments of the present application further provide a storage medium, where instructions that are executed by a processor of an electronic device enable the electronic device to perform the steps of the image processing method as provided in the first aspect of the present application.
In a fifth aspect, embodiments of the present application further provide an application program, where the application program, when executed by a processor of an electronic device, implements the steps of the image processing method as provided in the first aspect of the present application.
In the embodiment of the application, because the coordinates of the first pixel point are directly acquired from the image to be processed, therefore, the coordinate of the second pixel point corresponding to the first pixel point is obtained through the kaleidoscope function, thereby constructing and obtaining the kaleidoscope image comprising the second pixel points, the kaleidoscope image can be directly realized based on the image to be processed, so that the kaleidoscope effect can be directly applied to pictures and video frames, the application scene of the kaleidoscope effect is improved, and in addition, because the coordinates of the first pixel point are directly extracted from the image to be processed, the coordinates of the first pixel point contain the characteristics of the image to be processed, and further, based on the processing of the kaleidoscope function, can generate a kaleidoscope image containing the own features of the image to be processed, therefore, the richness of the kaleidoscope images is improved, and the utilization value of the kaleidoscope images is enhanced.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating steps of an image processing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a periodic function provided in an embodiment of the present application;
FIG. 3 is a diagram of an image to be processed according to an embodiment of the present disclosure;
FIG. 4 is a kaleidoscope effect display provided by the present application;
FIG. 5 is a flowchart illustrating steps of another image processing method according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a polar coordinate space coordinate system provided by an embodiment of the present application;
FIG. 7 is a view of another kaleidoscope for displaying effects provided by an embodiment of the present application;
FIG. 8 is a flowchart illustrating an image processing method according to an embodiment of the present disclosure;
FIG. 9 is a flowchart illustrating steps of another image processing method according to an embodiment of the present disclosure;
fig. 10 is a block diagram of an image processing apparatus according to an embodiment of the present application;
FIG. 11 is a logical block diagram of an electronic device of one embodiment of the present application;
fig. 12 is a logic block diagram of an electronic device of another embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a flowchart of steps of an image processing method provided in an embodiment of the present application, and as shown in fig. 1, the method may include:
step 101, extracting coordinates of a first pixel point of an image to be processed.
In the embodiment of the application, the image to be processed may be an image stored in a database, a network, and an album, may also be an image captured by an electronic device through a camera, and may also be a frame of video frame in a video.
Further, the first pixel point may include all pixel points of the image to be processed, and in addition, the first pixel point may only include all pixel points of a preset region in the image to be processed.
And 102, determining the coordinate of a second pixel point corresponding to the coordinate of the first pixel point through a preset kaleidoscope function.
The kaleidoscope function is used for mapping the coordinates of the first pixel points to the coordinates of the second pixel points, and when the second pixel points are arranged according to the coordinates of the second pixel points, a kaleidoscope effect corresponding to the kaleidoscope function is formed.
103, constructing to obtain a kaleidoscope image comprising the second pixel point according to the coordinate of the second pixel point.
In this embodiment of the present application, the kaleidoscope functions may include a periodic function, a quasi-periodic function, a pseudo-random number generation function, and the like, where the kaleidoscope functions are configured to take coordinates of a first pixel point as input, take coordinates of a second pixel point corresponding to the coordinates of the first pixel point as output, and each kaleidoscope function may correspond to a kaleidoscope effect, where the kaleidoscope effect is a display effect formed when the second pixel points are arranged according to the coordinates of the second pixel point. In one particular implementation, when the image of the function has two symmetries, i.e. two centers of symmetry on the x-axis, or two symmetry axes perpendicular to the x-axis, or a center of symmetry in the x-axis and a symmetry axis perpendicular to the x-axis, then the function is a periodic function, and further, the symmetrical relation is just like a reflection relation, and the two times of symmetry can be repeated, like a kaleidoscope, and actually only one flower is in the original picture, but after the original picture is symmetrically repeated, a plurality of flowers can be displayed in the picture of the kaleidoscope, therefore, by utilizing functions with relevant symmetrical and repeated relations such as periodic functions, the coordinates of the first pixel point can be used as input, and the repetition and symmetry rules of the periodic function within a certain time and a certain range are utilized, and continuously mapping the first pixel points on the function coordinates, and calculating to obtain the coordinates of the second pixel points mapped by each first pixel point. According to the symmetric relation and the reflection relation of the kaleidoscope function, the kaleidoscope image constructed according to the coordinates of the second pixel point has periodic repeatability and symmetry around a certain coordinate axis after being displayed, and a kaleidoscope effect is formed.
In addition, different kaleidoscope functions can have different repetition and symmetry rules, so that kaleidoscope images obtained after being processed by different kaleidoscope functions can have different kaleidoscope effects. Therefore, in the embodiment of the present application, the electronic device may preset a plurality of different kaleidoscope functions, and select a corresponding target kaleidoscope function to map the coordinates of the first pixel point of the image to be processed according to the requirement of the user, so as to determine the coordinates of the corresponding second pixel point. In addition, the kaleidoscope effect map is not required to be generated independently, and the kaleidoscope effect map is not required to be covered on the image to be processed, but the kaleidoscope effect with the characteristics of the image to be processed is generated directly on the basis of the image to be processed, so that the complexity of operation is reduced, the kaleidoscope effect that the original single picture or video frame is paved on the whole screen according to a certain rule can be realized, and the interestingness of videos and pictures is improved.
For example, assume that the kaleidoscope function is a periodic function: and f (x) is P (x/P- [ x/P + 0.5), the periodic function image is shown in fig. 2, the image to be processed is shown in fig. 3, the coordinates of the pixel points in the pattern included in the image to be processed shown in fig. 3 are taken as the coordinates of the first pixel points, and after the periodic function processing and displaying, four kaleidoscope images shown in fig. 4 can be obtained.
The effect A is in an unfolded shape, and the mapping direction is specifically that the coordinates of the first pixel point are symmetrical and repeated only in the X-axis direction; the effect B is wheel-shaped, and the mapping direction is specifically that the coordinates of the first pixel point are exchanged in the X axis and the Y axis, and then the first period is used for carrying out symmetry and repetition in the X axis and the Y axis directions; the effect C is in a fish head shape, and the mapping direction is specifically that the coordinates of the first pixel point are exchanged in the X axis and the Y axis, and then the symmetry and the repetition are carried out in the X axis and the Y axis directions in a second period; the effect D is in a can shape, and the mapping direction is specifically to carry out symmetry and repetition on the coordinates of the first pixel point in the X-axis direction and the Y-axis direction. The first period and the second period are different periods.
In summary, in the embodiment of the present application, since the coordinates of the first pixel point are directly acquired from the image to be processed, therefore, the coordinate of the second pixel point corresponding to the first pixel point is obtained through the kaleidoscope function, thereby constructing and obtaining the kaleidoscope image comprising the second pixel points, the kaleidoscope image can be directly realized based on the image to be processed, so that the kaleidoscope effect can be directly applied to pictures and video frames, the application scene of the kaleidoscope effect is improved, and in addition, because the coordinates of the first pixel point are directly extracted from the image to be processed, the coordinates of the first pixel point contain the characteristics of the image to be processed, and further, based on the processing of the kaleidoscope function, can generate a kaleidoscope image containing the own features of the image to be processed, therefore, the richness of the kaleidoscope images is improved, and the utilization value of the kaleidoscope images is enhanced.
Fig. 5 is a flowchart of steps of another image processing method provided in an embodiment of the present application, and as shown in fig. 5, the method may include:
step 201, extracting coordinates of a first pixel point of the image to be processed.
The implementation manner of this step is similar to the implementation process of step 101 described above, and this embodiment of the present application is not described in detail here.
Step 202, a difference value obtained by subtracting a preset central coordinate in the image to be processed from the coordinate of the first pixel point is used as a direction vector.
In this embodiment of the present application, a center coordinate may be selected and determined by a user according to actual requirements, the center coordinate is a symmetric point of a symmetric relation for realizing a kaleidoscope effect, specifically, an origin coordinate of a coordinate system where a periodic function is located may be set as the center coordinate, after the center coordinate is determined, a difference obtained by subtracting the center coordinate from a coordinate of a first pixel point may be used as a direction vector, the direction vector (direction vector) is a mathematical concept, a direction of a spatial straight line is represented by a non-zero vector parallel to the straight line, and the vector is referred to as a direction vector of the straight line. In the process of mapping the coordinate of the first pixel point to the coordinate of the second pixel point through the kaleidoscope function, the coordinate of the first pixel point needs to be processed in a coordinate system of the kaleidoscope function, and further, because the symmetric relation of the kaleidoscope function has directionality, such as symmetry along an X axis of the coordinate system, symmetry along a Y axis of the coordinate system, and the like, a difference value between the first pixel point and the center coordinate needs to be taken as a direction vector in the coordinate system, so that the kaleidoscope function calculates the direction vector, and the purpose that the kaleidoscope function maps the direction vector to the coordinate of the second pixel point according to the mapping direction is achieved.
For example, for the example provided in fig. 3 and 4 in step 103 described above in the embodiment of the present application, in the process of processing and displaying the image to be processed shown in fig. 3 through the kaleidoscope function to obtain four kinds of kaleidoscope images shown in fig. 4, the coordinates of the first pixel point may be the coordinates of all pixel points in the image to be processed, and the center coordinate may be the coordinate of the intersection point 10 in the pattern shown in the image to be processed in fig. 3.
And 203, determining a second element corresponding to the first element in the direction vector through the periodic function and a preset mapping direction.
In the embodiment of the application, by using a function having a relevant symmetry and repetition relation, such as a periodic function, the coordinate of the first pixel point can be used as input, and by using a rule that the periodic function repeats and is symmetrical within a certain time and a certain range, the first pixel point is continuously mapped in the function coordinate in a preset mapping direction, and the coordinate of the second pixel point mapped by each first pixel point is obtained by calculation. According to the symmetric relation and the reflection relation of the kaleidoscope function, the second pixel point has periodic repeatability and symmetry around a certain coordinate axis after being displayed, and a kaleidoscope effect is formed.
In particular, the direction vector has one or more first elements therein, e.g., the direction vector
Figure BDA0002519484090000091
In the direction vector
Figure BDA0002519484090000092
In the embodiment of the application, one or more first elements can be selected according to actual requirements, and the selected first elements are used as the input of the periodic function, so that a second element obtained after the first element output by the periodic function is mapped can be obtained.
For example, if the mapping direction is symmetric and repeated according to the X-axis of the periodic function, the first element a may be used as the input of the periodic function; if the mapping direction is symmetrical and repeated according to the Y axis of the periodic function, the first element b can be used as the input of the periodic function; if the mapping directions are symmetrical and repeated according to the X-axis and the Y-axis of the periodic function at the same time, the first element a and the second element b may be used as the input of the periodic function, respectively.
Optionally, the direction vector is in a euclidean space coordinate system, and step 203 may specifically include:
substep 2031, mapping the direction vector to a target space coordinate system, and determining a target direction vector corresponding to the direction vector.
Substep 2032, determining a second element corresponding to the first element in the target direction vector according to the periodic function and a preset mapping direction.
In the embodiment of the present application, the spatial coordinate system includes all types of coordinate systems, such as a two-dimensional or three-dimensional coordinate system, the two-dimensional coordinate system may include a euclidian space coordinate system and a polar coordinate system, the coordinate system where the periodic function is located may be any one of the euclidian space coordinate system and the polar coordinate system, and in addition, the coordinate system where the periodic function is located may also be other two-dimensional coordinate systems or three-dimensional coordinate systems, under other requirements.
The coordinates of the first pixel point of the image to be processed all exist in an euclidean space coordinate system, which is a general term for a rectangular coordinate system and an oblique coordinate system, and may also be understood as a linear space with n mutually perpendicular unit vectors (i.e., orthogonal matrices) as a base vector. In the embodiment of the application, the image to be processed is displayed on the screen, and each display unit on the screen is constructed by the euclidean space coordinate system, that is, the coordinates of any first pixel point in the image to be processed can be found through the euclidean space coordinate system of the screen, so that the direction vector obtained according to the coordinates and the center coordinates of the first pixel point can be obtained, and the direction vector is initially located in the euclidean space coordinate system.
In some application scenarios, there is a higher demand for the display complexity and effect of the kaleidoscope effect, and at this time, the demand cannot be satisfied only by the euclidean space coordinate system having two coordinate axes, so that the direction vector needs to be mapped to the target space coordinate system, and the target direction vector corresponding to the direction vector after mapping is determined.
The target space coordinate system may comprise a polar coordinate space coordinate system, which belongs to a two-dimensional coordinate system, and the originator is newton, which is mainly applied in the field of mathematics. Referring to fig. 6, polar coordinates refer to a fixed point O, called pole, in a plane, a ray Ox, called polar axis, and a length unit and a positive direction of an angle (usually, a counterclockwise direction) are selected. For any point M in the plane, the length of a line segment OM is represented by rho, the angle from Ox to OM is represented by theta, rho is called the polar diameter of the point M, theta is called the polar angle of the point M, and the ordered number pair (rho, theta) is called the polar coordinate of the point M, so that the established coordinate system is called a polar coordinate system. In general, M has a polar radius coordinate of 1 (length unit) and a polar angle coordinate of rad (or °).
Specifically, referring to fig. 4, the kaleidoscope effect is realized in the euclidean space coordinate system, and the mapping direction can only realize the repeated and symmetrical relationship in the horizontal direction (X-axis direction) and the vertical horizontal direction (Y-axis direction), so that the kaleidoscope effect that can be displayed is monotonous. And the polar coordinate space coordinate system introduces radian units, so the mapping direction can comprise the polar coordinate directions of a plurality of points taking a polar axis as a reference, and vectors in the polar coordinate space coordinate system can comprise more elements with the number larger than 2, so that lines with other shapes except a straight line, such as spiral lines, conical curves and the like, can be accurately represented, and when the polar coordinate space coordinate system is used for processing a kaleidoscope function, richer and more complex kaleidoscope effects can be generated, so that higher requirements on the display complexity and effects of the kaleidoscope effects can be met.
For example, with the image to be processed shown in fig. 3, taking the coordinate of the intersection point 10 in the pattern shown in the image to be processed in fig. 3 as the central coordinate, after obtaining the corresponding direction vector, the direction vector may be mapped to a polar coordinate space coordinate system, a target direction vector corresponding to the direction vector after mapping is determined, and after obtaining the target direction vector, a second element corresponding to a first element in the target direction vector may be determined through the periodic function and the preset mapping direction, so that the purpose of mapping the first element to the second element through the periodic function and the preset mapping direction in the polar coordinate space coordinate system is achieved.
It should be noted that, in the process of generating the kaleidoscope effect through each periodic function, the intermediate parameters of the periodic function calculation process may be stored, and when the periodic function is used for generating the kaleidoscope effect next time, the intermediate parameters of the periodic function are extracted, and the coordinates of the second pixel points after the first pixel points are mapped are obtained directly according to the coordinates of the first pixel points of the image to be processed, the intermediate parameters of the periodic function and the periodic function, and the kaleidoscope image including the second pixel points is constructed according to the coordinates of the second pixel points.
And 204, replacing the corresponding first element in the direction vector with the second element, and taking the replaced direction vector as the coordinate of the second pixel point.
Further, after the second element replaces the corresponding first element in the direction vector, the replaced direction vector may be used as the coordinate of the second pixel point.
E.g. direction vector
Figure BDA0002519484090000121
And (3) carrying out symmetry and repetition according to an X axis of the periodic function, wherein the first element a can be used as the input of the periodic function to obtain a second element a ', and the coordinates of the second pixel point can be (a', b).
Further, in some application scenarios, the display complexity and effect of the kaleidoscope effect are required to be higher, in the embodiment of the present application, iteration processing may be performed by using a plurality of kaleidoscope functions through a remapping method, so as to achieve a more complex and higher kaleidoscope effect, specifically, after obtaining the coordinates of the second pixel point, an operation of mapping the coordinates of the second pixel point to a target space coordinate system may be performed, after the operation of mapping to the target space coordinate system is performed, the coordinates of the second pixel point are input into the kaleidoscope function, so as to achieve another iteration processing operation, and if there is a next iteration processing operation after the another iteration processing operation, a result of the another iteration processing operation may be used as an input of the next iteration processing operation until all iterations are completed.
It should be noted that the operation of mapping the coordinates of the second pixel point to the target space coordinate system may be performed or not, and the determination may be performed according to the actual needs of the user. In addition, the kaleidoscope functions used in each iteration processing operation may be different from each other or the same as each other, and this is not limited in this embodiment of the present application.
For example, assuming that the image to be processed is as shown in fig. 3, the coordinates of the pixel points in the pattern included in the image to be processed shown in fig. 3 are taken as the coordinates of the first pixel point, the coordinates of the intersection point 10 in fig. 3 are taken as the center coordinates, the direction vector in the corresponding euclidean space coordinate is calculated, if two iteration operations are performed and the direction vector is mapped to the polar coordinate space coordinate system in each iteration operation, the period function used in the first iteration operation is f (x) ═ P (x/P- [ x/P +0.5]), and the period function different from the period function used in the first iteration operation is used in the second iteration operation, then 5 types of kaleidoscope images shown in fig. 7 can be obtained after the first iteration operation is performed twice: effect E, effect F, effect G, effect H, and effect I, wherein in the 5 kaleidoscope image generation processes, the periodic functions used in the second iteration processing operation are different from each other.
And step 205, constructing to obtain a kaleidoscope image comprising the second pixel point according to the coordinate of the second pixel point.
The implementation manner of this step is similar to the implementation process of step 103 described above, and this embodiment of the present application is not described in detail here.
Optionally, in the case that sub-step 2031 is performed, step 205 may specifically include:
and a substep 2051 of mapping the second pixel point to a euclidean space coordinate system according to the coordinate of the second pixel point, and determining a third pixel point corresponding to the second pixel point.
In this embodiment of the application, since the direction vector is mapped to the target spatial coordinate system from the euclidian space coordinate system in the sub-step 2031, and the second pixel point finally needs to be displayed on the screen of the electronic device (i.e., displayed on the euclidian space coordinate system), when determining the color value of the second pixel point, the second pixel point needs to be implemented in the euclidian space coordinate system.
And a substep 2052, determining the color value of the second pixel point as the sum of the color value of the third pixel point and the color value of the pixel point corresponding to the center coordinate.
And a substep 2053 of constructing and obtaining a kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
In this application embodiment, before showing second pixel, need confirm coordinate value and colour value of second pixel, the colour value of second pixel can be for the second pixel map to the sum result of the colour value of the third pixel that obtains in the euclidean space coordinate system and the colour value of the pixel that central coordinate corresponds, show second pixel through regarding this sum result as the colour value, can make kaleidoscope effect can keep the colour uniformity of pending image.
In the embodiment of the present application, referring to fig. 8, a complete flowchart of an image processing method provided in the embodiment of the present application is shown, including:
s1, obtaining the current pixel coordinate p (x, y), and subtracting the center coordinate c (x, y) to obtain the vector d (x, y).
The current pixel coordinate p (x, y) is the coordinate of the first pixel point, and the obtained vector d (x, y) is the direction vector existing in the euclidean space coordinate system.
S2, determine whether to convert the vector d (x, y) to other coordinate spaces, if so, perform S3, otherwise perform S4.
S3, determining coordinates d (Sx, Sy.,) in other coordinate space (S1).
S4, transforming one or more elements in d (Sx, Sy.,) according to a periodic function to obtain d (x ', y').
S5, determining whether remapping is to be carried out, if yes, executing S6, and if not, executing S2.
And S6, whether the coordinate space transformation operation is performed or not, if so, executing S7, and otherwise, executing S8.
S7, converting d (x ', y') to cartesian coordinates (also known as euclidean coordinates).
S8, the color value of the transformed p (x ', y') ═ d (x ', y') + c (x, y) is taken as the color value of the current pixel (x, y).
In this embodiment, according to actual requirements, the user may determine to convert the output vector d (x, y) of S1 to another coordinate space or not convert the output vector d (x, y) of S1 to another coordinate space in step S2, and the user may also determine to remap the output d (x ', y') of S4 or not remap the output d (x ', y') of S4 in step S5, where different effects that can be achieved by different selections include:
in the first scheme, it is assumed that the image to be processed is as shown in fig. 3, and the periodic function is: (X) P (X/P- [ X/P +0.5]), and under the condition of not performing coordinate space conversion and remapping and only performing periodic function processing, the image to be processed shown in the image 3 can be converted into four kaleidoscope images shown in fig. 4, wherein the effect a is an unfolded shape, and the mapping direction is specifically to make the coordinates of the first pixel point symmetrical and repeated only in the X-axis direction; the effect B is wheel-shaped, and the mapping direction is specifically that the coordinates of the first pixel point are exchanged in the X axis and the Y axis, and then the first period is used for carrying out symmetry and repetition in the X axis and the Y axis directions; the effect C is in a fish head shape, and the mapping direction is specifically that the coordinates of the first pixel point are exchanged in the X axis and the Y axis, and then the symmetry and the repetition are carried out in the X axis and the Y axis directions in a second period; the effect D is in a can shape, and the mapping direction is specifically to carry out symmetry and repetition on the coordinates of the first pixel point in the X-axis direction and the Y-axis direction. The first period and the second period are different periods.
Scheme two, assume that the image to be processed is as shown in fig. 3, and the periodic function is: where P (x) is (x/P- [ x/P + 0.5), after coordinate space conversion and remapping (each mapping is referred to as a sequential iterative processing operation), and the first iterative processing operation is processed by the above-described periodic function, the image to be processed shown in the image 3 can be converted into 5 types of kaleidoscope effects as shown in fig. 7, and in the 5 types of kaleidoscope effects generation processes, the periodic functions used in the second iterative processing operation are different from each other.
In summary, according to the image processing method provided by the embodiment of the present application, since the coordinates of the first pixel point are directly acquired from the image to be processed, the coordinates of the second pixel point corresponding to the first pixel point are acquired through the kaleidoscope function, so as to construct and obtain the kaleidoscope image including the second pixel point, the kaleidoscope image can be directly realized based on the image to be processed, so that the kaleidoscope effect can be directly applied to the picture and the video frame, thereby improving the application scenario of the kaleidoscope effect, in addition, since the coordinates of the first pixel point are directly extracted from the image to be processed, the coordinates of the first pixel point include the characteristics of the image to be processed, and further according to the processing of the kaleidoscope function, the kaleidoscope image including the characteristics of the image to be processed can be generated, thereby improving the richness of the kaleidoscope image, the utilization value of the kaleidoscope image is enhanced.
Fig. 9 is a flowchart of steps of another image processing method provided in an embodiment of the present application, and as shown in fig. 9, the method may include:
step 301, extracting the coordinates of a first pixel point of the image to be processed.
The implementation manner of this step is similar to the implementation process of step 101 described above, and this embodiment of the present application is not described in detail here.
Step 302, inputting the coordinates of the first pixel point into the pseudo random number generation function to obtain a plurality of pseudo random numbers, wherein the pseudo random numbers are uniformly distributed.
In the embodiment of the application, the pseudo random number does not have true randomness, but has statistical characteristics similar to those of a random number, such as uniformity, independence and the like. The plurality of pseudo random numbers generated by the pseudo random number generating function generally satisfy a uniform distribution
The pseudo random number generation function rand () is a function for generating pseudo random numbers, which depends on an initial value, also called a seed, and generates corresponding pseudo random number sequences by the initial value, and which can generate a pseudo random number from a predefined interval ([0, 1]) by using the input initial value (seed), and the pseudo random number generated by the pseudo random number generation function is completely determined as long as the initial value is determined, so that the generated pseudo random number sequences are not truly random. In the step, a plurality of pseudo random numbers can be generated through a pseudo random number generating function, and the number and the format of the pseudo random numbers can be set according to actual requirements.
In this embodiment of the present application, when calculating the pseudo random number, the coordinates of the first pixel point may be used as an input initial value, and for the pseudo random number generation function, the used initial value is not changed, and then the number order of the pseudo random number is also not changed. In practical applications, the rand () function provided by the C language program can implement the generation of pseudo random numbers.
Step 303, constructing the random number as the coordinates of the second pixel points, where the number of the second pixel points is equal to the number of the first pixel points.
In the embodiment of the application, the random numbers can be combined in pairs according to any rule to obtain the coordinates of a plurality of second pixel points, and the number of the second pixel points can be equal to the number of the first pixel points. It should be noted that, assuming that the first pixel points are all the pixel points of the image to be processed, the size of the generated kaleidoscope effect is consistent with the size of the image to be processed under the condition that the number of the second pixel points can be equal to the number of the first pixel points. In addition, the number of the second pixel points may not be equal to the number of the first pixel points, for example, when the number of the second pixel points is smaller than the number of the first pixel points, the size of the generated kaleidoscope effect is smaller than the size of the image to be processed. And under the condition that the number of the second pixel points is larger than that of the first pixel points, the size of the generated kaleidoscope effect is larger than that of the image to be processed. The number of the second pixel points is determined to be equal to or smaller than or larger than the number of the first pixel points according to actual requirements.
In particular, the distribution of pseudo-random numbers may result in a certain visualized regularity, for example. The pseudo-random number sequence with uniform distribution can be generated through a pseudo-random number generation algorithm, the kaleidoscope effect with uniform texture can be presented during display through the coordinates of the second pixel points constructed by the pseudo-random numbers in the pseudo-random number sequence, and the kaleidoscope effect can achieve certain aesthetic feeling and ornamental interest on the basis of keeping the color distribution of the image to be processed.
In addition, a Gaussian noise simulator can be used for generating random numbers with Gaussian distribution, coordinates of second pixel points constructed by the random numbers can show a kaleidoscope effect similar to snowflake noise of a television during display, and the kaleidoscope effect can achieve certain aesthetic feeling and enjoyment interest on the basis of keeping the color distribution of an image to be processed.
And 304, establishing a corresponding relation between the second pixel point and the first pixel point.
In the embodiment of the application, a second pixel point and a first pixel point can be combined according to any rule, a corresponding relation combination between the second pixel point and the first pixel point is established, and no repeated pixel point exists between any combinations.
And 305, determining the color value of the first pixel point as the color value of a second pixel point corresponding to the first pixel point according to the corresponding relation.
And step 306, constructing and obtaining the kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
In this application embodiment, before displaying the second pixel, coordinate value and color value of the second pixel need to be determined, and the color value of the second pixel can be the color value of the first pixel corresponding to this second pixel, and the second pixel is displayed by taking the color value of this first pixel as the color value, so that the kaleidoscope effect can keep the color consistency of the image to be processed.
In summary, according to the image processing method provided by the embodiment of the present application, since the coordinates of the first pixel point are directly acquired from the image to be processed, the coordinates of the second pixel point corresponding to the first pixel point are acquired through the kaleidoscope function, so as to construct and obtain the kaleidoscope image including the second pixel point, the kaleidoscope image can be directly realized based on the image to be processed, so that the kaleidoscope effect can be directly applied to the picture and the video frame, thereby improving the application scenario of the kaleidoscope effect, in addition, since the coordinates of the first pixel point are directly extracted from the image to be processed, the coordinates of the first pixel point include the characteristics of the image to be processed, and further according to the processing of the kaleidoscope function, the kaleidoscope image including the characteristics of the image to be processed can be generated, thereby improving the richness of the kaleidoscope image, the utilization value of the kaleidoscope image is enhanced.
Fig. 10 is a block diagram of an image processing apparatus according to an embodiment of the present application, and as shown in fig. 10, the image processing apparatus includes: an acquisition module 401, a mapping module 402, and a display module 403.
An obtaining module 401 configured to extract coordinates of a first pixel point of an image to be processed;
a mapping module 402, configured to determine, through a preset kaleidoscope function, coordinates of a second pixel point corresponding to the coordinates of the first pixel point, where the kaleidoscope function is configured to map the coordinates of the first pixel point to the coordinates of the second pixel point, and when the second pixel point is arranged according to the coordinates of the second pixel point, a kaleidoscope effect corresponding to the kaleidoscope function is formed;
and a display module 403 configured to construct a kaleidoscope image including the second pixel point according to the coordinates of the second pixel point.
In an alternative embodiment, the kaleidoscope function is a periodic function, and the mapping module 402 comprises: the difference value calculation submodule is configured to take a difference value obtained by subtracting a preset central coordinate in the image to be processed from the coordinate of the first pixel point as a direction vector; the periodic function submodule is configured to determine a second element corresponding to a first element in the direction vector through the periodic function and a preset mapping direction, the mapping direction includes the direction of any coordinate axis in a coordinate system where the periodic function is located, and the origin coordinate of the coordinate system where the periodic function is located is the center coordinate; and the replacing submodule is configured to replace the corresponding first element in the direction vector with the second element and take the replaced direction vector as the coordinate of the second pixel point.
In an alternative embodiment, the direction vector is in a euclidean space coordinate system, and the periodic function sub-module includes: the space mapping unit is configured to map the direction vectors to a target space coordinate system, and determine target direction vectors corresponding to the direction vectors; and the periodic function unit is configured to determine a second element corresponding to the first element in the target direction vector through the periodic function and the mapping direction.
In an alternative embodiment, the display module 403 includes: the space mapping submodule is configured to map the second pixel point to a Euclidean space coordinate system according to the coordinate of the second pixel point, and determine a third pixel point corresponding to the second pixel point; the adding submodule is configured to determine the color value of the second pixel point as the addition result of the color value of the third pixel point and the color value of the pixel point corresponding to the center coordinate; and the first display submodule is configured to construct and obtain a kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
In an alternative embodiment, the kaleidoscope function is a random number generation function, and the mapping module 402 comprises: the generation submodule is configured to input the coordinates of the first pixel point into the pseudo-random number generation function to obtain a plurality of pseudo-random numbers, and the pseudo-random numbers meet uniform distribution; and the construction submodule is configured to construct the random number into the coordinates of the second pixel points, and the number of the second pixel points is equal to that of the first pixel points. And the establishing submodule is configured to establish a corresponding relation between the second pixel point and the first pixel point.
In an alternative embodiment, the display module 403 includes: the determining submodule is configured to determine the color value of the first pixel point as the color value of a second pixel point corresponding to the first pixel point according to the corresponding relation; and the second display submodule is configured to construct and obtain a kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
In summary, according to the image processing apparatus provided in the embodiment of the present application, since the coordinates of the first pixel point are directly acquired from the image to be processed, the coordinates of the second pixel point corresponding to the first pixel point are obtained through the kaleidoscope function, so as to construct and obtain the kaleidoscope image including the second pixel point, the kaleidoscope image can be directly realized based on the image to be processed, so that the kaleidoscope effect can be directly applied to the picture and the video frame, thereby improving the application scenario of the kaleidoscope effect, in addition, since the coordinates of the first pixel point are directly extracted from the image to be processed, the coordinates of the first pixel point include the characteristics of the image to be processed, and further according to the processing of the kaleidoscope function, the kaleidoscope image including the characteristics of the image to be processed can be generated, thereby improving the richness of the kaleidoscope image, the utilization value of the kaleidoscope image is enhanced.
Fig. 11 is a block diagram illustrating an electronic device 600 according to an example embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 11, electronic device 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an interface to input/output (I/O) 612, a sensor component 614, and a communication component 616.
The processing component 602 generally controls overall operation of the electronic device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is used to store various types of data to support operations at the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply component 606 provides power to the various components of electronic device 600. The power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 600.
The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 600 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is used to output and/or input audio signals. For example, the audio component 610 may include a Microphone (MIC) for receiving external audio signals when the electronic device 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the electronic device 600. For example, the sensor component 614 may detect an open/closed state of the electronic device 600, the relative positioning of components, such as a display and keypad of the electronic device 600, the sensor component 614 may also detect a change in the position of the electronic device 600 or a component of the electronic device 600, the presence or absence of user contact with the electronic device 600, orientation or acceleration/deceleration of the electronic device 600, and a change in the temperature of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is operable to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for implementing an image processing method provided by an embodiment of the present application.
In an exemplary embodiment, a non-transitory storage medium including instructions, such as the memory 604 including instructions, executable by the processor 620 of the electronic device 600 to perform the above-described method is also provided. For example, the non-transitory storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 12 is a block diagram illustrating an electronic device 700 according to an example embodiment. For example, the electronic device 700 may be provided as a server. Referring to fig. 12, electronic device 700 includes a processing component 722 that further includes one or more processors, and memory resources, represented by memory 732, for storing instructions, such as applications, that are executable by processing component 722. The application programs stored in memory 732 may include one or more modules that each correspond to a set of instructions. In addition, the processing component 722 is configured to execute instructions to perform an image processing method provided by the embodiments of the present application.
The electronic device 700 may also include a power component 726 that is configured to perform power management of the electronic device 700, a wired or wireless network interface 750 that is configured to connect the electronic device 700 to a network, and an input output (I/O) interface 758. The electronic device 700 may operate based on an operating system stored in memory 732, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
An embodiment of the present application further provides an application program, and when the application program is executed by a processor of an electronic device, the image processing method provided by the present application is implemented.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. An image processing method, characterized in that the method comprises:
extracting coordinates of a first pixel point of an image to be processed;
determining the coordinates of a second pixel point corresponding to the coordinates of the first pixel point through a preset kaleidoscope function, wherein the kaleidoscope function is used for mapping the coordinates of the first pixel point into the coordinates of the second pixel point, and when the second pixel point is arranged according to the coordinates of the second pixel point, a kaleidoscope effect corresponding to the kaleidoscope function is formed;
and constructing to obtain a kaleidoscope image comprising the second pixel point according to the coordinates of the second pixel point.
2. The method according to claim 1, wherein the kaleidoscope function is a periodic function, and the determining the coordinates of the second pixel corresponding to the coordinates of the first pixel by a preset kaleidoscope function comprises:
subtracting a difference value obtained by subtracting a preset central coordinate in the image to be processed from the coordinate of the first pixel point to serve as a direction vector;
determining a second element corresponding to a first element in the direction vector according to the periodic function and a preset mapping direction, wherein the mapping direction comprises the direction of any coordinate axis in a coordinate system where the periodic function is located, and the origin coordinate of the coordinate system where the periodic function is located is the central coordinate;
and replacing the corresponding first element in the direction vector by the second element, and taking the replaced direction vector as the coordinate of the second pixel point.
3. The method of claim 2, wherein the direction vector is in a euclidean space coordinate system, and the determining, through the periodic function and a preset mapping direction, a second element corresponding to a first element in the direction vector comprises:
mapping the direction vector to a target space coordinate system, and determining a target direction vector corresponding to the direction vector;
and determining a second element corresponding to the first element in the target direction vector through the periodic function and the mapping direction.
4. The method according to claim 3, wherein said constructing the kaleidoscope image including the second pixel point according to the coordinates of the second pixel point comprises:
mapping the second pixel point to the Euclidean space coordinate system according to the coordinate of the second pixel point, and determining a third pixel point corresponding to the second pixel point;
determining the color value of the second pixel point as the sum of the color value of the third pixel point and the color value of the pixel point corresponding to the center coordinate;
and constructing and obtaining the kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
5. The method according to claim 1, wherein the kaleidoscope function is a pseudo-random number generation function, and the determining the coordinates of the second pixel point corresponding to the coordinates of the first pixel point by a preset kaleidoscope function comprises:
inputting the coordinates of the first pixel point into the pseudo random number generation function to obtain a plurality of pseudo random numbers, wherein the pseudo random numbers meet the requirement of uniform distribution;
constructing the pseudo random numbers into coordinates of the second pixel points, wherein the number of the second pixel points is equal to that of the first pixel points;
and establishing a corresponding relation between the second pixel point and the first pixel point.
6. The method according to claim 5, wherein said constructing the kaleidoscope image including the second pixel point according to the coordinates of the second pixel point comprises:
determining the color value of the first pixel point as the color value of a second pixel point corresponding to the first pixel point according to the corresponding relation;
and constructing and obtaining the kaleidoscope image comprising the second pixel point according to the color value of the second pixel point and the coordinate of the second pixel point.
7. An image processing apparatus, characterized in that the apparatus comprises:
the acquisition module is configured to extract coordinates of a first pixel point of the image to be processed;
the mapping module is configured to determine coordinates of a second pixel point corresponding to the coordinates of the first pixel point through a preset kaleidoscope function, wherein the kaleidoscope function is used for mapping the coordinates of the first pixel point to the coordinates of the second pixel point, and when the second pixel point is arranged according to the coordinates of the second pixel point, a kaleidoscope effect corresponding to the kaleidoscope function is formed;
and the display module is configured to construct and obtain a kaleidoscope image comprising the second pixel point according to the coordinates of the second pixel point.
8. The apparatus of claim 7, wherein the kaleidoscope function is a periodic function, and wherein the mapping module comprises:
the difference value calculation submodule is configured to take a difference value obtained by subtracting a preset central coordinate in the image to be processed from the coordinate of the first pixel point as a direction vector;
the periodic function submodule is configured to determine a second element corresponding to a first element in the direction vector through the periodic function and a preset mapping direction, the mapping direction includes the direction of any coordinate axis in a coordinate system where the periodic function is located, and the origin coordinate of the coordinate system where the periodic function is located is the center coordinate;
and the replacing submodule is configured to replace the corresponding first element in the direction vector with the second element and take the replaced direction vector as the coordinate of the second pixel point.
9. An electronic device, comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the image processing method according to any one of claims 1 to 6.
10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the image processing method according to any one of claims 1 to 6.
CN202010486694.XA 2020-06-01 2020-06-01 Image processing method, image processing device, electronic equipment and storage medium Pending CN113763229A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010486694.XA CN113763229A (en) 2020-06-01 2020-06-01 Image processing method, image processing device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010486694.XA CN113763229A (en) 2020-06-01 2020-06-01 Image processing method, image processing device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113763229A true CN113763229A (en) 2021-12-07

Family

ID=78782258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010486694.XA Pending CN113763229A (en) 2020-06-01 2020-06-01 Image processing method, image processing device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113763229A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260987A (en) * 2014-06-24 2016-01-20 江南大学 Method for designing bandhnu pattern by dedicated fractal software
WO2018019124A1 (en) * 2016-07-29 2018-02-01 努比亚技术有限公司 Image processing method and electronic device and storage medium
CN108762492A (en) * 2018-05-14 2018-11-06 歌尔科技有限公司 Method, apparatus, equipment and the storage medium of information processing are realized based on virtual scene
CN111199518A (en) * 2018-11-16 2020-05-26 深圳市中兴微电子技术有限公司 Image presentation method, device and equipment of VR equipment and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260987A (en) * 2014-06-24 2016-01-20 江南大学 Method for designing bandhnu pattern by dedicated fractal software
WO2018019124A1 (en) * 2016-07-29 2018-02-01 努比亚技术有限公司 Image processing method and electronic device and storage medium
CN108762492A (en) * 2018-05-14 2018-11-06 歌尔科技有限公司 Method, apparatus, equipment and the storage medium of information processing are realized based on virtual scene
CN111199518A (en) * 2018-11-16 2020-05-26 深圳市中兴微电子技术有限公司 Image presentation method, device and equipment of VR equipment and computer storage medium

Similar Documents

Publication Publication Date Title
CN107977934B (en) Image processing method and device
US11030733B2 (en) Method, electronic device and storage medium for processing image
CN109584362B (en) Three-dimensional model construction method and device, electronic equipment and storage medium
US11776209B2 (en) Image processing method and apparatus, electronic device, and storage medium
CN110853095B (en) Camera positioning method and device, electronic equipment and storage medium
JP6170626B2 (en) Composition changing method, composition changing apparatus, terminal, program, and recording medium
CN112785672B (en) Image processing method and device, electronic equipment and storage medium
CN112581358B (en) Training method of image processing model, image processing method and device
US20200402321A1 (en) Method, electronic device and storage medium for image generation
CN112991381B (en) Image processing method and device, electronic equipment and storage medium
CN112767288A (en) Image processing method and device, electronic equipment and storage medium
CN106097428B (en) Method and device for labeling three-dimensional model measurement information
CN111815750A (en) Method and device for polishing image, electronic equipment and storage medium
US9665925B2 (en) Method and terminal device for retargeting images
CN112257594A (en) Multimedia data display method and device, computer equipment and storage medium
CN111354444A (en) Pathological section image display method and device, electronic equipment and storage medium
CN113763229A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112614228B (en) Method, device, electronic equipment and storage medium for simplifying three-dimensional grid
CN116527993A (en) Video processing method, apparatus, electronic device, storage medium and program product
CN109308740A (en) 3D contextual data processing method, device and electronic equipment
CN114581495A (en) Image processing method, video processing method, device and electronic equipment
CN112399080A (en) Video processing method, device, terminal and computer readable storage medium
CN112270737A (en) Texture mapping method and device, electronic equipment and storage medium
CN113645414B (en) Method and device for generating water ripple special effect video, electronic equipment and storage medium
US11527022B2 (en) Method and apparatus for transforming hair

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