Image processing method and apparatus, electronic device and computer-readable storage medium

11516411 · 2022-11-29

Assignee

Inventors

Cpc classification

International classification

Abstract

Disclosed are an image processing method and apparatus, an electronic device and a computer-readable storage medium. The method comprises: acquiring a video image; when a preset target is detected in the video image, superimposing a foreground sticker on a target image corresponding to the preset target; and when a preset action of the preset target in the video image is detected, generating a screen special effect, in the embodiments of the present disclosure, a video image is acquired, when a preset target is detected in the video image, a foreground sticker is superimposed on a target image corresponding to the preset target, and when a preset action of the preset target in the video image is detected, a screen special effect is generated, such that a screen special effect for the preset action of the preset target can be realized.

Claims

1. An image processing method, comprising: acquiring a video; superimposing a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video, wherein there is a first video sequence, and wherein the superimposing a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video further comprises selecting a first frame from the first video sequence as the foreground sticker; generating a screen special effect when it is detected that the preset target in the video generates a preset motion, wherein the generating a screen special effect when it is detected that the preset target in the video generates a preset motion further comprises periodically selecting, according to a superposition progress of the video, frames from other frames rather than the first frame in the first video sequence as a screen special effect image; and wherein the foreground sticker, the screen special effect, and a filter are arranged sequentially from back to front in a direction facing a screen.

2. The method according to claim 1, wherein the generating a screen special effect when it is detected that the preset target in the video generates a preset motion comprises: generating a distorted screen special effect image according to the foreground sticker when it is that the preset target in the video generates the preset motion.

3. The method according to claim 2, wherein the generating a distorted screen special effect image according to the foreground sticker when it is detected that the preset target in the video generates the preset motion comprises: for each pixel in the foreground sticker: determining an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion; and moving the pixel in the foreground sticker according to the offset to obtain the distorted screen special effect image.

4. The method according to claim 3, wherein the determining an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion comprises: acquiring at least one parameter of a height, an offset amplitude, a system time, a distortion coefficient, distortion density and a compensation coefficient of the video when it is detected that the preset target in the video generates the preset motion; and determining the offset of the pixel in the foreground sticker according to the at least one parameter.

5. The method according to claim 4, wherein the determining the offset of the pixel in the foreground sticker according to the at least one parameter comprises: determining a vertical offset of the pixel in the foreground sticker from an expression f ( x , y ) = { α sin ( β t + δ x ) + .Math. 1 , y < 0.5 α sin ( β t + δ x ) + .Math. 2 , y > 0.5 wherein x is an abscissa of the pixel, y is an ordinate of the pixel, α is the offset magnitude, β is the distortion coefficient, t is the system time, δ is the distortion density, ε.sub.1 and ε.sub.2 are compensation coefficients, and sin(.) is sine calculation.

6. The method according to claim 2, further comprising: performing filter processing on the screen special effect image; and rendering the filter-processed screen special effect image.

7. The method according to claim 6, wherein a filter comprises a second video sequence, and wherein the performing filter processing on the screen special effect image comprises: periodically selecting, according to a superposition progress of the video, frames from the second video sequence, as a filter image; and performing the filter processing on the screen special effect image with the filter image.

8. The method according to claim 6, further comprising: activating a second timer for timekeeping after it is detected that the preset target appears in the video and before the superimposing the foreground sticker on the target image corresponding to the preset target.

9. The method according to claim 8, further comprising: turning off the filter, the screen special effect, and the superimposed foreground sticker sequentially when a time period recorded by the second timer exceeds a preset time period.

10. The method according to claim 1, further comprising: controlling a period by a first timer.

11. An image processing apparatus for a preset motion, comprising: a memory configured to store non-transitory computer readable instructions; and a processor configured to execute the computer-readable instructions, to cause the processor to implement operations comprising: acquiring a video; superimposing a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video, wherein there is a first video sequence, and wherein the superimposing a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video further comprises selecting a first frame from the first video sequence as the foreground sticker; generating a screen special effect when it is detected that the preset target in the video generates a preset motion, wherein the generating a screen special effect when it is detected that the preset target in the video generates a preset motion further comprises periodically selecting, according to a superposition progress of the video, frames from other frames rather than the first frame in the first video sequence as a screen special effect image; and wherein the foreground sticker, the screen special effect, and a filter are arranged sequentially from back to front in a direction facing a screen.

12. The apparatus according to claim 11, wherein the processor configured to execute the computer-readable instructions, to cause the processor to implement operation comprising: generating a distorted screen special effect image according to the foreground sticker when it is detected that the preset target in the video generates the preset motion.

13. The apparatus according to claim 12, wherein the processor configured to execute the computer-readable instructions, to cause the processor to implement operation comprising: for each pixel in the foreground sticker: determining an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion; and moving the pixel in the foreground sticker according to the offset to obtain the distorted screen special effect image.

14. The apparatus according to claim 13, wherein the processor configured to execute the computer-readable instructions, to cause the processor to implement operations comprising: acquiring at least one parameter of a height, an offset amplitude, a system time, a distortion coefficient, distortion density and a compensation coefficient of the video when it is detected that the preset target in the video generates the preset motion; and determining the offset of the pixel in the foreground sticker according to the at least one parameter.

15. The apparatus according to claim 14, wherein the processor configured to execute the computer-readable instructions, to cause the processor to implement operation comprising: determining a vertical offset of the pixel in the foreground sticker from an expression f ( x , y ) = { α sin ( β t + δ x ) + .Math. 1 , y < 0.5 α sin ( β t + δ x ) + .Math. 2 , y > 0.5 wherein x is an abscissa of the pixel, y is an ordinate of the pixel, α is the offset magnitude, β is the distortion coefficient, t is the system time, δ is the distortion density, ε.sub.1 and ε.sub.2 are compensation coefficients, and sin(.) is sine calculation.

16. The apparatus according any one of claim 12, wherein the processor configured to execute the computer-readable instructions, to cause the processor to implement operations comprising: performing filter processing on the screen special effect image; and rendering the filter-processed screen special effect image.

17. A non-transitory computer-readable storage medium configured to store non-transitory computer-readable instructions which, when executed by a computer, cause the computer to implement operations comprising: acquiring a video: superimposing a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video, wherein there is a first video sequence, and wherein the superimposing a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video further comprises selecting a first frame from the first video sequence as the foreground sticker; generating a screen special effect when it is detected that the preset target in the video generates a preset motion, wherein the generating a screen special effect when it is detected that the preset target in the video generates a preset motion further comprises periodically selecting, according to a superposition progress of the video, frames from other frames rather than the first frame in the first video sequence as a screen special effect image; and wherein the foreground sticker, the screen special effect, and a filter are arranged sequentially from back to front in a direction facing a screen.

18. The non-transitory computer-readable storage medium of claim 17, the operations further comprising: generating a distorted screen special effect image according to the foreground sticker when it is detected that the preset target in the video generates the preset motion.

19. The non-transitory computer-readable storage medium of claim 18, the operation further comprising: for each pixel in the foreground sticker, determining an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion; and moving the pixel in the foreground sticker according to the offset to obtain the distorted screen special effect image.

20. The non-transitory computer-readable storage medium of claim 19, the operation further comprising: acquiring at least one parameter of a height, an offset amplitude, a system time, a distortion coefficient, distortion density and a compensation coefficient of the video when it is detected that the preset target in the video generates the preset motion; and determining the offset of the pixel in the foreground sticker according to the at least one parameter.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent from the illustrations in conjunction with the accompanying drawings and with reference to the following detailed description. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are illustrative only and that the components and elements are not necessarily drawn to scale.

(2) FIG. 1 is a schematic flowchart showing an image processing method according to an embodiment of the present disclosure;

(3) FIG. 2 is a schematic flowchart showing an image processing method according to an embodiment of the present disclosure;

(4) FIG. 3 is a schematic flowchart showing an image processing apparatus according to an embodiment of the present disclosure; and

(5) FIG. 4 is a schematic structural diagram showing an electronic device according to an embodiment of the present disclosure.

DETAILED DESCRIPTION OF EMBODIMENTS

(6) Embodiments of the present disclosure are described in more detail below with reference to the drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. These embodiments are provided for a thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the protection scope of the present disclosure.

(7) It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in a different order and/or in parallel. Furthermore, method embodiments may include additional steps and/or steps that are not listed. The scope of the present disclosure is not limited in this regard.

(8) The term “including” and variations thereof are open-ended inclusions, that is, “including but not limited to”. The term “based on” is “based at least in part on,” The term “an embodiment” means “at least one embodiment.” The term “another embodiment” means “at least one additional embodiment.” The term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms are given in the description below.

First Embodiment

(9) In order to solve the technical problem that there is no method for achieving an effect for a preset motion in the conventional technology, an image processing method is provided according to an embodiment of the present disclosure. As shown in FIG. 1, the image processing method includes steps S11 to S13 as follows.

(10) In step S11, a video is acquired.

(11) The video is a video stream inputted in real time, for example, a live video in a short video application, or a video pre-stored in a terminal. The terminal is a mobile terminal, such as a smart phone and a tablet computer, or a fixed terminal, for example, a desktop computer.

(12) In step S12, when it is detected that a preset target appears in the video, a foreground sticker is superimposed on a target image corresponding to the preset target.

(13) The preset target may be a preset gesture, such as an air punch, a scissor hand, or an ok gesture.

(14) The foreground sticker is a sticker serving as a foreground for the preset target, and may be acquired from the Internet.

(15) Detection is performed on the video based on an existing detection algorithm (for example, a neural network-based target detection algorithm, or a region-based target detection algorithm), to detect an image including the preset target.

(16) In step S13, a screen special effect is generated when it s detected that the preset target in the video generates a preset motion.

(17) The preset motion is associated with the preset target. For example, the preset motion corresponding to the air punch is a punching action.

(18) The screen special effect may be a screen shaking effect and/or a screen special effect image.

(19) The screen special effect image is generated according to the foreground sticker. Alternatively, the screen special effect is an image unrelated to the foreground sticker. The screen special effect image corresponds to the preset motion.

(20) According to the first embodiment of the present disclosure, a video is acquired. When it is detected that a preset target appears in the video, a foreground sticker is superimposed on a target image corresponding to the preset target. When it is detected that the preset target in the video image generates a preset motion, a screen special effect is generated, thereby achieving the screen special effect corresponding to the preset motion generated by the preset target.

(21) In an embodiment, step S13 includes: generating a distorted screen special effect image according to the foreground sticker when it is detected that the preset target in the video generates the preset motion.

(22) The screen special effect image is a vertically distorted foreground sticker, or a horizontally distorted foreground sticker, or a vertically and horizontally distorted foreground sticker.

(23) In an embodiment, the generating a distorted screen special effect image according to the foreground sticker when it is detected that the preset target in the video generates the preset motion includes: for each pixel in the foreground sticker: determining an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion; and moving the pixel in the foreground sticker according to the offset to obtain the distorted screen special effect image.

(24) The offset includes a vertical offset, or a horizontal offset. Alternatively, the offset includes a vertical offset and a horizontal offset.

(25) In an embodiment, the determining an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion includes: acquiring at least one parameter of a height, an offset amplitude, a system time, a distortion coefficient, distortion density and a compensation coefficient of the video when it is detected that the preset target in the video generates the preset motion; and determining the offset of the pixel in the foreground sticker according to the at least one parameter.

(26) The distortion factor is used to control a speed for distortion.

(27) The compensation factor is used to prevent a flicker.

(28) In an embodiment, determining the offset of the pixel in the foreground sticker according to the at least one parameter includes: determining a vertical offset of the pixel in the foreground sticker from an expression

(29) f ( x , y ) = { α sin ( β t + δ x ) + .Math. 1 , y < 0.5 α sin ( β t + δ x ) + .Math. 2 , y > 0.5 .

(30) x is an abscissa of the pixel, for example, a normalized abscissa, y is an ordinate of the pixel, for example, a normalized ordinate. α is the offset magnitude, for example, α=h/15, where h is the height of the video. β is the distortion coefficient for controlling the speed for distortion, for example, 30. t is the system time and has a unit of s. δ is the distortion density, for example, 2.7. ε.sub.1 and ε.sub.2 are compensation coefficients, and sin(.) is sine calculation.

(31) A case that the vertical offset is controlled based on a trigonometric function on the abscissa and the time only may result in a flicker on upper and lower borders. Therefore, the compensation coefficients ε.sub.1 and ε.sub.2 are provided, and are calculated from ε.sub.1=h/3 and ε.sub.2=−h/3, respectively.

(32) In an embodiment, the method further includes the following steps S14 to S15.

(33) In step S14, filter processing is performed on the screen special effect image.

(34) In step S15, the filter-processed screen special effect image is rendered.

(35) In an embodiment, the foreground sticker, the screen special effect, and the filter are arranged sequentially from back to front in a direction facing the screen.

(36) In an embodiment, the foreground sticker includes a first video sequence.

(37) Correspondingly, step S12 includes: selecting a first frame from the first video sequence, as the foreground sticker.

(38) Correspondingly, step S13 includes: according to a superposition progress of the video, periodically selecting frames from other frames rather than the first frame in the first video sequence, as the screen special effect image.

(39) The foreground sticker includes the video sequence. In order to ensure the synchronization of screen effects, a superposition period of the foreground sticker is the same as that of the filter. The period is determined depending on a frame rate of the video.

(40) In an embodiment, the filter includes a second video sequence.

(41) Correspondingly, step S14 includes the following steps S141 to S142.

(42) In step S141, according to the superposition progress of the video, frames are periodically selected from the second video sequence, as a filter image.

(43) The filter is in s multiply mode and includes a video sequence. A new video is used as a filter at 50-millisecond intervals.

(44) In step S142, filter processing is performed on the screen special effect image with the filter image.

(45) In an embodiment, the method further includes: controlling the period by a first timer.

(46) The period is controlled by setting the timer. The timer is activated at preset time intervals (for example, 50 ms).

(47) In an embodiment, after it is detected that the preset target appears in the video, and before superimposing the foreground sticker on the target image corresponding to the preset target, the method further includes: activating a second timer for timekeeping.

(48) In an embodiment, the method further includes: when a time period recorded by the second timer exceeds a preset time period, turning off the filter, the screen special effect, and the superimposed foreground sticker sequentially.

(49) In an embodiment, the foreground sticker, the screen special effect, and the filter are arranged sequentially from back to front in a direction facing the screen.

(50) The direction facing the screen is represented by coordinates in a direction of a three-dimensional coordinate system, for example, the z-axis direction. A coordinate of the foreground sticker, a coordinate of the screen special effect, and a coordinate of the filter are in descending order along the z-axis.

Second Embodiment

(51) This embodiment is a specific implementation for explaining the present disclosure. As shown in FIG. 2, the image processing method mainly includes the following steps S21 to S25.

(52) In step S21, a video is acquired.

(53) In step S22, when it is detected that a preset target appears in the video, a timer is activated for timekeeping.

(54) In step S23, a foreground sticker is superimposed.

(55) In step S24, when it is detected that the preset target in the video generates a preset motion, a screen special effect image is generated.

(56) In step S25, filter processing is performed on the screen special effect image.

(57) In step S26, the filter-processed screen special effect image is rendered.

(58) When a preset target is detected, the timer starts timekeeping with a time period of 2 seconds. In a process of timekeeping, three special effects are triggered, namely, superposing the foreground sticker, generating the screen special effect and generating the filter special effect. Respective heights of the three special effects are in descending order along the z-axis.

(59) The filter is in s multiply mode and includes a video sequence. A new video is used as a filter at 50-millisecond intervals, which is controlled by setting another timer that is activated at 50-millisecond intervals.

(60) The foreground sticker also includes a video sequence. In order to ensure the synchronization of effects, the same time is activated at 50-millisecond intervals.

(61) In step S27, when a time period recorded by the first timer exceeds a preset time period, the filter, the screen special effect, and the foreground sticker are turned off sequentially.

(62) The preset time period may be 2 s.

(63) It should be understood by those skilled in the art that modifications (for example, a combination of the listed modes) or equivalent substitutions may be made on the basis of the above embodiments.

(64) Although steps in the embodiments of the image processing method are described in the above order, it should be clear to those skilled in the art that the steps in the embodiments of the present disclosure are unnecessarily performed in the above order, and may also be performed in other order such as reversely, in parallel, and alternately. Moreover, those skilled in the art may add other steps based on the above steps, and these modifications or equivalent alternatives should also be included in the protection scope of the present disclosure, and are not repeated herein.

(65) Apparatus embodiments of the present disclosure are described below. The apparatus embodiments of the present disclosure are used to perform the steps implemented by the method embodiments of the present disclosure. For the convenience of description, only the parts related to the embodiments of the present disclosure are shown, and for the technical details are not disclosed in detail, reference is made to the method embodiments of the present disclosure.

Third Embodiment

(66) In order to solve the technical problem that there is no method for achieving an effect for a preset motion in the conventional technology, an image processing apparatus is provided according to an embodiment of the present disclosure. The apparatus is configured to perform the steps in the image processing method as described in the first embodiment. As shown in FIG. 3, the apparatus includes an image acquiring module 31, a sticker superimposing module 32, a special effect generating module 33.

(67) The image acquiring module 31 is configured to acquire a video.

(68) The sticker superimposing module 32 is configured to superimpose a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video.

(69) The special effect generating module 33 is configured to generate a screen special effect when it is detected that the preset target in the video generates a preset motion.

(70) The special effect generating module 33 is further configured to generate a distorted screen special effect image according to the foreground sticker when it is detected that the preset target in the video generates the preset motion.

(71) The special effect generating module 33 includes an offset determining unit 331 and a special effect generating unit 332.

(72) The offset determining unit 331 is configured to: for each pixel in the foreground sticker, determine an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion.

(73) The special effect generating unit 332 is configured to move the pixel in the foreground sticker according to the offset to obtain the distorted screen special effect image.

(74) The offset determining unit 331 is further configured to: acquire at least one of a height, an offset amplitude, a system time, a distortion coefficient, distortion density and a compensation coefficient of the video when it is detected that the preset target in the video generates the preset motion; and determine the offset of the pixel in the foreground sticker according to the at least one parameter.

(75) The offset determining unit 331 is further configured to: determining a vertical offset of the pixel in the foreground sticker from an expression

(76) f ( x , y ) = { α sin ( β t + δ x ) + .Math. 1 , y < 0.5 α sin ( β t + δ x ) + .Math. 2 , y > 0.5 .
where x is an abscissa of the pixel. y is an ordinate of the pixel. α is the offset magnitude. β is the distortion coefficient. t is the system time. δ is the distortion density. ε.sub.1 and ε.sub.2 are compensation coefficients, and sin(.) is sine calculation.

(77) Further, the apparatus includes a filter module 34 and an image rendering module 35.

(78) The filter module 34 is configured to perform filter processing on the screen special effect image.

(79) The image rendering module 35 is configured to render the filter-processed screen special effect image.

(80) Further, the foreground sticker includes a first video sequence.

(81) Correspondingly, the sticker superimposing module 32 is configured to select a first frame from the first video sequence, as the foreground sticker.

(82) Correspondingly, the special effect generating module 33 is configured to periodically select, according to a superposition progress of the video, frames from other frames rather than the first frame in the first video sequence, as the screen special effect image.

(83) Further, the filter includes a second video sequence.

(84) Correspondingly, the filter module 34 is configured to: periodically select, according to the superposition progress of the video, frames from the second video sequence, as a filter image; and perform the filter processing on the screen special effect image with the filter image.

(85) Further, the apparatus includes: a first timer module 36. The first timer module 36 is configured to control the period by a first timer.

(86) Further, the apparatus includes: a second timer module 37. The second timer module 37 is configured to activate a second timer for timekeeping after it is detected that the preset target appears in the video and before the foreground sticker is superimposed on the target image corresponding to the preset target.

(87) Further, the second timer module 37 is configured to: when a time period recorded by the second timer exceeds a preset time period, turn off the filter, the screen special effect, and the foreground sticker sequentially.

(88) Further, the foreground sticker, the screen special effect, and the filter are arranged sequentially from back to front in a direction facing the screen.

(89) For detailed descriptions of the operation principle and the technical effects achieved by embodiments of the image processing apparatus, reference is made to the relevant descriptions in the foregoing embodiments of the image processing method, which are not described in detail here.

Fourth Embodiment

(90) Reference is made to FIG. 4, which is a schematic structural diagram showing an electronic device 400 for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include but is not limited to a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia stacker), and a vehicle-mounted terminal (for example, a car navigation terminal) and a fixed terminal such as a digital TV, a desktop computer. The electronic device shown in FIG. 4 is only an example, and should impose no limitation on the function and scope of use of the embodiments of the present disclosure.

(91) As shown in FIG. 4, the electronic device 400 includes a processing device (for example, a central processing unit, a graphics processor) 401 that is configured to perform various appropriate actions and processing in accordance with a program stored in a read only memory (ROM) 402 or a program loaded into a random-access memory (RAM) 403 from a storage device 408. In the RAM 403, various programs and data necessary for the operation of the electronic device 400 are stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.

(92) Generally, the following devices are connected to the I/O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer and a gyroscope an output device 407 including, for example, a liquid crystal display (LCD), a speaker and a vibrator a storage device 408 including, for example, a tape and a hard disk; and a communication device 409. The communication device 409 allows electronic device 400 to communicate wirelessly or by wire with other devices to exchange data. Although FIG. 4 shows the electronic device 400 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer means may alternatively be implemented or provided.

(93) In particular, according to embodiments of the present disclosure, the processing described above with reference to the flowcharts may be implemented as computer software programs. For example, a computer program product including a computer program carried on a non-transitory computer readable medium are provided according to embodiments of the present disclosure, and the computer program includes program code for performing the method illustrated in the flowchart. In such embodiments, the computer program may be downloaded and installed from the network via the communication device 409, or from the storage device 408, or from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are implemented.

(94) It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. Specific examples of the computer readable storage medium may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random-access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), an optical fiber, a portable compact disk read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program capable of being used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, with computer-readable program code embodied thereon. Such propagated data signal may be in a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable signal medium can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The program code embodied on the computer-readable medium may be transmitted through suitable medium including, but not limited to, an electrical wire, an optical fiber cable, an RF (radio frequency) or the like, or any suitable combination of the foregoing.

(95) In some embodiments, the client and the server perform communication based on any currently known or future developed network protocol such as HTTP (hypertext transfer protocol), and may be interconnected with any form or medium of digital data communication (for example, a communication network). Examples of the communication networks include a local area network (“LAN”), a wide area network (“WAN”), the global network (for example, the Internet), and a peer-to-peer networks (for example, the ad hoc peer-to-peer network), as well as any currently known or future development network.

(96) The above computer-readable medium may be included in the above electronic device or may be separate from the electronic device.

(97) The above computer-readable medium carries one or more programs. When executing the one or more programs, the electronic device: acquires a video; superimposes a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video; and generates a screen special effect when it is detected that the preset target in the video generates a preset motion.

(98) The computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or a combination thereof. Such programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as the “C” language or similar programming languages. The program code may execute entirely on a user computer, partly on a user computer, as a stand-alone software package, partly on a user computer and partly on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, an Internet connection provided an Internet service provider).

(99) The flowcharts and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of the system, method and computer program product according to embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams represents a module, a program segment, or a portion of code that contains one or more executable instructions for implementing specified logical functions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may be implemented in an order different from the order noted in the drawings. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or may sometimes be executed in a reverse order, depending upon the functionality involved. It is also noted that each block in the block diagrams and/or flowchart illustrations, and a combination of blocks in the block diagrams and/or flowchart illustrations, may be implemented in a dedicated hardware-based system that performs specified functions or operations, or may be implemented in a combination of dedicated hardware and computer instructions.

(100) The units in the embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. The name of a unit does not, in any case, qualify the unit itself.

(101) The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, the hardware logic components include: a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), an application specific standard product (ASSP), a system on chip (SOCs), a complex programmable logical device (CPLDs) and the like.

(102) Throughout the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus, or device. The machine-readable medium max be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination of the foregoing. Specific examples of the machine-readable storage medium include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random-access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), an optical fiber, a portable compact disk read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

(103) An image processing method is provided according to one or more embodiments of the present disclosure. The method includes:

(104) acquiring a video;

(105) superimposing a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video; and

(106) generating a screen special effect when it is detected that the preset target in the video generates a preset motion.

(107) Further, the generating a screen special effect when it is detected that the preset target in the video generates a preset motion includes:

(108) generating a distorted screen special effect image according to the foreground sticker when it is detected that the preset target in the video generates the preset motion.

(109) Further, the generating a distorted screen special effect image according to the foreground sticker when it is detected that the preset target in the video generates the preset motion includes: for each pixel in the foreground sticker:

(110) determining an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion; and

(111) moving the pixel in the foreground sticker according to the offset to obtain the distorted screen special effect image.

(112) Further, the determining an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion includes:

(113) acquiring at least one parameter of a height, an offset amplitude, a system time, a distortion coefficient, distortion density and a compensation coefficient of the video when it is detected that the preset target in the video generates the preset motion; and

(114) determining the offset of the pixel in the foreground sticker according to the at least one parameter.

(115) Further, the determining the offset of the pixel in the foreground sticker according to the at least one parameter includes:

(116) determining a vertical offset of the pixel in the foreground sticker from an expression

(117) f ( x , y ) = { α sin ( β t + δ x ) + .Math. 1 , y < 0.5 α sin ( β t + δ x ) + .Math. 2 , y > 0.5

(118) where x is an abscissa of the pixel. y is an ordinate of the pixel. α is the offset magnitude. β is the distortion coefficient. t is the system time. δ is the distortion density ε.sub.1 and ε.sub.2 are compensation coefficients, and sin(.) is sine calculation.

(119) Further, the foreground sticker includes a first video sequence, where

(120) the superimposing a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video includes: selecting a first frame from the first video sequence, as the foreground sticker; and

(121) the generating a screen special effect when itis detected that the preset target in the video generates a preset motion includes: periodically selecting, according to a superposition progress of the video, frames from other frames rather than the first frame in the first video sequence, as a screen special effect image.

(122) Further, the method includes:

(123) performing filter processing on the screen special effect image; and

(124) rendering the filter-processed screen special effect image.

(125) Further, a filter includes a second video sequence, where

(126) the performing filter processing on the screen special effect image includes:

(127) periodically selecting, according to a superposition progress of the video, frames from the second video sequence, as a filter image; and

(128) performing the filter processing on the screen special effect image with the filter image.

(129) Further, the method includes:

(130) controlling a period by a first timer.

(131) Further, the method includes:

(132) activating a second timer for timekeeping after it is detected that the preset target appears in the video and before the superimposing the foreground sticker on the target image corresponding to the preset target.

(133) Further, the method includes:

(134) turning off the filter, the screen special effect, and the superimposed foreground sticker sequentially when a time period recorded by the second timer exceeds a preset time period.

(135) Further, a coordinate of the foreground sticker, a coordinate of the screen special effect, and a coordinate of the filter are in descending order in a direction facing a screen.

(136) An image processing apparatus is provided according to one or more embodiments of the present disclosure. The apparatus includes:

(137) an image acquiring module configured to acquire a video;

(138) a sticker superimposing module configured to superimpose a foreground sticker on a target image corresponding to a preset target when it is detected that the preset target appears in the video; and

(139) a special effect generating module configured to generate a screen special effect when it is detected that the preset target in the video generates a preset motion.

(140) Further, the special effect generating module is configured to: generate a distorted screen special effect image according to the foreground sticker when it is detected that the preset target in the video generates the preset motion.

(141) Further, the special effect generating module includes:

(142) an offset determining unit configured to determine an offset of the pixel in the foreground sticker when it is detected that the preset target in the video generates the preset motion; and

(143) a special effect generating unit configured to move the pixel in the foreground sticker according to the offset to obtain the distorted screen special effect image.

(144) Further, the offset determining unit is configured to: acquire at least one of a height, an offset amplitude, a system time, a distortion coefficient, distortion density and a compensation coefficient of the video when it is detected that the preset target in the video generates the preset motion; and determine the offset of the pixel in the foreground sticker according to the at least one parameter.

(145) Further, the offset determining unit is configured to: determining a vertical offset of the pixel in the foreground sticker from an expression

(146) f ( x , y ) = { α sin ( β t + δ x ) + .Math. 1 , y < 0.5 α sin ( β t + δ x ) + .Math. 2 , y > 0.5 .

(147) where x is an abscissa of the pixel. y is an ordinate of the pixel. α is the offset magnitude. β is the distortion coefficient. t is the system time. δ is the distortion density. ε.sub.1 and ε.sub.2 are compensation coefficients, and sin(.) is sine calculation.

(148) Further, the apparatus includes:

(149) a filter module configured to perform filter processing on the screen special effect image;

(150) and an image rendering module configured to render the filter-processed screen special effect image.

(151) Further, the foreground sticker includes a first video sequence, where the sticker superimposing module is configured to select a first frame from the first video sequence, as the foreground sticker, and the special effect generating module is configured to periodically select, according to a superposition progress of the video, frames from other frames rather than the first frame in the first video sequence, as the screen special effect image.

(152) Further, the filter includes a second video sequence, where the filter module is configured to: periodically select, according to the superposition progress of the video, frames from the second video sequence, as a filter image; and perform the filter processing on the screen special effect image with the filter image.

(153) Further, the apparatus includes:

(154) a first timer module configured to control the period by a first timer.

(155) Further, the apparatus includes:

(156) a second timer module configured to activate a second timer tier timekeeping after it is detected that the preset target appears in the video and before the foreground sticker is superimposed on the target image corresponding to the preset target.

(157) Further, the second timer module is configured to: when a time period recorded by the second timer exceeds a preset time period, turn off the filter, the screen special effect, and the foreground sticker sequentially.

(158) Further, the foreground sticker, the screen special effect, and the filter are arranged sequentially from back to front in a direction facing the screen.

(159) An electronic device is provided according to one or more embodiments of the present disclosure. The electronic device includes:

(160) a memory configured to store non-transitory computer readable instructions; and

(161) a processor configured to execute the computer-readable instructions, to cause the processor to implement the image processing method.

(162) A computer-readable storage medium is provided according to one or more embodiments of the present disclosure. The computer-readable storage medium is configured to store non-transitory computer-readable instructions which, when executed by a computer, cause the computer to implement the image processing method.

(163) The above description shows merely preferred embodiments of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features but covers other technical solutions formed by any combination of the above technical features or their equivalents without departing from the above disclosed concept, for example, technical solutions formed by replacing the above features with the technical features disclosed in (but not limited to) the present disclosure with similar functions.

(164) Additionally, although operations are described in a particular order, the operations are unnecessarily performed in the particular order as shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, although the above discussion contains several implementation-specific details, these should not be construed as limitations on the scope of the present disclosure. Some features that are described in the context of separate embodiments may be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment may also be implemented in multiple embodiments separately or in any suitable sub-combination.

(165) Although the subject matter has been described in language specific to structural features and/or logical acts of method, it should be understood that the subject matter defined in the appended claims is unnecessarily limited to the specific features or acts described above. In fact, the specific features and acts described above are merely example forms of implementing the claims.