Disclosure of Invention
The embodiment of the invention provides a picture processing method, a picture processing device and picture processing equipment, which can be used for stretching a template.
A first aspect of an embodiment of the present invention provides an image processing method, including:
acquiring a preset template, wherein the preset template comprises N areas, and N is an integer greater than 1;
selecting M areas in the N areas, wherein M is an integer larger than 0 and smaller than N;
detecting whether a shaking event in a preset direction occurs;
stretching the M regions along the preset direction when a shaking event in the preset direction is detected.
With reference to the first aspect of the embodiments of the present invention, in a first possible implementation manner of the first aspect, the detecting whether a shaking event in a preset direction occurs includes:
detecting whether the acceleration in the preset direction is larger than a first preset threshold value, and if so, determining that a shaking event in the preset direction is detected;
or,
detecting whether the shaking amplitude in the preset direction is larger than a second preset threshold value, and if so, determining that the shaking event in the preset direction is detected;
or,
and detecting whether the shaking frequency in the preset direction is greater than a third preset threshold value, and if so, determining that the shaking event in the preset direction is detected.
With reference to the first aspect of the present embodiments or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the stretching the M regions along the preset direction includes:
obtaining a shaking parameter of the shaking event;
and stretching the M areas along the preset direction according to the shaking parameters.
With reference to the first aspect of the embodiments of the present invention or the first possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, when a picture is included in a region i of the M regions, the region i is any one of the M regions,
the stretching the M regions along the preset direction includes:
stretching the area i along the preset direction, and stretching the picture, wherein the stretching ratio of the area i is consistent with that of the picture.
With reference to the first aspect of this embodiment or the first possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, after the stretching the M regions along the preset direction, the method further includes:
and detecting whether the stretching proportion of any one of the M areas reaches a fourth preset threshold value, if so, stopping stretching any one of the M areas.
With reference to the first aspect of the embodiment of the present invention or the first possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the stretching the M regions along the preset direction includes:
and stretching the M areas along the preset direction on the premise of keeping the size of each of the M areas unchanged.
With reference to the first aspect of this embodiment or the first possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, after the stretching the M regions along the preset direction, the method further includes:
stretching the M regions along the opposite direction when a shaking event in the opposite direction of the preset direction is detected.
With reference to the first aspect of the embodiment of the present invention or the first possible implementation manner of the first aspect, in a seventh possible implementation manner of the first aspect, after the selecting M of the N regions and before the detecting whether a shaking event along a preset direction occurs, the method further includes:
acquiring identity information of a user;
and verifying the identity information, and when the identity information passes the verification, executing whether the detection is carried out to generate a shaking event along a preset direction.
A second aspect of the embodiments of the present invention provides an image processing apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a preset template, the preset template comprises N areas, and N is an integer greater than 1;
a selecting unit, configured to select M regions from the N regions, where M is an integer greater than 0 and smaller than N;
the detection unit is used for detecting whether a shaking event in a preset direction occurs or not;
and the stretching unit is used for stretching the M areas along the preset direction when the shaking event in the preset direction is detected.
With reference to the second aspect of the embodiment of the present invention, in a first possible implementation manner of the second aspect, the detection unit is specifically configured to:
detecting whether the acceleration in the preset direction is larger than a first preset threshold value, and if so, determining that a shaking event in the preset direction is detected;
or,
detecting whether the shaking amplitude in the preset direction is larger than a second preset threshold value, and if so, determining that the shaking event in the preset direction is detected;
or,
and detecting whether the shaking frequency in the preset direction is greater than a third preset threshold value, and if so, determining that the shaking event in the preset direction is detected.
In combination with the second human aspect or the first possible implementation manner of the second aspect of the embodiments of the invention, in a second possible implementation manner of the second aspect, the stretching unit includes:
the acquisition module is used for acquiring shaking parameters of the shaking event;
and the stretching module is used for stretching the M areas along the preset direction according to the shaking parameters.
With reference to the second human aspect or the first possible implementation manner of the second aspect of the embodiments of the present invention, in a third possible implementation manner of the second aspect, when a picture is included in a region i of the M regions, the region i is any one of the M regions,
the stretching unit is specifically configured to:
stretching the area i along the preset direction, and stretching the picture, wherein the stretching ratio of the area i is consistent with that of the picture.
With reference to the second human aspect or the first possible implementation manner of the second aspect of the embodiments of the present invention, in a fourth possible implementation manner of the second aspect, the detection unit is further configured to:
after the stretching unit stretches the M areas along the preset direction, whether the stretching proportion of any one of the M areas reaches a fourth preset threshold value is detected, and if yes, stretching of any one of the M areas is stopped.
With reference to the second human aspect of the example embodiments or the first possible implementation manner of the second aspect, in a fifth possible implementation manner of the second aspect, the stretching unit is specifically configured to:
and stretching the M areas along the preset direction on the premise of keeping the size of each of the M areas unchanged.
With reference to the second human aspect of the example embodiments or the first possible implementation manner of the second aspect, in a sixth possible implementation manner of the second aspect, the stretching unit is further configured to:
after the stretching unit stretches the M regions along the preset direction, stretching the M regions along the opposite direction when a shaking event in the opposite direction of the preset direction is detected.
With reference to the second person aspect or the first possible implementation manner of the second aspect of the embodiment of the present invention, in a seventh possible implementation manner of the second aspect, the obtaining unit is configured to obtain the identity information of the user after the selecting unit selects M areas of the N areas; the device further comprises:
and the verification unit is used for verifying the identity information, and when the identity information passes the verification, the detection unit is used for detecting whether a shaking event along a preset direction occurs or not.
A third aspect of the embodiments of the present invention provides an image processing apparatus, including: a processor, a memory, a communication interface, and a bus; the processor, the memory and the communication interface are connected through the bus and complete mutual communication; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute a picture processing method; wherein the method comprises the following steps:
acquiring a preset template, wherein the preset template comprises N areas, and N is an integer greater than 1;
selecting M areas in the N areas, wherein M is an integer larger than 0 and smaller than N;
detecting whether a shaking event in a preset direction occurs;
stretching the M regions along the preset direction when a shaking event in the preset direction is detected.
A fourth aspect of the embodiments of the present invention provides a storage medium, where the storage medium is used to store an application program, and the application program is used to execute the picture processing method according to the embodiments of the present invention when running.
A fifth aspect of the embodiments of the present invention provides an application program, where the application program is configured to execute the picture processing method according to the embodiments of the present invention when the application program runs.
The embodiment of the invention has the following beneficial effects:
the method includes the steps of obtaining a preset template, wherein the preset template comprises N areas, N is an integer larger than 1, M areas in the N areas are selected, M is an integer larger than 0 and smaller than N, whether a shaking event in a preset direction occurs or not is detected, and when the shaking event in the preset direction is detected, the M areas are stretched along the preset direction. Therefore, when a shaking event is detected, the area selected by the user can be stretched, so that a personalized template is provided for the user, and the personalized requirements of the user are met.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The Devices described in the embodiments of the present invention may include a smart Phone (e.g., an Android Phone, an iOS Phone, a Windows Phone, etc.), a tablet computer, a palm computer, a notebook computer, a mobile internet device (MID, mobile internet Devices), or a wearable device, which are examples, but not exhaustive, and include but are not limited to the above Devices.
Fig. 1 is a schematic flowchart illustrating a picture processing method according to a first embodiment of the present invention. The picture processing method described in this embodiment includes the following steps:
101. the method comprises the steps of obtaining a preset template, wherein the preset template comprises N areas, and N is an integer larger than 1.
The device in the implementation of the present invention may include a plurality of preset templates, where the preset templates may include N regions, N is an integer greater than 1, and each of the N regions may be configured with one picture. As shown in fig. 1a, 3 preset templates, namely a preset template a, a preset template b and a preset template c, are shown in fig. 1a, where the preset template a includes 2 regions (left region and right region), the preset template b includes 2 regions (upper region and lower region), and the preset template c includes 4 regions (upper left region, lower left region, upper right region and lower right region).
Optionally, the preset template may also be customized by the user, so that a personalized preset template may be obtained.
102. And selecting M areas in the N areas, wherein M is an integer which is larger than 0 and smaller than N.
The method includes selecting M regions from N regions, where M is an integer greater than 0 and less than N, and the M regions may be one region or multiple regions. The M regions may be adjacent regions or non-adjacent regions, and of course, some of the M regions may be adjacent regions.
M adjacent regions can be selected, wherein the adjacent regions mainly mean that the pictures are adjacent in the middle of the preset template. M is an integer greater than 1. As shown in fig. 1B, a and B are adjacent regions, B and C are adjacent regions, a and D are adjacent regions, and C and D are adjacent regions, as shown in fig. 1C, it can be seen that a and B are adjacent regions, F and E are adjacent regions, E and H are adjacent regions, as shown in fig. 1D, a and B, D are adjacent regions, B and A, C are adjacent regions, C and B, D are adjacent regions, and D and A, C are adjacent regions. The M selected pieces are adjacent areas.
103. Detecting whether a shaking event along a preset direction occurs.
The preset direction may be any direction, and the specific situation may depend on the actual situation, for example, fig. 1e includes two directions, where the a direction is the direction of the shaking event occurring to the left, and the b direction is the direction of the shaking event occurring to the right. As shown in fig. 1f, 4 directions may be included, where a is the direction of a shaking event occurring to the left, b is the direction of a shaking event occurring to the right, c is the direction of a shaking event occurring upward, and b is the direction of a shaking event occurring downward. Of course, not limited to this, in a specific application, the predetermined direction may also be a combined direction (i.e. a plurality of directions are combined together), for example, the predetermined direction may be a direction and then b direction, taking the direction in fig. 1f as an example.
Alternatively, the step 103 may be implemented in the following manner, including:
and detecting whether the acceleration in the preset direction is greater than a first preset threshold value, and if so, determining that the shaking event in the preset direction is detected. The first preset threshold is set by default of the system or by the user, and if the acceleration is smaller than or equal to the first preset threshold, the shaking event in the preset direction can be considered not to occur, so that the method is mainly used for preventing misoperation.
Alternatively, the step 103 may be implemented in the following manner, including:
and detecting whether the shaking amplitude in the preset direction is larger than a second preset threshold value, and if so, determining that the shaking event in the preset direction is detected. The second preset threshold is set by default of the system or by the user, and if the shaking amplitude is smaller than or equal to the second preset threshold, the shaking event in the preset direction is not considered to occur, and the second preset threshold is mainly used for preventing misoperation.
Alternatively, the step 103 may be implemented in the following manner, including:
and detecting whether the shaking frequency in the preset direction is greater than a third preset threshold value, and if so, determining that the shaking event in the preset direction is detected. The third preset threshold is set by default of the system or by the user, and if the shaking amplitude is smaller than or equal to the third preset threshold, the shaking event in the preset direction is not considered to occur, and the third preset threshold is mainly used for preventing misoperation.
104. Stretching the M areas along the preset direction when the shaking event in the preset direction is detected.
Wherein, when a shaking event in a preset direction is detected, the M regions may be stretched along the preset direction. Of course, if any one of the M regions includes a picture, the picture may be correspondingly stretched, and here, the corresponding meaning means that the stretching ratio of the picture is consistent with the stretching ratio of the region in the preset template where the picture is located. In the embodiment of the invention, the size of the area is changed, so that the picture is correspondingly stretched in order to better display the picture, so that the picture can be better displayed in the area where the picture is located.
For example, as shown in FIG. 1g, the left side is the preset template before the shaking event and the right side is the preset template after the shaking event. Assuming that the selected area is the area a, if a shaking event in the direction a occurs, it can be seen that the areas C and D remain unchanged, and the area a is stretched in the direction of reduction, of course, the area B is stretched in the direction a, where there are pictures in the original areas a and B, then the picture in the area a is reduced, the picture in the area B is enlarged, the reduction ratio of the picture in the area a is consistent with the reduction ratio of the area a, and the enlargement ratio of the picture in the area B is consistent with the enlargement ratio of the area B.
For another example, as shown in fig. 1h, the left side is the preset template before the shaking event, and the right side is the preset template after the shaking event. Assuming that the selected regions are a region a and a region D, if a shaking event occurs in the a direction, it can be seen that the A, D region is stretched in the shrinking direction, and of course, the B, C region is stretched in the a direction, where there is a picture in the original A, B, C, D, then the A, D picture is shrunk, the B, C picture is enlarged, the shrinking ratio of the picture in a (or D) is consistent with the shrinking ratio of the region a (D), and the enlarging ratio of the picture in b (c) is consistent with the enlarging ratio of the region b (c).
For another example, as shown in fig. 1i, the left side is the preset template before the shaking event, and the right side is the preset template after the shaking event. Assuming that the selected regions are a region a and a region C, if a shaking event occurs in the a direction, it can be seen that the a region is stretched in the reducing direction, the C region is stretched in the a direction (C region is enlarged), the B region is stretched in the a direction, and the D region is stretched in the a direction. B, C, here, there are pictures in original A, B, C, D, then A, D reduces the picture, B, C enlarges the picture, the picture reducing ratio in A (or D) is consistent with the area reducing ratio in A (D), and the picture enlarging ratio in B (C) is consistent with the area enlarging ratio in B (C).
Optionally, the stretching the M regions along the preset direction includes:
41) acquiring shaking parameters of the shaking event;
42) and stretching the M areas along the preset direction according to the shaking parameters.
Wherein the shake parameter of the shake event in step 41 may be at least one of: acceleration in a preset direction, shaking amplitude in the preset direction, shaking frequency in the preset direction, shaking times in the preset direction and the like. For example, the greater the acceleration in the preset direction, the greater the proportion of stretching in the preset direction. For another example, the greater the frequency of shaking in the predetermined direction, the greater the proportion of stretching in the predetermined direction. The ratio of stretching in the preset direction by the primary shaking is a, and the ratio of stretching in the preset direction by the secondary shaking is 2 a.
Optionally, the stretching the M regions along the preset direction is specifically as follows:
and stretching the M areas along the preset direction on the premise of keeping the size of each of the M areas unchanged.
For example, as shown in fig. 1j, as shown in the left diagram of fig. 1j, where the preset template includes 9 regions, assuming that the user selects region E, and the preset direction is the a direction, when a shaking event occurs in the a direction, the size of the E region remains unchanged, the whole E region is stretched in the a direction, and the effect after stretching is as shown in the right diagram of fig. 1j, it can be seen that the F region is reduced, the D region is expanded, and the A, B, C, G, H and I regions remain unchanged. Of course, if a picture is set in a certain region of the preset template, the picture in the region is correspondingly stretched and changed along with the stretching ratio of the region.
Further, after the step 104, the method further includes the following steps:
and detecting whether the stretching proportion of any one of the M areas reaches a fourth preset threshold value, if so, stopping stretching any one of the M areas.
And when the stretching proportion of any one of the M areas reaches a fourth preset threshold value, stopping stretching any one of the M areas. The fourth preset threshold may be set by default by the system or by the user.
In practical application, the embodiment described in fig. 1 is implemented, the preset template can be adjusted, the adjusted template can meet the requirements of users to a certain extent, meanwhile, the interestingness is achieved, when pictures are placed in different areas of the preset template, the size of the picture can be adjusted while the size of the area is adjusted, and therefore the personalized visual effect is provided. Therefore, the picture drawing device can facilitate the user to draw the picture, and can also obtain preset templates of different styles, thereby being more suitable for the psychology of the user.
Optionally, the formats of the pictures in each area of the preset template may be the same or different, and the sizes of the pictures may be the same or different
The method includes the steps of obtaining a preset template, wherein the preset template comprises N areas, N is an integer larger than 1, M areas in the N areas are selected, M is an integer larger than 0 and smaller than N, whether a shaking event in a preset direction occurs or not is detected, and when the shaking event in the preset direction is detected, the M areas are stretched along the preset direction. Therefore, when a shaking event is detected, the area selected by the user can be stretched, so that a personalized template is provided for the user, and the personalized requirements of the user are met.
In accordance with the above, please refer to fig. 2, which is a flowchart illustrating a second embodiment of a method for processing an image according to an embodiment of the present invention. The picture processing method described in this embodiment includes the following steps:
201. the method comprises the steps of obtaining a preset template, wherein the preset template comprises N areas, and N is an integer larger than 1.
202. And selecting M areas in the N areas, wherein M is an integer which is larger than 0 and smaller than N.
203. Whether a shaking event in a preset direction occurs is detected.
204. Stretching the M regions along the preset direction when a shaking event in the preset direction is detected.
205. Stretching the M regions along the opposite direction when a shaking event in the opposite direction of the preset direction is detected.
Alternatively, when a shaking event in a direction opposite to the preset direction is detected, the M regions may be stretched in the direction opposite to the preset direction.
Optionally, the stretching the M regions in the opposite direction includes the following steps:
2051) acquiring shaking parameters of the shaking event;
2052) and stretching the M regions in the opposite direction according to the shaking parameters.
Wherein the shake parameters of the shake event in step 2051 may be at least one of: acceleration in the opposite direction, shaking amplitude in the opposite direction, shaking frequency in the opposite direction, the number of shaking in the opposite direction, and the like. For example, the greater the acceleration in the reverse direction, the greater the proportion of stretching that occurs in the reverse direction. For example, the larger the frequency of shaking in the reverse direction, the larger the proportion of stretching in the reverse direction. The ratio of stretching in the reverse direction by primary shaking was a, and the ratio of stretching in the reverse direction by secondary shaking was 2 a.
Further, after step 205, the method further includes the following steps:
and detecting whether the stretching proportion of any one of the M areas reaches a fifth preset threshold value, if so, stopping stretching any one of the M areas.
And when the stretching proportion of any one of the M areas reaches a fifth preset threshold value, stopping stretching any one of the M areas. The fifth preset threshold may be set by default by the system or by the user.
Of course, the specific description of steps 201-204 in this embodiment can refer to steps 101-104 in the image processing method described in fig. 1.
In accordance with the above, please refer to fig. 3, which is a flowchart illustrating a third embodiment of a method for processing an image according to an embodiment of the present invention. The picture processing method described in this embodiment includes the following steps:
301. the method comprises the steps of obtaining a preset template, wherein the preset template comprises N areas, and N is an integer larger than 1.
302. And selecting M areas in the N areas, wherein M is an integer which is larger than 0 and smaller than N.
303. And acquiring the identity information of the user.
Wherein the identity information may be at least one of the following information: fingerprint information, iris information, authentication code information, password information, and the like.
304. And verifying the identity information.
When the identity information is fingerprint information, matching the fingerprint information with preset fingerprint information, and if the matching is successful, executing step 305; when the identity information is iris information, matching the iris information with preset iris information, and if the matching is successful, executing step 305; when the identity information is verification code information, matching the verification code information with preset verification code information, and if the matching is successful, executing step 305; when the identity information is password information, the password information may be matched with the preset password information, and if the matching is successful, step 305 is executed. Of course, step 305 may be performed only if the identity information is verified, thus enhancing the security of the user's implementation of the present invention.
Of course, if the identity information is verification code information, the verification code information may be sent to the device by the server, and step 305 may be executed when the verification code information is received by the device and the verification code information is authenticated. Its main application scenario may be similar to the member service function, namely: only members can enjoy the function.
305. And when the identity information passes the verification, detecting whether a shaking event in a preset direction occurs.
306. Stretching the M regions along the preset direction when a shaking event in the preset direction is detected.
Of course, the specific description of the steps 301-302 and 305-306 in this embodiment can refer to the step 101-104 in the picture processing method described in fig. 1.
In accordance with the foregoing, the following are apparatuses and devices for implementing the above-described image processing method, and specifically the following are:
please refer to fig. 4a, which is a schematic structural diagram of a picture processing apparatus according to a first embodiment of the present invention. The image processing apparatus described in this embodiment includes: the acquiring unit 401, the selecting unit 402, the detecting unit 403 and the stretching unit 404 are specifically as follows:
an obtaining unit 401, configured to obtain a preset template, where the preset template includes N regions, and N is an integer greater than 1;
a selecting unit 402, configured to select M regions from the N regions, where M is an integer greater than 0 and smaller than N;
a detecting unit 403 for detecting whether a shaking event in a preset direction occurs;
a stretching unit 404, configured to stretch the M regions along the preset direction when a shaking event in the preset direction is detected.
Optionally, the detecting unit 403 is specifically configured to:
detecting whether the acceleration in the preset direction is larger than a first preset threshold value, and if so, determining that a shaking event in the preset direction is detected;
or,
detecting whether the shaking amplitude in the preset direction is larger than a second preset threshold value, and if so, determining that the shaking event in the preset direction is detected;
or,
and detecting whether the shaking frequency in the preset direction is greater than a third preset threshold value, and if so, determining that the shaking event in the preset direction is detected.
Optionally, the stretching unit 404 includes:
an obtaining module (not shown) for obtaining a shaking parameter of the shaking event;
and a stretching module (not shown) for stretching the M regions along the preset direction according to the shaking parameters.
Optionally, when a picture is included in a region i of the M regions, the region i is any one of the M regions,
the stretching unit is specifically configured to:
stretching the area i along the preset direction, and stretching the picture, wherein the stretching ratio of the area i is consistent with that of the picture.
Optionally, the detecting unit 403 is further configured to:
after the stretching unit stretches the M areas along the preset direction, whether the stretching proportion of any one of the M areas reaches a fourth preset threshold value is detected, and if yes, stretching of any one of the M areas is stopped.
Optionally, the stretching unit is specifically configured to:
and stretching the M areas along the preset direction on the premise of keeping the size of each of the M areas unchanged.
Optionally, the stretching unit 404 is further configured to:
after the stretching unit 404 stretches the M regions along the preset direction, stretching the M regions along the opposite direction when a shaking event in the opposite direction of the preset direction is detected.
Optionally, as shown in fig. 4b, the apparatus depicted in fig. 4a further comprises: the verification unit 405 is specifically as follows:
the obtaining unit 401 is configured to obtain the identity information of the user after the selecting unit 402 selects M of the N regions;
the verification unit 405 verifies the identity information, and when the identity information passes the verification, the detection unit 403 detects whether a shaking event in a preset direction occurs.
The image processing device described in the embodiment of the present invention can obtain the preset template, where the preset template includes N regions, N is an integer greater than 1, M regions out of the N regions are selected, M is an integer greater than 0 and less than N, whether a shaking event in a preset direction occurs is detected, and when a shaking event in the preset direction is detected, the M regions are stretched along the preset direction. Therefore, when a shaking event is detected, the area selected by the user can be stretched, so that a personalized template is provided for the user, and the personalized requirements of the user are met.
Fig. 5 is a schematic structural diagram of a picture processing apparatus according to an embodiment of the present invention. The apparatus described in this embodiment includes: processor 1000, memory 2000, communication interface 3000, and bus 4000; the processor 1000, the memory 2000 and the communication interface 3000 are connected through the bus 4000 to complete communication therebetween; the memory 2000 stores executable program code; the processor 1000 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 2000, so as to execute a picture processing method, which is as follows:
acquiring a preset template, wherein the preset template comprises N areas, and N is an integer greater than 1;
selecting M areas in the N areas, wherein M is an integer larger than 0 and smaller than N;
detecting whether a shaking event in a preset direction occurs;
stretching the M regions along the preset direction when a shaking event in the preset direction is detected.
Optionally, detecting whether a shaking event in a preset direction occurs comprises:
detecting whether the acceleration in the preset direction is larger than a first preset threshold value, and if so, determining that a shaking event in the preset direction is detected;
or,
detecting whether the shaking amplitude in the preset direction is larger than a second preset threshold value, and if so, determining that the shaking event in the preset direction is detected;
or,
and detecting whether the shaking frequency in the preset direction is greater than a third preset threshold value, and if so, determining that the shaking event in the preset direction is detected.
Optionally, stretching the M regions along the preset direction includes:
obtaining a shaking parameter of the shaking event;
and stretching the M areas along the preset direction according to the shaking parameters.
Optionally, when a picture is included in a region i of the M regions, the region i is any one of the M regions,
the stretching the M regions along the preset direction includes:
stretching the area i along the preset direction, and stretching the picture, wherein the stretching ratio of the area i is consistent with that of the picture.
Optionally, after the stretching the M regions along the preset direction, the method further includes:
and detecting whether the stretching proportion of any one of the M areas reaches a fourth preset threshold value, if so, stopping stretching any one of the M areas.
Optionally, the stretching the M regions along the preset direction includes:
and stretching the M areas along the preset direction on the premise of keeping the size of each of the M areas unchanged.
Optionally, after the stretching the M regions along the preset direction, the method further includes:
stretching the M regions along the opposite direction when a shaking event in the opposite direction of the preset direction is detected.
Optionally, after the selecting M of the N regions and before the detecting whether the shaking event along the preset direction occurs, the method further includes:
acquiring identity information of a user;
and verifying the identity information, and executing whether the detection is carried out to generate a shaking event in a preset direction when the identity information is verified to pass.
An embodiment of the present invention further provides a computer storage medium, where the computer storage medium may store a program, and when the program is executed, the program includes some or all of the steps of any one of the image processing methods described in the above method embodiments.
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus (device), or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. A computer program stored/distributed on a suitable medium supplied together with or as part of other hardware, may also take other distributed forms, such as via the Internet or other wired or wireless telecommunication systems.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the invention has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the invention. Accordingly, the specification and figures are merely exemplary of the invention as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.