CN108900903B - Video processing method and device, electronic equipment and storage medium - Google Patents

Video processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN108900903B
CN108900903B CN201810840172.8A CN201810840172A CN108900903B CN 108900903 B CN108900903 B CN 108900903B CN 201810840172 A CN201810840172 A CN 201810840172A CN 108900903 B CN108900903 B CN 108900903B
Authority
CN
China
Prior art keywords
image
processed
video frame
initial
reflection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810840172.8A
Other languages
Chinese (zh)
Other versions
CN108900903A (en
Inventor
黄明杨
郝元桢
石建萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sensetime Technology Development Co Ltd
Original Assignee
Beijing Sensetime Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sensetime Technology Development Co Ltd filed Critical Beijing Sensetime Technology Development Co Ltd
Priority to CN201810840172.8A priority Critical patent/CN108900903B/en
Publication of CN108900903A publication Critical patent/CN108900903A/en
Application granted granted Critical
Publication of CN108900903B publication Critical patent/CN108900903B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

The disclosure relates to a video processing method and apparatus, an electronic device, and a storage medium. The method comprises the following steps: determining a reflection area in a video frame to be processed of a video; determining an initial reflection image corresponding to the reflection region; and changing the coordinates of pixels in the initial reflection image according to the frame number of the video frame to be processed in the video to obtain a water ripple reflection image corresponding to the initial reflection image, and taking the water ripple reflection image as the image of the reflection area. The method and the device can realize the water ripple reflection effect in the video through lower calculation complexity, and meet the real-time requirement of video processing.

Description

Video processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer vision technologies, and in particular, to a video processing method and apparatus, an electronic device, and a storage medium.
Background
In video processing, a user may wish to add a specific special effect to a video to enhance the viewing of the video. The video processing method generally needs to process a large number of video frames in the video, and the related technology has high computational complexity and cannot meet the real-time requirement of video processing.
Disclosure of Invention
The present disclosure provides a video processing technical solution.
According to an aspect of the present disclosure, there is provided a video processing method including:
determining a reflection area in a video frame to be processed of a video;
determining an initial reflection image corresponding to the reflection region;
and changing the coordinates of pixels in the initial reflection image according to the frame number of the video frame to be processed in the video to obtain a water ripple reflection image corresponding to the initial reflection image, and taking the water ripple reflection image as the image of the reflection area.
In a possible implementation manner, determining an initial reflection image corresponding to the reflection region includes:
vertically overturning an image of a non-reflection area in the video frame to be processed to obtain an overturned image, wherein the non-reflection area represents an area except for the reflection area in the video frame to be processed;
and determining an initial reflection image corresponding to the reflection region according to the turnover image.
In a possible implementation manner, determining an initial reflection image corresponding to the reflection region according to the flip image includes:
and performing telescopic processing on the flip image in the vertical direction according to the height of the reflection area, so that the height of the flip image after telescopic processing is equal to the height of the reflection area, and obtaining an initial reflection image corresponding to the reflection area.
In a possible implementation manner, changing an abscissa of a pixel in the initial inverted image according to a frame number of the video frame to be processed in the video to obtain a moire inverted image corresponding to the initial inverted image, includes:
determining an offset coefficient corresponding to the video frame to be processed according to the frame number of the video frame to be processed in the video;
and changing the coordinates of the pixels in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed to obtain a water ripple inverted image corresponding to the initial inverted image.
In a possible implementation manner, determining an offset coefficient corresponding to the video frame to be processed according to the frame number of the video frame to be processed in the video includes:
and calculating a remainder obtained by dividing the frame number of the video frame to be processed in the video by the total frame number of a preset period, wherein the remainder is used as an offset coefficient corresponding to the video frame to be processed.
In a possible implementation manner, changing coordinates of pixels in the initial inverted image according to an offset coefficient corresponding to the video frame to be processed to obtain a moire inverted image corresponding to the initial inverted image, includes:
and changing the abscissa of the pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed to obtain a water ripple inverted image corresponding to the initial inverted image.
In a possible implementation manner, changing an abscissa of a pixel in the initial inverted image according to a shift coefficient corresponding to the video frame to be processed to obtain a moire inverted image corresponding to the initial inverted image includes:
and determining the horizontal coordinate of each changed pixel in the initial reflection image according to the offset coefficient corresponding to the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
In a possible implementation manner, determining, according to an offset coefficient corresponding to the video frame to be processed, an abscissa of each pixel in the initial reflection image, and an ordinate of each pixel in the initial reflection image, a changed abscissa of each pixel in the initial reflection image, to obtain a moire reflection image corresponding to the initial reflection image, includes:
and determining the horizontal coordinate of each pixel in the initial reflection image after being changed according to the offset coefficient corresponding to the video frame to be processed, the height of the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
In one possible implementation, after taking the water ripple reflection image as the image of the reflection region, the method further includes:
and fusing the video frame to be processed and the superposition layer.
In a possible implementation manner, the fusing the to-be-processed video frame and the overlay layer includes:
determining a mask area in the superimposed layer;
determining the pixel value of the mask area according to the pixel value of the superposition image layer;
and determining the pixel value of a non-mask area according to the pixel value of the video frame to be processed and the pixel value of the superposition layer, wherein the non-mask area represents an area except the mask area in the superposition layer.
In a possible implementation manner, determining a pixel value of a non-mask region according to a pixel value of the video frame to be processed and a pixel value of the overlay layer includes:
and overlapping the video frame to be processed and the overlapped layer in the non-mask area in a positive bottom overlapping mode, and determining the pixel value of the non-mask area.
According to an aspect of the present disclosure, there is provided a video processing apparatus including:
the first determining module is used for determining a reflection area in a video frame to be processed of a video;
the second determining module is used for determining an initial reflection image corresponding to the reflection region;
and the processing module is used for changing the coordinates of pixels in the initial reflection image according to the frame number of the video frame to be processed in the video to obtain a water ripple reflection image corresponding to the initial reflection image, and taking the water ripple reflection image as the image of the reflection area.
In one possible implementation manner, the second determining module includes:
the vertical overturning submodule is used for vertically overturning the image of a non-inverted image area in the video frame to be processed to obtain an overturning image, wherein the non-inverted image area represents an area except the inverted image area in the video frame to be processed;
and the first determining submodule is used for determining an initial reflection image corresponding to the reflection region according to the turnover image.
In one possible implementation, the first determining sub-module is configured to:
and performing telescopic processing on the flip image in the vertical direction according to the height of the reflection area, so that the height of the flip image after telescopic processing is equal to the height of the reflection area, and obtaining an initial reflection image corresponding to the reflection area.
In one possible implementation, the processing module includes:
the second determining submodule is used for determining an offset coefficient corresponding to the video frame to be processed according to the frame number of the video frame to be processed in the video;
and the processing submodule is used for changing the coordinates of the pixels in the initial reflection image according to the offset coefficient corresponding to the video frame to be processed to obtain the water ripple reflection image corresponding to the initial reflection image.
In one possible implementation, the second determining submodule is configured to:
and calculating a remainder obtained by dividing the frame number of the video frame to be processed in the video by the total frame number of a preset period, wherein the remainder is used as an offset coefficient corresponding to the video frame to be processed.
In one possible implementation, the processing submodule is configured to:
and changing the abscissa of the pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed to obtain a water ripple inverted image corresponding to the initial inverted image.
In one possible implementation, the processing submodule is configured to:
and determining the horizontal coordinate of each changed pixel in the initial reflection image according to the offset coefficient corresponding to the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
In one possible implementation, the processing submodule is configured to:
and determining the horizontal coordinate of each pixel in the initial reflection image after being changed according to the offset coefficient corresponding to the video frame to be processed, the height of the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
In one possible implementation, the apparatus further includes:
and the fusion module is used for fusing the video frame to be processed and the superposition layer.
In one possible implementation, the fusion module includes:
a third determining submodule, configured to determine a mask area in the overlay layer;
a fourth determining submodule, configured to determine a pixel value of the mask region according to the pixel value of the superimposed layer;
and a fifth determining submodule, configured to determine a pixel value of a non-mask region according to the pixel value of the video frame to be processed and the pixel value of the overlay layer, where the non-mask region represents a region in the overlay layer other than the mask region.
In one possible implementation, the fifth determining submodule is configured to:
and overlapping the video frame to be processed and the overlapped layer in the non-mask area in a positive bottom overlapping mode, and determining the pixel value of the non-mask area.
According to an aspect of the present disclosure, there is provided an electronic device including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: the above-described video processing method is performed.
According to an aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described video processing method.
In the embodiment of the disclosure, the inversion region in the to-be-processed video frame of the video is determined, the initial inversion image corresponding to the inversion region is determined, the coordinates of the pixels in the initial inversion image are changed according to the frame number of the to-be-processed video frame in the video, the moire inversion image corresponding to the initial inversion image is obtained, and the moire inversion image is used as the image of the inversion region, so that the moire inversion effect can be realized in the video with low calculation complexity, the effect is real, and the real-time requirement of video processing is met.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flow diagram of a video processing method according to an embodiment of the present disclosure.
Fig. 2 shows a flowchart of video processing method step S12 according to an embodiment of the present disclosure.
Fig. 3 shows a schematic diagram of a video frame to be processed in a video processing method according to an embodiment of the present disclosure.
Fig. 4 shows a schematic diagram of a reflection region and a non-reflection region in a video frame to be processed in a video processing method according to an embodiment of the present disclosure.
Fig. 5 illustrates a schematic diagram of flipping an image in a video processing method according to an embodiment of the present disclosure.
Fig. 6 illustrates a schematic diagram of an initial reflection image in a video processing method according to an embodiment of the present disclosure.
Fig. 7 shows another schematic diagram of an initial reflection image in a video processing method according to an embodiment of the present disclosure.
Fig. 8 shows an exemplary flowchart of a video processing method in step S13 according to the frame number of the video frame to be processed in the video, changing the coordinates of the pixels in the initial inverted image, and obtaining a water ripple inverted image corresponding to the initial inverted image.
Fig. 9 shows a schematic diagram of a water ripple deformation function in a video processing method according to an embodiment of the present disclosure.
Fig. 10 illustrates a schematic diagram of a water ripple reflection image in a video processing method according to an embodiment of the present disclosure.
Fig. 11 illustrates a schematic diagram of a water ripple reflection image as an image of a reflection region in a video processing method according to an embodiment of the present disclosure.
Fig. 12 shows an exemplary flowchart of a video processing method according to an embodiment of the present disclosure.
Fig. 13 shows an exemplary flowchart of step S14 of the video processing method according to the embodiment of the present disclosure.
Fig. 14 shows a schematic diagram of a fused image obtained by fusing a video frame to be processed and an overlay layer in a video processing method according to an embodiment of the present disclosure.
Fig. 15 shows a block diagram of a video processing apparatus according to an embodiment of the present disclosure.
Fig. 16 shows an exemplary block diagram of a video processing apparatus according to an embodiment of the present disclosure.
Fig. 17 is a block diagram illustrating an electronic device 800 in accordance with an example embodiment.
FIG. 18 is a block diagram illustrating an electronic device 1900 according to an example embodiment.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
Fig. 1 shows a flow diagram of a video processing method according to an embodiment of the present disclosure. As shown in fig. 1, the method includes steps S11 through S13.
In step S11, a reflection area in a video frame to be processed of the video is determined.
The video of the embodiments of the present disclosure may be any video that needs to be processed. For example, the video of the embodiment of the present disclosure may be a video shot in non-real time, and may also be a video shot in real time. The video frames to be processed of the video represent the video frames in the video that need to be processed. In the embodiment of the present disclosure, a part of video frames of a video may be used as video frames to be processed, and all video frames of the video may also be used as video frames to be processed. For a non-real-time shot video, whether each video frame of the video is a video frame to be processed or not can be determined in advance according to the frame number of each video frame of the video in the video; for the video shot in real time, whether each video frame of the video is a video frame to be processed or not can be determined in real time according to the frame number of each video frame of the video in the video.
The frame number of the video frame to be processed in the video indicates that the video frame to be processed is the number of frames in the video. For example, the frame number of the video frame to be processed in the video is p, which indicates that the video frame to be processed is the p-th frame in the video. For both non-live captured video and live captured video, the number of frames in the video of the video to be processed can be counted from the first frame of the video.
In one possible implementation, the preset reflection area may be used as the reflection area in the video frame to be processed. In this implementation, the size and position of the reflection region and the non-reflection region in each video frame may be set in advance, thereby determining the reflection region in the video frame to be processed.
In another possible implementation manner, the reflection area in the video frame to be processed may be determined according to an instruction for selecting the reflection area. In the implementation mode, the user can select the reflection area in the video frame to be processed according to the actual application scene requirement and/or personal preference, so that the personalized requirement of the user is met.
In another possible implementation, a boundary between a water surface and a non-water surface in the video frame to be processed may be identified, and a reflection area in the video frame to be processed may be determined according to the boundary and the position of the water surface. In this implementation, if the video frame to be processed includes a water surface, a boundary between a water surface and a non-water surface in the video frame to be processed may be identified, and a reflection region in the video frame to be processed may be determined according to the boundary and a position of the water surface. According to the implementation mode, the inverted image area in the video frame to be processed can be automatically determined, and the accuracy is high.
In step S12, an initial reflection image corresponding to the reflection region is determined.
In the embodiment of the present disclosure, the initial reflection image corresponding to the reflection region may be determined according to the image of the non-reflection region, so as to achieve an effect of displaying the reflection of the image content of the non-reflection region in the reflection region.
In step S13, the coordinates of the pixels in the initial reflection image are changed according to the number of the video frames to be processed in the video, so as to obtain a water ripple reflection image corresponding to the initial reflection image, and the water ripple reflection image is used as the image of the reflection area.
In the embodiment of the present disclosure, since the number of frames in the video of each to-be-processed video frame is different, the coordinates of the pixels in the initial reflection image are changed based on the number of frames in the video of the to-be-processed video frame, and the degree of change of the corresponding changed coordinates of each to-be-processed video frame is also different. As the frame number of the video frame to be processed in the video changes, the ripple effect in different video frames to be processed moves along the axial direction, so that the water flow ripple effect is generated, and the ripple can present irregular ripple.
In one possible implementation, the abscissa of the pixel in the initial reflection image may be changed according to the number of frames of the video frame to be processed in the video.
The method and the device for processing the water ripple image have the advantages that the inverted image area in the video frame to be processed of the video is determined, the initial inverted image corresponding to the inverted image area is determined, the coordinates of the pixels in the initial inverted image are changed according to the frame number of the video frame to be processed in the video, the water ripple inverted image corresponding to the initial inverted image is obtained, and the water ripple inverted image is used as the image of the inverted image area, so that the water ripple inverted image effect can be achieved in the video through low calculation complexity, the effect is real, and the real-time requirement of video processing is met.
Fig. 2 shows a flowchart of video processing method step S12 according to an embodiment of the present disclosure. As shown in fig. 2, step S12 may include step S121 and step S122.
In step S121, the image of the non-inverted area in the video frame to be processed is vertically inverted to obtain an inverted image, where the non-inverted area represents an area outside the inverted area in the video frame to be processed.
Fig. 3 shows a schematic diagram of a video frame to be processed in a video processing method according to an embodiment of the present disclosure.
Fig. 4 shows a schematic diagram of a reflection region and a non-reflection region in a video frame to be processed in a video processing method according to an embodiment of the present disclosure. In the example shown in fig. 4, the reflection area 41 is above the video frame to be processed, and the non-reflection area 42 is below the video frame to be processed. In other examples, the reflection area is below the video frame to be processed, and the non-reflection area is above the video frame to be processed.
Fig. 5 illustrates a schematic diagram of flipping an image in a video processing method according to an embodiment of the present disclosure. The inverted image in fig. 5 is obtained by vertically inverting the image of the non-inverted area 42 in fig. 4.
In step S122, an initial reflection image corresponding to the reflection region is determined from the inverted image.
In a possible implementation manner, determining an initial reflection image corresponding to the reflection region according to the reversed image includes: and if the height of the reversed image is equal to that of the reflection area, taking the reversed image as an initial reflection image corresponding to the reflection area.
In another possible implementation manner, determining an initial reflection image corresponding to the reflection region according to the flipped image includes: and performing telescopic processing on the reversed image in the vertical direction according to the height of the reflection area, so that the height of the reversed image after telescopic processing is equal to the height of the reflection area, and obtaining an initial reflection image corresponding to the reflection area. In the implementation mode, if the height of the reversed image is greater than that of the reflection region, the reversed image is compressed in the vertical direction, so that the height of the compressed reversed image is equal to that of the reflection region, and an initial reflection image corresponding to the reflection region is obtained; and if the height of the reversed image is smaller than that of the reflection area, stretching the reversed image in the vertical direction to enable the height of the stretched reversed image to be equal to that of the reflection area, and obtaining an initial reflection image corresponding to the reflection area. Fig. 6 illustrates a schematic diagram of an initial reflection image in a video processing method according to an embodiment of the present disclosure. According to this implementation, the reflection of the image of the entire non-reflection area can be displayed in the reflection area.
In another possible implementation manner, determining an initial reflection image corresponding to the reflection region according to the flipped image includes: and if the height of the reflection area is smaller than that of the reversed image, intercepting the image of the reversed image with the same height as that of the reflection area on the boundary line side as an initial reflection image corresponding to the reflection area. In this implementation, the portion of the inverted image on the boundary line side represents the portion of the original inverted image that is connected to the inverted region. For example, if the reflection area is above the video frame to be processed and the non-reflection area is below the video frame to be processed, then the image with the same height as the reflection area on the boundary side of the reversed image is captured, which means that the image with the same height as the reflection area below the reversed image is captured; if the inverted image is below the video frame to be processed and the non-inverted image is above the video frame to be processed, intercepting the image of which the height of the inverted image on the boundary side is the same as that of the inverted image refers to intercepting the image of which the height above the inverted image is the same as that of the inverted image. Fig. 7 shows another schematic diagram of an initial reflection image in a video processing method according to an embodiment of the present disclosure.
Fig. 8 shows an exemplary flowchart of a video processing method in step S13 according to the frame number of the video frame to be processed in the video, changing the coordinates of the pixels in the initial inverted image, and obtaining a water ripple inverted image corresponding to the initial inverted image. As shown in fig. 8, changing the coordinates of the pixels in the initial inverted image according to the number of the video frames to be processed in the video to obtain the moire inverted image corresponding to the initial inverted image may include steps S131 and S132.
In step S131, an offset coefficient corresponding to the video frame to be processed is determined according to the frame number of the video frame to be processed in the video.
In a possible implementation manner, determining an offset coefficient corresponding to a video frame to be processed according to a frame number of the video frame to be processed in the video includes: and calculating a remainder obtained by dividing the frame number of the video frame to be processed in the video by the total frame number of the preset period, wherein the remainder is used as an offset coefficient corresponding to the video frame to be processed.
For example, if the number of frames of the video frame to be processed in the video is p, the total number of frames of the preset period is T, and a remainder obtained by dividing p by T is T, then T may be used as the offset coefficient corresponding to the video frame to be processed.
In the embodiment of the present disclosure, as the number of frames of a video frame to be processed in the video changes, the offset coefficient corresponding to the video frame to be processed changes.
It should be noted that, although the determination manner of the offset coefficient is described above by taking the remainder obtained by dividing the number of frames of the to-be-processed video frame in the video by the total number of frames of the preset period as the offset coefficient corresponding to the to-be-processed video frame as an example, it can be understood by those skilled in the art that the present disclosure should not be limited thereto. The skilled person can flexibly set the mode of determining the offset coefficient corresponding to the video frame to be processed according to the actual application scene requirement and/or personal preference, as long as the mode is determined according to the frame number of the video frame to be processed in the video.
In step S132, the coordinates of the pixels in the initial inverted image are changed according to the offset coefficient corresponding to the video frame to be processed, so as to obtain a moire inverted image corresponding to the initial inverted image.
In the embodiment of the present disclosure, since the number of frames in the video of each to-be-processed video frame is different, the offset coefficient corresponding to each to-be-processed video frame is different. The degree of change in the coordinates is different based on the different offset coefficients.
In a possible implementation manner, changing coordinates of pixels in the initial inverted image according to an offset coefficient corresponding to a video frame to be processed to obtain a moire inverted image corresponding to the initial inverted image, includes: and changing the abscissa of the pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed to obtain the water ripple inverted image corresponding to the initial inverted image.
In a possible implementation manner, changing the abscissa of a pixel in an initial inverted image according to a shift coefficient corresponding to a video frame to be processed to obtain a water ripple inverted image corresponding to the initial inverted image, includes: and determining the abscissa of each changed pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed, the abscissa of each pixel in the initial inverted image and the ordinate of each pixel in the initial inverted image, so as to obtain the water ripple inverted image corresponding to the initial inverted image.
In a possible implementation manner, determining, according to an offset coefficient corresponding to a video frame to be processed, an abscissa of each pixel in an initial reflection image, and an ordinate of each pixel in the initial reflection image, a changed abscissa of each pixel in the initial reflection image, to obtain a moire reflection image corresponding to the initial reflection image, includes: and determining the horizontal coordinate of each changed pixel in the initial reflection image according to the offset coefficient corresponding to the video frame to be processed, the height of the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
The video frame to be processed is a static image, and the height of the video frame to be processed is the height of the static image.
In a possible implementation manner, the moire deformation function may be determined according to the offset coefficient corresponding to the video frame to be processed and the height of the video frame to be processed.
As one example of this implementation, the water ripple deformation function may be
Figure BDA0001745401980000132
y2=y1. Wherein (x)1,y1) (x) is the pixel coordinate in the initial reflection image2,y2) Is the pixel coordinate in the water ripple reflection image, t represents the offset coefficient, h represents the height of the video frame to be processed, a1、a2And a3Is a coefficient of1、a2And a3Can be determined according to the actual application requirements. By using the water ripple deformation function, the coordinate (x) in the initial reflection image can be converted1,y1) As the coordinates (x) in the water-ripple-inverted image2,y2) The pixel value of (2).
For example, the water ripple deformation function is
Figure BDA0001745401980000131
Fig. 9 shows a schematic diagram of a water ripple deformation function in a video processing method according to an embodiment of the present disclosure.
Fig. 10 illustrates a schematic diagram of a water ripple reflection image in a video processing method according to an embodiment of the present disclosure. Fig. 11 illustrates a schematic diagram of a water ripple reflection image as an image of a reflection region in a video processing method according to an embodiment of the present disclosure.
Fig. 12 shows an exemplary flowchart of a video processing method according to an embodiment of the present disclosure. As shown in fig. 12, the method may include steps S11 through S14.
In step S11, a reflection area in a video frame to be processed of the video is determined.
In step S12, an initial reflection image corresponding to the reflection region is determined.
In step S13, the coordinates of the pixels in the initial reflection image are changed according to the number of the video frames to be processed in the video, so as to obtain a water ripple reflection image corresponding to the initial reflection image, and the water ripple reflection image is used as the image of the reflection area.
In step S14, the video frame to be processed and the overlay layer are fused.
The superimposed layer may be any layer that needs to be fused with the video frame to be processed. For example, the overlay layer may have a water surface effect. The video frames to be processed are fused with the superposition with the water surface effect, so that the water surface texture effect of the video frames to be processed can be increased.
Fig. 13 shows an exemplary flowchart of step S14 of the video processing method according to the embodiment of the present disclosure. As shown in fig. 13, step S14 may include steps S141 to S143.
In step S141, a mask region in the superimposed layer is determined.
In the embodiment of the present disclosure, the masked region may represent a region that is not required to be fused with the video frame to be processed in the overlay layer, and the unmasked region may represent a region that is required to be fused with the video frame to be processed in the overlay layer.
In a possible implementation manner, the mask area in the overlay layer may be determined according to an instruction for selecting the mask area. According to the implementation mode, the mask area in the superposed layer can be determined according to the user requirement.
In another possible implementation manner, a preset mask region may be used as the mask region in the superimposed layer. In this implementation manner, the sizes and positions of the mask region and the unmasked region in the overlay layer may be preset, so as to determine the mask region in the overlay layer.
In step S142, the pixel value of the mask region is determined according to the pixel value of the superimposed layer.
In one possible implementation, the pixel values of the mask regions may be determined solely from the pixel values of the superimposed layer. For example, the pixel value of the superimposed layer may be taken as the pixel value of the corresponding coordinate in the mask region.
In step S143, a pixel value of a non-mask region is determined according to a pixel value of the video frame to be processed and a pixel value of the overlay layer, where the non-mask region represents a region outside the mask region in the overlay layer.
In the embodiment of the present disclosure, the pixel values of the non-mask region are determined by the pixel values of the video frame to be processed and the pixel values of the corresponding coordinates in the overlay layer.
In a possible implementation manner, determining a pixel value of a non-mask area according to a pixel value of a video frame to be processed and a pixel value of an overlay layer includes: and overlapping the video frame to be processed and the overlapped layer in the non-mask area in a positive bottom overlapping mode, and determining the pixel value of the non-mask area. For example, the pixel value of a coordinate on the non-mask area may be equal to the pixel value of the coordinate on the video frame to be processed × the pixel value of the coordinate on the overlay layer/255.
Fig. 14 shows a schematic diagram of a fused image obtained by fusing a video frame to be processed and an overlay layer in a video processing method according to an embodiment of the present disclosure.
In a possible implementation manner, after the video frame to be processed and the overlay layer are fused, the processed video frame to be processed may be output to a screen in real time and displayed.
Because the embodiment of the disclosure can realize the water ripple reflection effect in the video through lower computation complexity, the embodiment of the disclosure can be applied to application scenes such as video recording and live broadcasting platforms and the like which need to process the video in real time.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted.
In addition, the present disclosure also provides an image processing apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any one of the image processing methods provided by the present disclosure, and the descriptions and corresponding descriptions of the corresponding technical solutions and the corresponding descriptions in the methods section are omitted for brevity.
Fig. 15 shows a block diagram of a video processing apparatus according to an embodiment of the present disclosure. As shown in fig. 15, the apparatus includes: a first determining module 21, configured to determine a reflection area in a to-be-processed video frame of a video; a second determining module 22, configured to determine an initial reflection image corresponding to the reflection region; and the processing module 23 is configured to change coordinates of pixels in the initial reflection image according to the number of frames of the video frame to be processed in the video, to obtain a water ripple reflection image corresponding to the initial reflection image, and use the water ripple reflection image as an image of the reflection region.
Fig. 16 shows an exemplary block diagram of a video processing apparatus according to an embodiment of the present disclosure. As shown in fig. 16:
in one possible implementation, the second determining module 22 includes: the vertical flipping submodule 221 is configured to vertically flip an image of a non-inverted area in the video frame to be processed to obtain a flipped image, where the non-inverted area indicates an area outside the inverted area in the video frame to be processed; the first determining sub-module 222 is configured to determine, according to the flipped image, an initial reflection image corresponding to the reflection region.
In one possible implementation, the first determining submodule 222 is configured to: and performing telescopic processing on the reversed image in the vertical direction according to the height of the reflection area, so that the height of the reversed image after telescopic processing is equal to the height of the reflection area, and obtaining an initial reflection image corresponding to the reflection area.
In one possible implementation, the processing module 23 includes: the second determining submodule 231, configured to determine, according to the frame number of the to-be-processed video frame in the video, an offset coefficient corresponding to the to-be-processed video frame; and the processing submodule 232 is configured to change the abscissa of the pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed, so as to obtain a water ripple inverted image corresponding to the initial inverted image.
In one possible implementation, the second determining submodule 231 is configured to: and calculating a remainder obtained by dividing the frame number of the video frame to be processed in the video by the total frame number of the preset period, wherein the remainder is used as an offset coefficient corresponding to the video frame to be processed.
In one possible implementation, the processing submodule 232 is configured to: and changing the abscissa of the pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed to obtain the water ripple inverted image corresponding to the initial inverted image.
In one possible implementation, the processing submodule 232 is configured to: and determining the abscissa of each changed pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed, the abscissa of each pixel in the initial inverted image and the ordinate of each pixel in the initial inverted image, so as to obtain the water ripple inverted image corresponding to the initial inverted image.
In one possible implementation, the processing submodule 232 is configured to: and determining the horizontal coordinate of each changed pixel in the initial reflection image according to the offset coefficient corresponding to the video frame to be processed, the height of the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
In one possible implementation, the apparatus further includes: and the fusion module 24 is configured to fuse the video frame to be processed and the overlay layer.
In one possible implementation, the fusion module 24 includes: a third determining submodule 241, configured to determine a mask region in the superimposed layer; a fourth determining sub-module 242, configured to determine a pixel value of the mask region according to the pixel value of the superimposed layer; the fifth determining submodule 243 is configured to determine a pixel value of a non-mask region according to a pixel value of the video frame to be processed and a pixel value of the superimposed layer, where the non-mask region represents a region outside the mask region in the superimposed layer.
In one possible implementation, the fifth determining submodule 243 is configured to: and overlapping the video frame to be processed and the overlapped layer in the non-mask area in a positive bottom overlapping mode, and determining the pixel value of the non-mask area.
The method and the device for processing the water ripple image have the advantages that the inverted image area in the video frame to be processed of the video is determined, the initial inverted image corresponding to the inverted image area is determined, the coordinates of the pixels in the initial inverted image are changed according to the frame number of the video frame to be processed in the video, the water ripple inverted image corresponding to the initial inverted image is obtained, and the water ripple inverted image is used as the image of the inverted image area, so that the water ripple inverted image effect can be achieved in the video through low calculation complexity, the effect is real, and the real-time requirement of video processing is met.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-mentioned method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured as the above method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 17 is a block diagram illustrating an electronic device 800 in accordance with an example embodiment. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 17, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
FIG. 18 is a block diagram illustrating an electronic device 1900 according to an example embodiment. For example, the electronic device 1900 may be provided as a server. Referring to fig. 18, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, 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/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (22)

1. A video processing method, comprising:
determining a reflection area in a video frame to be processed of a video;
determining an initial reflection image corresponding to the reflection region;
determining an offset coefficient corresponding to the video frame to be processed according to the frame number of the video frame to be processed in the video, changing the coordinates of pixels in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed to obtain a water ripple inverted image corresponding to the initial inverted image, and taking the water ripple inverted image as an image of the inverted image area, wherein the frame number of the video frame to be processed in the video is p, which indicates that the video frame to be processed is the p-th frame in the video, and p is a positive integer.
2. The method of claim 1, wherein determining the initial reflection image corresponding to the reflection region comprises:
vertically overturning an image of a non-reflection area in the video frame to be processed to obtain an overturned image, wherein the non-reflection area represents an area except for the reflection area in the video frame to be processed;
and determining an initial reflection image corresponding to the reflection region according to the turnover image.
3. The method of claim 2, wherein determining an initial reflection image corresponding to the reflection region according to the flipped image comprises:
and performing telescopic processing on the flip image in the vertical direction according to the height of the reflection area, so that the height of the flip image after telescopic processing is equal to the height of the reflection area, and obtaining an initial reflection image corresponding to the reflection area.
4. The method according to claim 1, wherein determining the offset coefficient corresponding to the video frame to be processed according to the frame number of the video frame to be processed in the video comprises:
and calculating a remainder obtained by dividing the frame number of the video frame to be processed in the video by the total frame number of a preset period, wherein the remainder is used as an offset coefficient corresponding to the video frame to be processed.
5. The method according to claim 1, wherein changing coordinates of pixels in the initial inverted image according to a shift coefficient corresponding to the video frame to be processed to obtain a moire inverted image corresponding to the initial inverted image comprises:
and changing the abscissa of the pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed to obtain a water ripple inverted image corresponding to the initial inverted image.
6. The method according to claim 5, wherein changing the abscissa of the pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed to obtain a moire inverted image corresponding to the initial inverted image comprises:
and determining the horizontal coordinate of each changed pixel in the initial reflection image according to the offset coefficient corresponding to the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
7. The method according to claim 6, wherein determining the changed abscissa of each pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed, the abscissa of each pixel in the initial inverted image, and the ordinate of each pixel in the initial inverted image, to obtain the moire inverted image corresponding to the initial inverted image, comprises:
and determining the horizontal coordinate of each pixel in the initial reflection image after being changed according to the offset coefficient corresponding to the video frame to be processed, the height of the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
8. The method according to any one of claims 1 to 3, wherein after taking the water ripple reflection image as the image of the reflection region, the method further comprises:
and fusing the video frame to be processed and the superposition layer.
9. The method according to claim 8, wherein fusing the video frame to be processed with the overlay layer comprises:
determining a mask area in the superimposed layer;
determining the pixel value of the mask area according to the pixel value of the superposition image layer;
and determining the pixel value of a non-mask area according to the pixel value of the video frame to be processed and the pixel value of the superposition layer, wherein the non-mask area represents an area except the mask area in the superposition layer.
10. The method according to claim 9, wherein determining pixel values of unmasked areas according to the pixel values of the video frame to be processed and the pixel values of the overlay layer comprises:
and overlapping the video frame to be processed and the overlapped layer in the non-mask area in a positive bottom overlapping mode, and determining the pixel value of the non-mask area.
11. A video processing apparatus, comprising:
the first determining module is used for determining a reflection area in a video frame to be processed of a video;
the second determining module is used for determining an initial reflection image corresponding to the reflection region;
the processing module is used for changing the coordinates of pixels in the initial inverted image according to the frame number of the video frame to be processed in the video to obtain a water ripple inverted image corresponding to the initial inverted image, and taking the water ripple inverted image as an image of the inverted region, wherein the frame number of the video frame to be processed in the video is p, which indicates that the video frame to be processed is the p-th frame in the video, and p is a positive integer;
the processing module comprises:
the second determining submodule is used for determining an offset coefficient corresponding to the video frame to be processed according to the frame number of the video frame to be processed in the video;
and the processing submodule is used for changing the coordinates of the pixels in the initial reflection image according to the offset coefficient corresponding to the video frame to be processed to obtain the water ripple reflection image corresponding to the initial reflection image.
12. The apparatus of claim 11, wherein the second determining module comprises:
the vertical overturning submodule is used for vertically overturning the image of a non-inverted image area in the video frame to be processed to obtain an overturning image, wherein the non-inverted image area represents an area except the inverted image area in the video frame to be processed;
and the first determining submodule is used for determining an initial reflection image corresponding to the reflection region according to the turnover image.
13. The apparatus of claim 12, wherein the first determination submodule is configured to:
and performing telescopic processing on the flip image in the vertical direction according to the height of the reflection area, so that the height of the flip image after telescopic processing is equal to the height of the reflection area, and obtaining an initial reflection image corresponding to the reflection area.
14. The apparatus of claim 11, wherein the second determination submodule is configured to:
and calculating a remainder obtained by dividing the frame number of the video frame to be processed in the video by the total frame number of a preset period, wherein the remainder is used as an offset coefficient corresponding to the video frame to be processed.
15. The apparatus of claim 11, wherein the processing submodule is configured to:
and changing the abscissa of the pixel in the initial inverted image according to the offset coefficient corresponding to the video frame to be processed to obtain a water ripple inverted image corresponding to the initial inverted image.
16. The apparatus of claim 15, wherein the processing submodule is configured to:
and determining the horizontal coordinate of each changed pixel in the initial reflection image according to the offset coefficient corresponding to the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
17. The apparatus of claim 16, wherein the processing sub-module is configured to:
and determining the horizontal coordinate of each pixel in the initial reflection image after being changed according to the offset coefficient corresponding to the video frame to be processed, the height of the video frame to be processed, the horizontal coordinate of each pixel in the initial reflection image and the vertical coordinate of each pixel in the initial reflection image, so as to obtain the water ripple reflection image corresponding to the initial reflection image.
18. The apparatus of any one of claims 11 to 13, further comprising:
and the fusion module is used for fusing the video frame to be processed and the superposition layer.
19. The apparatus of claim 18, wherein the fusion module comprises:
a third determining submodule, configured to determine a mask area in the overlay layer;
a fourth determining submodule, configured to determine a pixel value of the mask region according to the pixel value of the superimposed layer;
and a fifth determining submodule, configured to determine a pixel value of a non-mask region according to the pixel value of the video frame to be processed and the pixel value of the overlay layer, where the non-mask region represents a region in the overlay layer other than the mask region.
20. The apparatus of claim 19, wherein the fifth determination submodule is configured to:
and overlapping the video frame to be processed and the overlapped layer in the non-mask area in a positive bottom overlapping mode, and determining the pixel value of the non-mask area.
21. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: performing the method of any one of claims 1 to 10.
22. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 10.
CN201810840172.8A 2018-07-27 2018-07-27 Video processing method and device, electronic equipment and storage medium Active CN108900903B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810840172.8A CN108900903B (en) 2018-07-27 2018-07-27 Video processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810840172.8A CN108900903B (en) 2018-07-27 2018-07-27 Video processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108900903A CN108900903A (en) 2018-11-27
CN108900903B true CN108900903B (en) 2021-04-27

Family

ID=64352142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810840172.8A Active CN108900903B (en) 2018-07-27 2018-07-27 Video processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108900903B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110944230B (en) * 2019-11-21 2021-09-10 北京达佳互联信息技术有限公司 Video special effect adding method and device, electronic equipment and storage medium
CN111243544B (en) * 2020-03-11 2021-07-23 深圳市华星光电半导体显示技术有限公司 Method for eliminating water ripple caused by spread spectrum, storage medium and display panel
CN111432123A (en) * 2020-03-30 2020-07-17 维沃移动通信有限公司 Image processing method and device
CN113674435B (en) * 2021-07-27 2024-08-20 阿里巴巴创新公司 Image processing method, electronic map display device and electronic equipment
CN114286009A (en) * 2021-12-29 2022-04-05 维沃移动通信有限公司 Inverted image shooting method and device, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101647270A (en) * 2007-04-11 2010-02-10 汤姆森许可贸易公司 Method and apparatus for enhancing Digital Video Effects (DVE)
CN102263905A (en) * 2011-07-22 2011-11-30 深圳市万兴软件有限公司 Special effect processing method of image and apparatus thereof
CN102592296A (en) * 2011-12-29 2012-07-18 深圳市万兴软件有限公司 Method and device for realizing special water wave rippling effect
CN103220490A (en) * 2013-03-15 2013-07-24 广东欧珀移动通信有限公司 Special effect implementation method in video communication and video user terminal
CN104394313A (en) * 2014-10-27 2015-03-04 成都理想境界科技有限公司 Special effect video generating method and device
CN106611412A (en) * 2015-10-20 2017-05-03 成都理想境界科技有限公司 Map video generation method and device
CN107103581A (en) * 2017-04-21 2017-08-29 努比亚技术有限公司 A kind of image inverted image processing method, device and computer-readable medium
CN107564085A (en) * 2017-10-24 2018-01-09 北京奇虎科技有限公司 Scalloping processing method, device, computing device and computer-readable storage medium
CN107770606A (en) * 2017-10-24 2018-03-06 北京奇虎科技有限公司 Video data distortion processing method, device, computing device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070274607A1 (en) * 2006-04-12 2007-11-29 Jincheng Huang Method of Creating a Reflection Effect in an Image

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101647270A (en) * 2007-04-11 2010-02-10 汤姆森许可贸易公司 Method and apparatus for enhancing Digital Video Effects (DVE)
CN102263905A (en) * 2011-07-22 2011-11-30 深圳市万兴软件有限公司 Special effect processing method of image and apparatus thereof
CN102592296A (en) * 2011-12-29 2012-07-18 深圳市万兴软件有限公司 Method and device for realizing special water wave rippling effect
CN103220490A (en) * 2013-03-15 2013-07-24 广东欧珀移动通信有限公司 Special effect implementation method in video communication and video user terminal
CN104394313A (en) * 2014-10-27 2015-03-04 成都理想境界科技有限公司 Special effect video generating method and device
CN106611412A (en) * 2015-10-20 2017-05-03 成都理想境界科技有限公司 Map video generation method and device
CN107103581A (en) * 2017-04-21 2017-08-29 努比亚技术有限公司 A kind of image inverted image processing method, device and computer-readable medium
CN107564085A (en) * 2017-10-24 2018-01-09 北京奇虎科技有限公司 Scalloping processing method, device, computing device and computer-readable storage medium
CN107770606A (en) * 2017-10-24 2018-03-06 北京奇虎科技有限公司 Video data distortion processing method, device, computing device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
图像的动态水波倒影;朱海兵;《电脑爱好者》;20021231;全文 *
水波特效模拟原理及其快速实现方法;陈和平,王早;《计算机应用研究》;20051231;全文 *

Also Published As

Publication number Publication date
CN108900903A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN110647834B (en) Human face and human hand correlation detection method and device, electronic equipment and storage medium
CN108900903B (en) Video processing method and device, electronic equipment and storage medium
CN110287874B (en) Target tracking method and device, electronic equipment and storage medium
US9674395B2 (en) Methods and apparatuses for generating photograph
CN109801270B (en) Anchor point determining method and device, electronic equipment and storage medium
CN110798630B (en) Image processing method and device, electronic equipment and storage medium
US20180088393A1 (en) Electronic device, display method and medium
CN109948494B (en) Image processing method and device, electronic equipment and storage medium
CN110928627B (en) Interface display method and device, electronic equipment and storage medium
CN112465843A (en) Image segmentation method and device, electronic equipment and storage medium
WO2016192325A1 (en) Method and device for processing logo on video file
US11314965B2 (en) Method and apparatus for positioning face feature points
CN111445414B (en) Image processing method and device, electronic equipment and storage medium
CN110933488A (en) Video editing method and device
CN110675355B (en) Image reconstruction method and device, electronic equipment and storage medium
CN111523346A (en) Image recognition method and device, electronic equipment and storage medium
US9665925B2 (en) Method and terminal device for retargeting images
CN109040837B (en) Video processing method and device, electronic equipment and storage medium
CN109816620B (en) Image processing method and device, electronic equipment and storage medium
CN109840890B (en) Image processing method and device, electronic equipment and storage medium
CN109756783B (en) Poster generation method and device
CN111354444A (en) Pathological section image display method and device, electronic equipment and storage medium
CN111275641A (en) Image processing method and device, electronic equipment and storage medium
CN110121115B (en) Method and device for determining wonderful video clip
CN110233927B (en) Call request access interface display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant