WO2022121796A1 - 图像处理方法及电子设备 - Google Patents
图像处理方法及电子设备 Download PDFInfo
- Publication number
- WO2022121796A1 WO2022121796A1 PCT/CN2021/135353 CN2021135353W WO2022121796A1 WO 2022121796 A1 WO2022121796 A1 WO 2022121796A1 CN 2021135353 W CN2021135353 W CN 2021135353W WO 2022121796 A1 WO2022121796 A1 WO 2022121796A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- style
- electronic device
- image
- video
- images
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/62—Control of parameters via user interfaces
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/698—Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—Two-dimensional [2D] image generation
- G06T11/10—Texturing; Colouring; Generation of textures or colours
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/617—Upgrading or updating of programs or applications for camera control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
- H04N23/632—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/667—Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/68—Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
- H04N23/682—Vibration or motion blur correction
- H04N23/683—Vibration or motion blur correction performed by a processor, e.g. controlling the readout of an image memory
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2200/00—Indexing scheme for image data processing or generation, in general
- G06T2200/24—Indexing scheme for image data processing or generation, in general involving graphical user interfaces [GUIs]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20221—Image fusion; Image merging
Definitions
- the present application relates to the field of terminal technologies, and in particular, to an image processing method and an electronic device.
- the electronic device may perform frame extraction processing on the video to achieve the above-mentioned time-lapse photography effect.
- users often need to keep electronic devices in one place for a long time. This imposes high restrictions on the scene, equipment and time of time-lapse photography.
- the present application provides an image processing method and electronic device, which can transfer the style of the video captured by the user, so that the video captured by the user in a short time has the time-lapse effect of the video captured for a long time, and the convenience of the user for time-lapse photography is improved. Sex and fun.
- the present application provides an image processing method.
- the method includes: the electronic device acquiring a first sequence of images.
- the electronic device may process the first image sequence based on the target transfer style to obtain the second image sequence.
- Both the first image sequence and the second image sequence contain n frames of images.
- the high-level semantic information of the ith frame image in the first image sequence is the same as that of the ith frame image in the second image sequence.
- the style of the ith frame image in the first image sequence is different from the style of the ith frame image in the second image sequence.
- the target transfer style can be used to indicate that the style of the first frame image in the second image sequence to the style of the n-th frame image varies in the M styles in order of the first style.
- n and M are integers greater than 1.
- i is a positive integer less than or equal to n.
- the electronic device may save the second sequence of images.
- the above-mentioned first image sequence may be a video or a multi-frame image obtained by segmenting a panorama.
- the style of the image may include the texture feature of the image and the artistic expression of the image.
- the content of the image may include low-level semantic information and high-level semantic information of the image.
- the low-level semantic information of the image is the style of the above image.
- the high-level semantic information of an image refers to what the image expresses that is closest to human understanding.
- the electronic device processing the first image sequence based on the target transfer style may specifically be performing style transfer processing.
- the above-described style transfer process may be to change the style of the image. That is, the style of the image processed by style transfer changes, but the high-level semantic information of the original image remains unchanged.
- the above-mentioned target migration style may be, for example, a style of day and night transition, a style of changing seasons, a style of alternating between rain and shine, and the like.
- the above-mentioned target transfer style may be determined by the electronic device based on the style option selected by the user.
- the above target transfer style can be used to determine the size of M above. That is, the number of style transfer models used for fusion.
- the high-level semantic information of the images in the second image sequence obtained by changing the sequence of the first style may present a sequence change in natural time.
- the target transfer style is day-night transfer style.
- the above M styles can be day style and night style.
- the above-mentioned first style order may be an order changing from day style to night style.
- the target migration style is the seasonal change style.
- the above M styles can be spring style, summer style, autumn style and winter style.
- the above-mentioned first style sequence may be from spring style to summer style, then from summer style to autumn style, and then from autumn style to night style. This embodiment of the present application does not limit the order in which the M styles are arranged in the above-mentioned first style order.
- the electronic device may use k fusion style transfer models to process the first image sequence based on the above target transfer style.
- k is less than or equal to n.
- the output images of the k fused style transfer models are the above-mentioned second image sequence.
- the output image of one fusion style transfer model may be one frame of images or consecutive multiple frames of images in the second image sequence.
- One of the above k fusion style transfer models may be weighted and generated by M single style transfer models.
- the styles of the respective output images of the above-mentioned M single-style transfer models constitute the above-mentioned M styles, and j is a positive integer less than or equal to M.
- the target transfer style is day-night transfer style.
- the single style transfer model used by the electronic device to generate the fusion model can be a day style transfer model and a night style transfer model.
- the weights of the daytime style transfer model and the nighttime style transfer model in the fusion style transfer model for performing style transfer processing on the first image sequence are different. Specifically, from the first fusion style transfer model to the k-th fusion style transfer model, the weight of the daytime style transfer model can gradually decrease, and the weight of the nighttime style transfer model can gradually increase.
- the electronic device can use the k fused style transfer models to perform style transfer processing on the first image sequence to obtain the second image sequence.
- the styles of the first frame image to the nth frame image in the second image sequence may gradually change from a day style to a night style.
- the above k fused style transfer models and the above M single style transfer models are both neural network models and have the same neural network structure.
- the above single style transfer model for generating the fusion style transfer model is obtained after training.
- the electronic device may obtain the training data set.
- the above training data set may include one or more frames of style images and multiple frames of content images in the first video.
- the style of one or more style images is the style of the output image of the trained single style transfer model.
- the above content images may be images that need to be styled.
- the electronic device may process multiple frames of content images in the first video by using the single style transfer model to be trained to obtain multiple frames of composite images.
- the electronic device can use the loss function to train the above-mentioned single-style transfer model to be trained to obtain a trained single-style transfer model.
- the loss function may include a high-level semantic information loss function, a style loss function, and a time domain constraint loss function.
- the above-mentioned high-level semantic information loss function is determined by the high-level semantic information of the multi-frame content image and the high-level semantic information of the multi-frame composite image.
- the above style loss function is determined by the style of the multi-frame content image and the style of the multi-frame composite image.
- the above-mentioned time-domain constrained loss function is determined by the style of one frame of composite image in the multi-frame composite image and the style of the multi-frame composite image adjacent to the one frame of composite image.
- the electronic device introduces the above-mentioned time-domain constrained loss function into the loss function used to train the single-style transfer model, which can take into account the connection between consecutive multiple frames of content images, reducing the impact of the single-style transfer model on the video.
- the probability of the style jumping of adjacent frame images When multi-frame images are subjected to style transfer processing, the probability of the style jumping of adjacent frame images.
- the trained style transfer model can improve the consistency of the stylization effect of images of consecutive multiple frames of content in the video, and reduce the flickering phenomenon during the video playback process when performing style transfer on the multi-frame images in the video.
- the above trained single style transfer model may be stored in an electronic device.
- the electronic device can obtain a single style transfer model locally for fusion.
- the above-trained single-style transfer model can be stored in the cloud.
- the electronic device can upload the video that needs to be style-transferred and the target style to be transferred to the cloud.
- the cloud can use the fusion style transfer model to perform style transfer on the video, and send the obtained style-transferred video to the electronic device.
- the electronic device 100 may only send the target migration style to the cloud.
- the cloud can send the single style transfer model that needs to be integrated to the electronic device according to the above target transfer style.
- the electronic device may turn on the camera to collect the first video, and obtain n frames of images in the first image sequence according to the first video.
- the first video includes z-frame images.
- the above-mentioned n-frame images are extracted from the above-mentioned z-frame images.
- the electronic device when the electronic device acquires the above-mentioned first video, it may further perform anti-shake processing on the first video.
- the above-mentioned anti-shake processing may be, for example, anti-shake processing in methods such as electronic anti-shake and/or optical anti-shake.
- the electronic device can perform frame extraction and style transfer processing on the video shot by the user in real time.
- a video shot by a user in a short period of time can have a time-lapse effect of shooting a video for a long time.
- the above-mentioned time-lapse video shot by the user within 1 minute may have a time-lapse effect that rapidly changes from day to night, which originally took 12 hours or even longer to be shot.
- the electronic device performs anti-shake processing on the captured video. In this way, the user can hold the electronic device for shooting when shooting a time-lapse video, without fixing the electronic device for shooting in one place without the need for a fixed device.
- the above method enables time-lapse photography to break through the restrictions on shooting scenes, equipment and time, and improves the convenience and fun of time-lapse photography for users.
- the electronic device may obtain the first video from locally stored videos according to the first video selected by the user, and obtain n frames of images in the first image sequence according to the first video.
- the first video contains z-frame images, and n-frame images are extracted from the z-frame images.
- the user can select the corresponding video from locally stored videos such as the gallery app.
- the electronic device can perform the above frame extraction and style transfer processing on the video selected by the user, so that the processed video can have a time-lapse effect of shooting a video for a long time.
- the electronic device can also obtain videos from the cloud to perform the above frame extraction and style transfer processing.
- the above-mentioned extracted frame extraction rate may be determined by the playback duration of the first image sequence selected by the user.
- the frame sampling rate may be a ratio of the playback duration of the first image sequence to the acquisition duration of the first video.
- the collection duration of the above-mentioned first video is 1 minute.
- the playback duration of the first image selected by the user is 10 seconds. Then, the electronic device can extract the above-mentioned first image sequence from the multiple frames of images of the first video according to the ratio of 1:6.
- the frame extraction rate for the first video can be customized according to the playback duration of the first image sequence that the user selects to be generated. In this way, the maximum frame extraction rate that the electronic device can provide will not be limited by the capture duration of the first video.
- the electronic device may store the n frames of images in the above-mentioned second image sequence in series as a video. During the playing process of the video, the effect that the above-mentioned M styles are sequentially changed according to the above-mentioned first style can be presented.
- the electronic device may acquire the first image, and segment the first image to obtain n frames of images in the above-mentioned first image sequence.
- the electronic device divides the above-mentioned first image by means of capturing an image through a sliding window.
- the length of the sliding window may be the first length.
- the sliding distance of each sliding window may be the first sliding distance.
- the electronic device may slide the sliding window from one side of the first image to the other side n-1 times to obtain an image with the lengths of n frames being the first length.
- the above-mentioned first length may be smaller than the first sliding distance. That is, there are overlapping parts of adjacent images in the above n frames of images.
- the electronic device may cut out a mosaic region from each frame of the image in the second image sequence to obtain n mosaic regions.
- the above n splicing regions do not have overlapping parts.
- the electronic device may stitch the above n stitched regions to obtain a second image, and store the second image.
- the resolution of the second image is the same as the resolution of the first image.
- the high-level semantic information of the second image is the same as the high-level semantic information of the first image.
- the resolutions of the above n mosaic regions may be the same or different.
- the above-mentioned first image may be obtained by the user turning on the camera of the electronic device to shoot immediately, or may be selected by the user from a gallery application of the electronic device.
- the target transfer style is a day-night transfer style.
- the electronic device may perform style transfer processing on the first image sequence by using the fusion style transfer model.
- the second image obtained by the electronic device splicing by using the splicing area in the second image sequence may present a process of gradually changing from a daytime style to a nighttime style from one side to the other.
- the styles of the spliced regions captured from adjacent images can transition more smoothly. That is, the above-mentioned method of segmenting the first image and cutting out the splicing area from each image obtained through style transfer can improve the smoothness of the stylization effect of the first image.
- the styles of the second image obtained by splicing the electronic device from one side to the other side can be more smoothly changed in the order of the first style among the above-mentioned M styles.
- the second image with the style gradient effect can be obtained. This can make it more interesting for users to capture images, especially panoramas.
- the present application provides an electronic device, which may include a display screen, a memory, and one or more processors.
- This memory can be used to store multiple single style transfer models.
- the memory can also be used to store computer programs.
- the processor can be used to invoke a computer program in the memory, so that the electronic device executes any one of the possible implementations of the first aspect.
- the present application provides a computer storage medium, including instructions, which, when the above-mentioned instructions are executed on an electronic device, cause the above-mentioned electronic device to execute any one of the possible implementation manners of the above-mentioned first aspect.
- an embodiment of the present application provides a chip, the chip is applied to an electronic device, the chip includes one or more processors, and the processor is configured to invoke computer instructions to cause the electronic device to execute any one of the first aspects above a possible implementation.
- an embodiment of the present application provides a computer program product containing instructions, which, when the computer program product is run on a device, enables the electronic device to execute any one of the possible implementations of the first aspect.
- the electronic device provided in the second aspect, the computer storage medium provided in the third aspect, the chip provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the methods provided by the embodiments of the present application. Therefore, for the beneficial effects that can be achieved, reference may be made to the beneficial effects in the corresponding method, which will not be repeated here.
- FIGS. 1A to 1F are schematic diagrams of some user interfaces for shooting time-lapse videos provided by embodiments of the present application.
- FIGS. 2A to 2C are schematic diagrams of some user interfaces for playing time-lapse videos provided by embodiments of the present application.
- FIG. 3 is a schematic diagram of a method for obtaining a fusion style transfer model by an electronic device according to an embodiment of the present application
- FIG. 4 is a schematic diagram of a method for performing style transfer on a video by an electronic device using a fusion style transfer model provided by an embodiment of the present application;
- FIG. 5 is a flowchart of a method for training a style transfer model provided by an embodiment of the present application
- FIG. 6 is a flowchart of a shooting method provided by an embodiment of the present application.
- FIGS. 7A to 7G are schematic diagrams of some user interfaces for performing style transfer on videos provided by embodiments of the present application.
- FIGS. 8A to 8E are schematic diagrams of some user interfaces for shooting panoramas provided by embodiments of the present application.
- FIG. 9 is a schematic diagram of a method for performing style transfer on a panorama by using a fusion style transfer model for an electronic device provided by an embodiment of the present application.
- FIG. 10 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
- Time-lapse photography is a photography technique that compresses time.
- the electronic device can collect images of a certain scenic spot from morning (eg, 7:00) to night (eg, 22:00) at the rate of capturing images during normal photography (eg, 30 frames of images per second). image to get the original video. Then, the electronic device can frame the original video. For example, the electronic device may extract 1 frame of images every 1800 frames of images. The electronic device can concatenate multiple frames of images obtained through frame extraction processing in the order of acquisition time to obtain a time-lapse video. At a video playback rate of 30 frames per second, the electronic device can compress a video with a playback time of 15 hours into a video with a playback time of 30 seconds. That is, the electronic device can present the change of a scenic spot from 7:00 in the morning to 22:00 in the evening in a 30-second time-lapse video.
- the electronic device may adjust the rate of capturing images to obtain multiple frames of images included in the time-lapse video. Specifically, the electronic device may capture images according to a delay rate input by a user or a preset delay rate. For example, the delay rate is 2 frames per second. Then, the electronic device can concatenate the multiple frames of images collected at the above-mentioned delay rate and play them in the form of video.
- time-lapse photography generally takes a long time to shoot.
- users often need to use a fixed device such as a tripod to fix the electronic device used for shooting in one place when performing time-lapse photography.
- It is difficult for a user to shoot a video with a time-lapse effect (such as a rapid change from day to night) in a short period of time when a user holds an electronic device (such as a mobile phone).
- the above-mentioned time-lapse effect may refer to compressing the process of slowly changing the object or the scene in a short period of time to present the process of rapidly changing the object or the scene.
- the embodiments of the present application provide an image processing method.
- the electronic device can perform anti-shake processing on the first video obtained by shooting the first scene in the first time period to obtain the second video. Then, the electronic device may perform frame extraction processing on the second video to obtain a third video.
- the electronic device may use the fusion style transfer model to perform style transfer on the multiple frames of images in the third video to obtain the fourth video.
- the above-mentioned fusion style transfer model is obtained by integrating at least two style transfer models in the electronic device.
- the electronic device may use the model obtained by fusing the daytime style transfer model and the nighttime style transfer model to perform style transfer on multiple frames of images in the third video.
- the fourth video can present the effect that the first scene changes rapidly in time from day to night.
- This embodiment of the present application does not limit the length of the above-mentioned first time period.
- the first period of time may be a short period of time, such as 30 seconds, 1 minute, or the like.
- the electronic device can perform the processing in the above image processing method on the video shot in a short time, so that the video shot in a short time can have a time-lapse effect of shooting a video for a long time.
- the above image processing method enables time-lapse photography to break through the limitations of shooting scenes, equipment and time, and improves the convenience and fun of time-lapse photography for users.
- the style of the image can include the texture features of the image and the artistic expression of the image.
- the style of the image may be cartoon style, manga style, oil painting style, realistic style, ukiyo-e style, day style, night style, spring style, summer style, autumn style, winter style, sunny style, rain style, etc.
- the embodiment of the present application does not limit the style of the image.
- Performing style transfer on an image may refer to merging a first image with style transfer requirements and a second image with a target style to generate a third image.
- the above-mentioned fusion process may be a process of processing the first image by using a style transfer model.
- the above style transfer model can be used to output images with the above target style. For the description of the above style transfer model, please refer to the introduction of the third point below.
- the above-mentioned third image has high-level semantic information in the content of the first image and the style of the second image.
- the content of the image may include low-level semantic information and high-level semantic information of the image.
- the low-level semantic information may refer to the color, texture, etc. of the image.
- the low-level semantic information of the image is also the style of the image.
- High-level semantic information can refer to what the image expresses closest to human understanding. For example, an image that contains sand, blue sky, sea water.
- the low-level semantic information of the image may include the color and texture of sand, blue sky, and sea water.
- the high-level semantic information of the image may be that the image contains sand, blue sky, sea water, and that the image is a beach image.
- the above-mentioned first image with the need for style transfer may be a content image.
- the above-mentioned second image with the target style may be a style image.
- An image obtained by performing style transfer on the content graphics can be a composite image.
- the electronic device performs style transfer on the content image, it saves the high-level semantic information of the content image, and replaces the style of the content image with the style of the style image.
- the content image is the above-mentioned beach image.
- the current style of the content image is Realistic.
- the style of the style image is cartoon style.
- the electronic device performs style transfer on the above-mentioned beach image, and can convert a realistic-style beach image into a cartoon-style beach image. Sand, blue sky, and sea water are still present in cartoon-style beach images after style transfer.
- the low-level semantic information such as color and texture of the cartoon-style beach image has changed.
- a style transfer model can be used to take in content images and generate synthetic images.
- the synthetic image may have high-level semantic information of the content image and a style corresponding to the style transfer model.
- a style transfer model can correspond to a style.
- a cartoon style transfer model may correspond to cartoon style.
- the cartoon style transfer model can replace the style of the received content image with the cartoon style.
- the style transfer model may be a neural network model.
- the style transfer model can be obtained using a large amount of training data.
- a training data may consist of a training sample and a training result corresponding to the training sample.
- the above-mentioned training samples may include a content image (the aforementioned first image) and a style image (the aforementioned second image).
- the training result corresponding to the above training sample may be a synthetic image (the aforementioned third image).
- the fusion style transfer model is a style transfer model obtained by fusing two or more style transfer models.
- the weights of parameters in multiple style transfer models for fusion can be different.
- the electronic device can change the style corresponding to the obtained fused style transfer model by changing the weights of the parameters in the multiple style transfer models to be fused.
- the electronic device may incorporate a daytime style transfer model and a nighttime style transfer model.
- the electronic device changes the weights of the parameters in the daytime style transfer model and the weights of the parameters in the nighttime style transfer model, and can obtain a fusion style transfer model with styles between the daytime style and the nighttime style (for example, the dusk style).
- the electronic device may use the fusion style transfer model obtained by fusion to perform style transfer on the multiple frames of images in the third video above.
- the weights of parameters in the daytime style transfer model and the weights of parameters in the nighttime style transfer model can be changed. Therefore, the fourth video processed by the fusion style transfer model can present the process of the first scene changing rapidly from day to night. That is to say, a video shot by a user in a short period of time can also have a time-lapse effect of shooting a video for a long time.
- a neural network can be composed of neural units, and a neural unit can refer to an operation unit that takes x s and an intercept 1 as inputs, and the output of the operation unit can refer to the following formula (1):
- W s is the weight of x s
- b is the bias of the neural unit.
- f is an activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer.
- the activation function can be a sigmoid function.
- a neural network is a network formed by connecting many of the above single neural units together, that is, the output of one neural unit can be the input of another neural unit.
- the input of each neural unit can be connected with the local receptive field of the previous layer to extract the features of the local receptive field, and the local receptive field can be an area composed of several neural units.
- a convolutional neural network is a neural network with a convolutional structure.
- a convolutional neural network consists of a feature extractor consisting of convolutional and subsampling layers.
- the feature extractor can be viewed as a filter, and the convolution process can be viewed as convolution with an input image or a convolutional feature map using a trainable filter.
- the convolutional layer refers to the neuron layer in the convolutional neural network that convolves the input signal.
- a neuron can only be connected to some of its neighbors.
- a convolutional layer usually contains several feature planes, and each feature plane can be composed of some neural units arranged in a rectangle.
- Neural units in the same feature plane share weights, and the shared weights here are convolution kernels.
- Shared weights can be understood as the way to extract image information is independent of location. The underlying principle is that the statistics of one part of the image are the same as the other parts. This means that image information learned in one part can also be used in another part. So for all positions on the image, the same learned image information can be used.
- multiple convolution kernels can be used to extract different image information. Generally, the more convolution kernels, the richer the image information reflected by the convolution operation.
- the convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights by learning during the training process of the convolutional neural network.
- the immediate benefit of sharing weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.
- the convolutional neural network can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller. Specifically, forwarding the input signal until the output will generate an error loss, and updating the parameters in the initial super-resolution model by back-propagating the error loss information, so that the error loss converges.
- the back-propagation algorithm is a back-propagation motion dominated by the error loss, aiming to obtain the parameters of the optimal super-resolution model, such as the weight matrix.
- the electronic device 100 may include a camera 193 .
- the camera 193 may be a front camera.
- Camera 193 may also include a rear camera.
- the electronic device 100 may display the user interface 210 shown in FIG. 1A .
- the user interface 210 may include an application icon display area 211, a tray 212 with icons of frequently used applications. in:
- the application icon display area 211 may include a gallery icon 211A.
- the electronic device 100 may open the gallery application, thereby displaying information such as pictures and videos stored in the electronic device 100 .
- the pictures and videos stored in the electronic device 100 include photos and videos shot by the electronic device 100 through a camera application.
- the application icon display area 211 may further include more application program icons, such as mail icons, music icons, sports and health icons, and the like, which are not limited in this embodiment of the present application.
- a tray 212 with frequently used application icons may display a camera icon 212A.
- the electronic device 100 can open the camera application, so as to perform functions such as photographing and video recording.
- the camera 193 front camera and/or rear camera
- the tray 212 with icons of frequently used applications may also display icons of more applications, such as dial icons, information icons, contact icons, etc., which are not limited in this embodiment of the present application.
- User interface 210 may also contain more or less content, such as controls to display the current time and date, controls to display the weather, and the like. It can be understood that FIG. 1A only exemplarily shows a user interface on the electronic device 100 , and should not constitute a limitation to the embodiments of the present application.
- the electronic device 100 may display a user interface 220 as shown in FIG. 1B .
- the user interface 220 may include a preview area 221 , a flash control 222 , a settings control 223 , a camera mode option 201 , a gallery shortcut control 202 , a shutter control 203 , and a camera rollover control 204 . in:
- the preview area 221 may be used to display images captured by the camera 193 in real time.
- the electronic device can refresh the displayed content in real time, so that the user can preview the image currently captured by the camera 193 .
- Flash control 222 may be used to turn the flash on or off.
- the setting control 223 can be used to adjust parameters for taking pictures (such as resolution, filters, etc.) and turn on or off some methods for taking pictures (such as timed photo, smile capture, voice-activated photo, etc.).
- the setting control 223 may be used to set more other shooting functions, which are not limited in this embodiment of the present application.
- the one or more shooting mode options may be displayed in the camera mode options 201 .
- the one or more shooting mode options may include: large aperture mode option 201A, video mode option 201B, photo mode option 201C, time-lapse photography mode option 201D, and portrait mode option 201E.
- the one or more shooting mode options can be represented as text information on the interface, such as "large aperture”, “video recording”, “photography”, “time-lapse photography", and “portrait”.
- the one or more camera options may also be represented as icons or other forms of interactive elements (IEs) on the interface.
- the electronic device 100 can start the shooting mode selected by the user.
- the camera mode options 201 may also include more or less shooting mode options. The user can browse other shooting mode options by swiping left/right in the camera mode options 201 .
- Gallery shortcut control 202 may be used to launch the Gallery application.
- the electronic device 100 can open the gallery application.
- the gallery application is a picture management application on an electronic device such as a smart phone and a tablet computer, and may also be called an "album", and the name of the application is not limited in this embodiment.
- the gallery application can support the user to perform various operations on the pictures stored on the electronic device 100, such as browsing, editing, deleting, selecting and other operations.
- the shutter control 203 can be used to monitor the user operation that triggers the photographing.
- the electronic device 100 may detect a user operation acting on the shutter control 203, and in response to the operation, the electronic device 100 may save the image in the preview area 221 as a picture in the gallery application.
- the electronic device 100 may also display thumbnails of the saved images in the gallery shortcut key 203 . That is, the user can click on the shutter control 203 to trigger taking a photo.
- the shutter control 203 may be a button or other forms of control.
- the camera rollover control 204 can be used to listen for a user operation that triggers rollover of the camera.
- the electronic device 100 can detect a user operation, such as a tap operation, acting on the camera flip control 204, and in response to the operation, the electronic device 100 can flip the camera for shooting, such as switching the rear camera to the front camera, or the front camera. switch from the front camera to the rear camera.
- the user interface 221 may further include more or less content, which is not limited in this embodiment of the present application.
- FIGS. 1C to 1F exemplarily show a user interface of the electronic device 100 for time-lapse photography.
- the electronic device 100 may display a user interface 230 as shown in FIG. 1C .
- User interface 230 contains substantially the same basic controls as user interface 210 . Additionally, style options 231 may be included in the user interface 230 .
- One or more style options may be included in style options 231 .
- style options 231 For example, the day and night switching style option 231A, the four seasons changing style option 231B, and the sunny and rainy changing style option 231C.
- the one or more style options may appear as textual information on the interface. For example, “day and night”, “four seasons”, “rain and rain”. Not limited to this, the one or more style options may also be represented as icons or other interactive elements on the interface.
- Each style option can be used to instruct the electronic device 100 to perform style transfer on the captured time-lapse video, and convert the style of the video to the style corresponding to the style option.
- the style transfer model corresponding to the above-mentioned day and night transition style option 231A may be a fusion style transfer model obtained by fusing the daytime style transfer model and the nighttime style transfer model.
- the electronic device 100 can use the fusion style transfer model to perform style transfer on multiple frames of images in the video, so as to obtain a video that can present a process in which the captured content changes rapidly from day to night.
- the style transfer model corresponding to the above-mentioned four-season change transition style option 231B may be a fusion style transfer model obtained from the spring style transfer model, the summer style transfer model, the autumn style transfer model, and the winter style transfer model.
- the electronic device 100 can use the fusion style transfer model to perform style transfer on multiple frames of images in the video, and obtain a video that can present a process of rapid gradation of the captured content from spring to summer, from summer to autumn, and then from autumn to winter.
- the style transfer model corresponding to the sunny and rainy alternate style option 231C may be a fusion style transfer model obtained by fusing the sunny weather style transfer model and the rainy weather style transfer model.
- the electronic device 100 can use the fusion style transfer model to perform style transfer on multiple frames of images in the video, so as to obtain a video that can present a process in which the captured content changes rapidly from sunny days to rainy days.
- style options 231 may also contain more or less style options. Not limited to the fusion style transfer style model shown in FIG. 1C , the style option 231 may also include a single style transfer model (eg, a cartoon style transfer model).
- the embodiment of the present application does not limit the specific way of changing the style of the video obtained by performing style transfer using the fusion style transfer model.
- the electronic device 100 may also perform style transfer processing on the video, so that the video shows a process of rapidly changing the captured content from night to day during playback.
- the day/night switching style option 231A, the four-season switching style option 231B, and the rainy/weather switching style option 231C are all unselected.
- the color of the above style options are all white.
- the electronic device 100 may display a user interface 230 as shown in FIG. 1D .
- the day and night transition style option 231A may appear to be selected.
- the color of day and night switching style option 231A may be changed to gray.
- the embodiments of the present application do not limit the manner in which the style option presents an unselected state and a selected state.
- the electronic device 100 may display a user interface 230 as shown in FIG. 1E.
- user interface 230 may include time selection box 232 .
- the time selection box 232 may be used by the user to select the length of time for the generated time-lapse video.
- the time selection box 232 may include a prompt 232A, a time option 232B, a confirmation control 232C, and a cancel control 232D. in:
- the prompt 232A may be used to prompt the user to select the time length of the generated time-lapse video.
- the prompt 232A may include a text prompt "Please determine the duration of the video obtained by time-lapse photography".
- Time option 232B may be used by the user to select the length of time for the time-lapse video. For example 10 seconds.
- Confirmation control 232C may be used to instruct electronic device 100 to begin time-lapse photography.
- the electronic device 100 may store the length of time indicated by the time option 232B. Further, the electronic device 100 may process the captured video to obtain a time-lapse video whose time length is the time length indicated by the time option 232B (ie, the time length selected by the user).
- the cancel control 232D may be used by the user to cancel the selection of the length of time for the time-lapse video.
- the electronic device 100 may display the user interface 230 as shown in FIG. 1D .
- the embodiment of the present application does not limit the specific expression form of the above-mentioned time selection box.
- the electronic device 100 may acquire the time length of the time-lapse video that the user wants to generate. After the original video is obtained by shooting, the electronic device can extract frames from the original video, so that the time length of the generated time-lapse video is the time length desired by the user. In some embodiments, the electronic device may determine the rate at which images are captured or the frame rate of the original video obtained by shooting by providing a delay rate. But in this way, the maximum delay rate that the electronic device can provide is often limited. When the shooting time is too long, the time length of the time-lapse video generated by the electronic device is still long, and the time-lapse effect presented by the time-lapse video is not obvious.
- the frame extraction rate determined during time-lapse photography in some embodiments of the present application may be determined according to the actual shooting time length and the time length indicated by the above time option 232B. That is, the user can customize the frame rate of the original video by selecting the time length of the time-lapse video to be generated in the above-mentioned time option 232B.
- the electronic device 100 may display a time-lapse photography interface 240 as shown in FIG. 1F .
- the time-lapse photography interface 240 may include a preview area 221 , a capture time indicator 241 , and a stop capture control 205 . in:
- the preview area 221 may display the images captured by the electronic device 100 through the camera during time-lapse photography.
- the electronic device 100 may store a series of images successively displayed in the preview area 221 during the time-lapse photography (ie, the time period from the start of the time-lapse photography to the end of the time-lapse photography) as the original video .
- the electronic device 100 can perform anti-shake processing, frame extraction processing, and style transfer processing on the original video to obtain a time-lapse video.
- the shooting time indicator 241 may be used to indicate the length of time the electronic device 100 has shot for time-lapse photography. As shown in FIG. 1F , the inclusion of “00:01:00” in the shooting time indicator 241 may indicate that the electronic device 100 has taken time-lapse photography for 1 minute.
- Stop capture control 205 can be used to end time lapse photography. As shown in FIG. 1F , when the time length of shooting is 1 minute, in response to a user operation acting on the stop shooting control 205 , the electronic device 100 may end the time-lapse shooting. Wherein, the electronic device 100 can obtain an original video with a time length of 1 minute.
- the electronic device 100 can perform anti-shake processing, frame extraction processing and style transfer on the original video according to the style selected by the user and the time length for which the time-lapse video is to be generated to obtain the time-lapse video.
- FIGS. 2A to 2C exemplarily show the user interface of the electronic device 100 for playing the time-lapse video obtained during the shooting process shown in FIGS. 1C to 1F .
- the electronic device 100 may display the video playing interface 250 as shown in FIG. 2A .
- the video playback interface 250 may include a time control 251 , an image display area 252 , a pause control 253 , a progress bar 254 , an elapsed video playback time 255 and a total video duration 256 . in:
- the time control 251 may instruct the electronic device 100 to store the time-lapse video. For example, on November 9, 2020, after 8:00 am.
- the image display area 252 can be used to display frame by frame images included in the time-lapse video.
- Pause control 253 can be used to pause playback of the time-lapse video.
- the progress bar 254 can be used to compare the played time of the video with the total duration of the video to indicate the progress of the video playing.
- Video elapsed time 255 may be used to indicate how long the video has played.
- Total video duration 256 may be used to indicate the total duration of the time-lapse video. It can be seen from FIG. 2A that the total duration of the time-lapse video is 10 seconds. That is, the electronic device 100 shoots a video with a time length of 1 minute and processes it into a time-lapse video with a time length of 10 seconds according to the time length indicated by the time option 232B shown in FIG. 1E . Then, the electronic device 100 can present the content shot in 1 minute in 10 seconds.
- the electronic device 100 may use the corresponding style transfer model to perform style transfer on the multiple frames of images in the video respectively.
- the electronic device 100 may perform style transfer on the video using the fused style transfer model incorporating the daytime style transfer model and the nighttime style transfer model.
- the time-lapse video obtained through the above style transfer can show the process of rapid gradation of the captured content from day to night.
- the images included in the time-lapse video retain high-level semantic information (eg, trees, rivers) of the images included in the original video.
- the style of the time-lapse video including the first frame to the last frame gradually changes from day style to night style.
- the style of the image is the daytime style. That is, the image of the time-lapse video when the playback time is the second second can present the scene of the captured content (such as trees and rivers) in the daytime.
- the style of the image is between the style of daytime and the style of nighttime (eg, dusk style).
- the image of the time-lapse video when the playback time is 4 seconds can present the scene of the captured content (such as trees and rivers) at dusk.
- the style of the image is night style. That is, the image of the time-lapse video when the playback time is the second second can present the scene of the captured content (such as trees and rivers) in the dark night.
- FIGS. 2A to 2C are only exemplary descriptions for gradually changing the style of an image from a daytime style to a nighttime style, and do not limit the specific presentation content of the images corresponding to the style.
- a video shot by a user in a short period of time may have a time-lapse effect of shooting a video for a long time.
- the above-mentioned time-lapse video shot by the user within 1 minute may have a time-lapse effect that rapidly changes from day to night, which originally took 12 hours or even longer to be shot.
- the electronic device can perform anti-shake processing on the captured video. In this way, the user can hold the electronic device for shooting when shooting a time-lapse video, without fixing the electronic device for shooting in one place without the need for a fixed device.
- the above-mentioned image processing method enables time-lapse photography to break through the limitations of shooting scenes, equipment and time, and improves the convenience and fun of time-lapse photography for users.
- the jitter in the captured video is generally due to changes in the pose of the electronic device used for capturing during the capturing process.
- the electronic device can process each frame of image in the video by calculating the change of its own posture during the shooting process to eliminate the jitter.
- the electronic device 100 may use a motion sensor (eg, a gyroscope sensor, an acceleration sensor) to calculate the change of its own pose during the shooting process.
- the electronic device 100 may determine the original motion path during the shooting process according to the change of its own posture. Further, the electronic device 100 may perform smoothing processing on the original motion path (ie, eliminate the jittered part on the motion path), so as to obtain the change of the pose of the electronic device 100 in a stable shooting state.
- the electronic device 100 can perform image registration on this frame of image, Thereby, the coordinates corresponding to each pixel of this frame of image in the steady shooting state are obtained.
- the electronic device 100 can connect the frames of images that have undergone image registration in series in the order of acquisition time, so as to obtain a more stable video.
- the electronic device 100 may also reduce or eliminate the jitter of the captured video through the optical image stabilization method.
- the lens group of the camera of the electronic device 100 includes a magnetic levitation lens.
- the electronic device 100 may detect shaking using the motion sensor. According to the measurement value of the motion sensor, the electronic device 100 can control the magnetic levitation lens to compensate the optical path and avoid the optical path from shaking. In this way, the electronic device 100 can reduce or eliminate the shake of the captured video.
- the electronic device 100 may further perform anti-shake processing in combination with the aforementioned electronic anti-shake and optical anti-shake methods.
- the embodiments of the present application do not limit the method for performing anti-shake processing on the electronic device 100.
- anti-shake processing method reference may also be made to other video anti-shake methods in the prior art.
- FIG. 3 exemplarily shows a flow chart of the electronic device 100 fusing M style transfer models.
- M is a positive integer greater than or equal to 2. in:
- the first style transfer model, the second style transfer model, ..., the Mth style transfer model are all style transfer models that have been trained, and all correspond to a single style.
- the style corresponding to the first style transfer model is the night style.
- the first style transfer model can transform the style of the input image into a night style.
- the M style transfer models may specifically be neural network models, such as convolutional neural network models. Moreover, the network structure of these M style transfer models is the same.
- the electronic device 100 may fuse the M style transfer models into a fused style transfer model with a specific style by means of interpolation and fusion. Specifically, the electronic device 100 may perform interpolation and fusion on the parameters of the M style transfer models at the same position, and use the parameters obtained after the interpolation and fusion as the parameters of the fusion style transfer model at this position.
- the method for the electronic device 100 to interpolate and fuse the parameters at the same position of the M style transfer models may refer to the following formula (2):
- ⁇ interp ⁇ 1 ⁇ 1 + ⁇ 2 ⁇ 2 +...+ ⁇ i ⁇ i +...+ ⁇ M ⁇ M (2)
- ⁇ i can represent the parameters of the ith style transfer model at the first position.
- the above-mentioned first position may be any position in the i-th style transfer model.
- the parameter can be, for example, the bias b of a certain neural unit in the ith style transfer model, and the weight W s of each neural unit in the layer above this neural unit.
- ⁇ i can represent the fusion weight of the ith style transfer model.
- the value of ⁇ i is not otherwise limited in this embodiment of the present application.
- ⁇ interp can represent the parameters obtained after interpolation and fusion. That is, the parameters of the fusion style transfer model in the first position.
- the electronic device 100 can determine the values of the parameters of the fusion style transfer model at each position, so as to obtain a fusion style transfer model that fuses the above M style transfer models.
- the network structure of the fusion style transfer model is the same as the network structure of the M style transfer models.
- the first position of the i-th style transfer model and the first position of the above-mentioned fusion style transfer model are the same position in the same network structure.
- the electronic device 100 is specifically described as an example of integrating the daytime style transfer model and the nighttime style transfer model.
- the calculation formula of the parameters of the fusion style transfer model obtained by fusion in the first position can refer to the following formula (3):
- the style corresponding to the fusion style transfer model is a style between the day style and the night style, and is determined by the values of ⁇ day and ⁇ night .
- the style corresponding to the fusion style transfer model is closer to the style of daytime.
- the style corresponding to the fusion style transfer model is closer to the night style.
- the video that can present the time-lapse effect of rapid gradient from day to night can be obtained by changing the values of ⁇ day and ⁇ night . .
- the value of ⁇ day can gradually decrease, and the value of ⁇ night can gradually increase.
- a video contains n frames of images.
- n is an integer greater than 1.
- the calculation formula of the parameter of the first position may refer to the following formula (4):
- the first position is any position in the fusion style transfer model.
- the weight occupied by the fused style transfer model can be adjusted, so that the video shows the effect of gradually changing from one style to another.
- the electronic device 100 may determine the fused style transfer model according to the style options in the foregoing embodiments.
- the style options are day and night transition style options.
- the electronic device 100 may determine that the fused style transfer models include a daytime style transfer model and a nighttime style transfer model.
- the style of the images contained in the video can gradually change from a daytime style to a nighttime style. That is, the above-mentioned style-transferred video can present the time change of the scene in the video from day to night during the playback process.
- FIG. 4 exemplarily shows an implementation manner of the electronic device 100 performing style transfer on a video by using a fusion style transfer model incorporating a daytime style transfer model and a nighttime style transfer model.
- the electronic device 100 may perform interpolation and fusion on the daytime style transfer model and the nighttime style transfer model according to the above formula (4).
- the video contains n frames of images.
- the model for performing style transfer on the jth frame of the n frames of images may be a fusion style transfer model j.
- the parameters of the fusion style transfer model j at the first position may be ((n-j+1)/n) ⁇ day +((j-1)/n) ⁇ night .
- the electronic device 100 may calculate the parameters of the fusion style transfer model j at all positions, so as to obtain the fusion style transfer model j.
- the electronic device 100 may use the fusion style transfer model 1 to the fusion style transfer model n to perform style transfer on the first frame image to the nth frame image, respectively.
- the styles corresponding to the fusion style transfer model 1 to the fusion style transfer model n are respectively style 1 to style n.
- the above-mentioned fusion style transfer model 1 may be a daytime style transfer model.
- Style 1 can be a day style.
- the above-mentioned fusion style transfer model n may be a night style transfer model.
- Style n can be night style.
- the styles of the first frame image to the nth frame image are style 1 to style n, respectively.
- the style of the first frame image to the nth frame image gradually changes from a day style to a night style.
- the style-transferred video can show a rapid transition from day to night during playback.
- the number of fused style transfer models obtained by the electronic device 100 using the M style transfer models may be less than the number of frames of images in a video that needs to perform style transfer.
- a fusion style transfer model can perform style transfer on a frame of images or consecutive multiple frames of images in a video that needs to be style-transferred.
- the device for training the style transfer model may be a training device.
- the style transfer model obtained by training is a style transfer model corresponding to a style.
- the style transfer model corresponding to the night style is an example of training a dark night style transfer model.
- the training set used for training the dark night style transfer model may include the content images that need to be styled transferred and the dark night style images.
- the training device can input the content image into the dark night style transfer model to be trained to obtain a synthetic image.
- the training equipment can calculate the loss of the loss function. This loss can be used to represent the gap between the style of the synthesized image and the style of the above-mentioned dark style image, as well as the gap between the content of the synthesized image and the content image input to the dark style transfer model in high-level semantic information.
- the training device can adjust the parameters in the dark night style transfer model to be trained through the back-propagation algorithm.
- the training equipment is directed to make the value of loss lower (that is, the smaller the gap between the style of the synthesized image and the style of the above-mentioned dark style image, the content of the synthesized image and the content image of the input dark style transfer model on high-level semantic information Adjust the parameters in the dark night style transfer model to be trained in the direction of the smaller the gap.
- the training device can obtain the trained dark night style transfer model.
- the training equipment can consider the connection between consecutive multi-frame content images when training the style transfer model. Specifically, when a training device trains a style transfer model, a multi-frame temporal loss can be introduced into the loss function.
- FIG. 5 exemplarily shows a flowchart of another method for training a style transfer model. This method is particularly suitable for training style transfer models for video style transfer. As shown in FIG. 5, the training method may include steps S101-S104. The training set used to train the style transfer model in the training method may contain videos that need to be style transferred. in:
- the training device inputs the content image of the rth frame of the video into the style transfer model to be trained, and calculates the loss loss_cur corresponding to the content image of the rth frame.
- the training device may sequentially use the first frame of content images to the last frame of content images in the video to train the style transfer model.
- the method of calculating the loss corresponding to the content image of the rth frame reference may be made to the description in the foregoing implementation manner.
- the training device obtains the h frames of content images before the rth frame of content images and inputs the style transfer model to be trained to obtain h frames of composite images.
- Both r and h above are positive integers, and h is less than r.
- the training device calculates the difference between the synthetic image obtained by inputting the content image of the rth frame into the style transfer model to be trained and the synthetic image of the h frame, and obtains the multi-frame temporal loss L ct .
- the training device can refer to the following formula (5) to calculate the multi-frame time domain loss L ct .
- N can represent the style transfer model to be trained.
- f cur can represent the content image of the current frame used for training the style transfer model, that is, the content image of the rth frame of the video.
- N(f cur ) can represent the content image obtained by inputting the content image of the rth frame into the style transfer model to be trained.
- f pre_i may represent the i-th frame of content images preceding the r-th frame of content images.
- N(f pre_i ) may represent a content image obtained by inputting the content image of the i-th frame before the content image of the r-th frame into the style transfer model to be trained.
- the training device adjusts the parameters of the style transfer model to be trained by using a back-propagation algorithm.
- the training device can use the sum of the above loss_cur and the multi-frame time domain loss L ct as the input of the style transfer model to be trained as the loss corresponding to the rth frame of the content image, and then use the back-propagation algorithm to adjust the parameters of the style transfer model to be trained.
- the training device can use multiple videos to train the style transfer model.
- the training device can obtain the trained style transfer model.
- the trained style transfer model can improve the consistency of the stylization effect of continuous multi-frame content images in the video when performing style transfer on multiple frames of images in the video, and reduce the flickering phenomenon during the video playback process.
- the method for calculating the above-mentioned multi-frame temporal loss is not limited to the calculation method indicated by formula (5). Gap of composite image.
- the training device may also obtain several frames of images after the rth frame of content images to calculate the multi-frame temporal loss.
- the above training device and the electronic device 100 in this application may be the same device.
- the electronic device uses two or more of these style transfer models for The fusion style transfer model obtained by interpolation fusion can also reduce the style differences of consecutive frames in the style-transferred video. That is to say, after the electronic device uses the fusion style transfer model to perform style transfer on the video according to the method in the foregoing embodiment, the styles of adjacent frame images in the video can be smoothly transitioned. During the video playback process, due to the style of adjacent frame images. Flicker caused by transitions is reduced.
- the above-mentioned trained style transfer models may be stored in the electronic device 100 .
- the electronic device 100 can obtain the style transfer model locally for fusion.
- the above-mentioned trained style transfer model can be stored in the cloud.
- the electronic device 100 uploads the video that needs to be styled transferred and the selected style option (such as the day and night style option 231A shown in FIG. 1D ) to the cloud.
- the cloud can use the fusion style transfer model to perform style transfer on the video, and send the obtained style-transferred video to the electronic device 100 .
- the electronic device 100 may also send only the selected style option to the cloud.
- the cloud can send the style transfer model that needs to be merged to the electronic device 100 according to the above style options.
- This embodiment of the present application does not specifically limit the storage location of the above trained style transfer model.
- FIG. 6 exemplarily shows a flowchart of a photographing method provided by the present application.
- the method may include steps S201-S207. in:
- the electronic device 100 starts a camera application and a camera.
- the electronic device 100 may open the camera application and the camera.
- the electronic device 100 receives a first user operation for selecting a time-lapse photography mode in the camera mode, and displays an option for determining the style of the time-lapse video.
- the above-mentioned first user operation may be, for example, the user operation acting on the time-lapse photography option 201D shown in FIG. 1B .
- the electronic device 100 may display options for determining the style of the time-lapse video on the user interface. For example, as shown in FIG. 1C , the style option 231 for performing style transfer on the captured video is shown.
- the above-mentioned time-lapse video may be a video obtained in series according to the sequence of collection time after the images collected by the camera in the process of time-lapse photography are processed through the following steps S205-S207. Among them, the user can view the time-lapse video obtained by the electronic device through the gallery application.
- S203 The electronic device 100 receives a second user operation for selecting the style and duration of the time-lapse video, and stores the selected style and duration of the time-lapse video.
- the above-mentioned second user operation may be, for example, the user operation performed on the day/night switching style option 231A shown in FIG. 1C and the user operation performed on the confirmation control 232C after selecting a time in the time option 232B shown in FIG. 1E .
- the style option selected above may be used to instruct the electronic device 100 to perform style transfer on the video captured by the camera according to the style option.
- the electronic device 100 may obtain the daytime style option and the nighttime style option from the local or the cloud.
- the electronic device 100 may perform interpolation and fusion on the daytime style option and the nighttime style option, and use the obtained fusion style transfer model to perform style transfer on the video.
- the above-mentioned selected time length can be used to indicate the frame extraction rate when the video captured by the camera of the electronic device 100 performs frame extraction.
- the electronic device 100 may first display an option for determining the time of the time-lapse video. Afterwards, the electronic device 100 displays an option for determining the style of the time-lapse video.
- the electronic device 100 may also simultaneously display options for determining the style and time of the time-lapse video.
- This embodiment of the present application does not limit the manner in which the electronic device 100 displays options for determining the style and time of the time-lapse video.
- the electronic device 100 receives a user operation for starting and ending time-lapse photography, and obtains a first video, where the first video includes images captured by the camera during the process from starting time-lapse photography to ending time-lapse photography.
- the above-mentioned user operation for starting time-lapse photography can be, for example, the user operation that acts on the confirmation control 232C after selecting the time in the time option 232B as shown in FIG. 1E .
- the above-mentioned user operation for ending time-lapse photography may be, for example, the user operation acting on the stop shooting control 205 shown in FIG. 1F .
- the above process from starting the time-lapse photography to ending the time-lapse photography is the process of performing the time-lapse photography.
- the camera of the electronic device 100 may capture images at the rate of normal video recording and capturing images (for example, capture 30 frames of images per second).
- the electronic device 100 may connect the images collected by the camera during the time-lapse photography in series in the order of collection time to obtain the first video.
- the electronic device 100 performs anti-shake processing on the first video to obtain a second video.
- the electronic device 100 can perform anti-shake processing on the first video to obtain the second video.
- the specific method of anti-shake processing will not be repeated here.
- the electronic device 100 extracts frames from the second video according to the time length selected by the user in the second user operation to obtain a third video, where the time length of the third video is the time length selected by the user.
- the electronic device 100 may determine the frame sampling rate according to the time length of the process of time-lapse photography performed by the camera and the time length selected by the user in the second user operation.
- the electronic device 100 can perform frame extraction on the second video according to the frame extraction rate, and the extracted images are connected in series in the order of acquisition time to obtain the third video.
- the electronic device 100 receives a user operation acting on the stop photography control 205 , and the electronic device 100 can stop photography. That is, the process of time-lapse photography by the camera is 1 minute. As shown in FIG. 1E , the time length selected by the user in the above-mentioned second user operation is 10 seconds. Then, the electronic device 100 may determine that the frame rate is 1:6. The electronic device 10 may extract 1 frame of images in every 6 frames of images. In a possible implementation manner, the electronic device 100 may draw frames at equal intervals. That is, the electronic device 100 can extract the 1st frame image, the 7th frame image, the 13th frame image . . . in the second video. Then, the electronic device 100 may connect the extracted images in series in the order of acquisition time to obtain a third video.
- the electronic device 100 may also extract frames in other ways according to the obtained frame sampling rate.
- the electronic device 100 uses the fusion style transfer model to perform style transfer on the third video according to the style selected by the user in the second user operation, and saves the style-transferred video as a time-lapse video.
- the electronic device 100 may determine the style transfer model to be merged according to the style selected by the user in the second user operation. Further, the electronic device 100 may determine a fusion style transfer model for performing style transfer on each frame of images in the third video according to the number of frames of the images included in the third video. According to the method for performing style transfer on a video using the fusion style transfer model in the foregoing embodiment, the electronic device 100 can use the obtained fusion style transfer model to perform style transfer on each frame of the third video to obtain a time-lapse video. The electronic device 100 may save the time-lapse video. The specific implementation method for the electronic device 100 to perform style transfer on the third video will not be repeated here.
- the electronic device may extract frames from the captured video, so as to compress the time length of the original video to the time length desired by the user.
- the electronic device performs style transfer on the video according to the video style selected by the user, so that the video shot by the user in a short time has the time-lapse effect of the video shot for a long time. For example, a time-lapse video shot within 1 minute can have a time-lapse effect that rapidly fades from day to night, which would have taken 12 hours or even longer.
- the electronic device can perform anti-shake processing on the captured video.
- the above shooting method enables time-lapse photography to break through the limitations of shooting scenes, equipment and time, and improves the convenience and fun of time-lapse photography for users.
- the electronic device 100 does not receive the user-selected style of the time-lapse video.
- the electronic device 100 may not perform style transfer on the video.
- the user does not select a style in the style option 231 . That is, all styles in style option 231 are unchecked.
- the electronic device 100 can start time-lapse photography.
- the electronic device 100 may perform anti-shake processing and frame extraction processing to obtain a time-lapse video. That is to say, the user can choose to compress only the original video captured by the camera in time, so as to obtain a time-lapse video with a corresponding time-lapse effect.
- the electronic device 100 may perform anti-shake processing on the captured original video, and select the time-lapse video according to the user's selection.
- the style of the time-lapse video is transferred to the anti-shake-processed video to obtain a time-lapse video. That is to say, the electronic device 100 may not perform frame extraction processing on the video.
- the electronic device 100 may first perform anti-shake processing on the captured original video.
- the electronic device 100 may perform frame interpolation on the anti-shake processed video to increase the time length of the video to the time length of the time-lapse video selected by the user. Finally, the electronic device 100 may perform style transfer on the video subjected to frame insertion processing according to the style of the time-lapse video selected by the user to obtain a time-lapse video.
- frame insertion method for video, reference may be made to the frame insertion method in the prior art, which is not limited in this embodiment of the present application.
- the electronic device 100 may process the video captured in the non-time-lapse photography mode (eg, frame extraction and style transfer) to obtain a time-lapse video.
- the non-time-lapse photography mode eg, frame extraction and style transfer
- the electronic device 100 may open the gallery application and display the gallery interface 260 as shown in FIG. 7B.
- the gallery interface 260 may include a first time indicator 261 , a second time indicator 265 , a first video thumbnail 262 , a second video thumbnail 263 , a first photo thumbnail 264 , and a second photo thumbnail 266 . in:
- the first video thumbnail 262 and the second video thumbnail 263 may be the covers of the first video and the second video, respectively.
- the electronic device 100 may use the first frame image of the video as the cover of the video thumbnail.
- the electronic device 100 may display a user interface for playing the first video or the second video.
- the first photo thumbnail 264 and the second photo thumbnail 266 may be thumbnails of the first photo and the second photo, respectively.
- the electronic device 100 may display the first photo or the second photo.
- the first time indicator 261 and the second time indicator 265 may be used to indicate the time when the video and the photo were taken under the first time indicator 261 and the second time indicator 265, respectively.
- the time indicated by the first time indicator 261 is today (today is the time displayed on the user interface 210 on November 9).
- the first video thumbnail 262 , the second video thumbnail 263 , and the first photo thumbnail 264 are located under the first time indicator 261 . That is to say, the first video, the second video, and the first photo were shot by the electronic device 100 on November 9.
- the time indicated by the second time indicator 265 is yesterday (yesterday is November 8).
- the second photo thumbnail 166 is located under the second time indicator 265 . That is to say, the second photo was taken by the electronic device 100 on November 8th.
- the electronic device 100 may display more content on the gallery interface 260 in response to a user operation acting on the gallery interface 260 to slide up and down.
- the electronic device 100 may display a user interface 270 as shown in FIG. 7C.
- User interface 270 may include time controls 271 , video playback area 272 , setting options 273 . in:
- the time control 271 may be used to indicate the time at which the electronic device 100 stores the first video. For example, November 9, 2020 at 7:30 am.
- the above-mentioned time for storing the first video may be the time when the shooting of the first video is completed.
- Video playback area 272 may include playback controls 272A.
- the play control 272A can be used to instruct the electronic device 272A to play the first video.
- Set options 273 may include share options 273A, favorite options 273B, edit options 273C, and delete options 273D.
- the sharing option 273A can be used by the user to share the first video to other devices.
- Favorite option 273B is available for the user to favorite the first video.
- the editing option 273C may be used by the user to perform editing operations on the first video, such as rotating and cropping, adding filters, and the like.
- the delete option 273D may be used by the user to delete the first video from the electronic device 100 .
- the electronic device 100 may display the video editing interface 280 as shown in FIG. 7D.
- the video editing interface 280 may include a video playback area 281 , editing options 282 . in:
- Editing options 282 may include rotate crop options 282A, filter options 282B, soundtrack options 282C, text options 282D, watermark options 282E, time-lapse photography options 282F.
- the option cropping option 282A can be used to rotate and crop each frame image in the first video.
- the filter option 282B, the soundtrack option 282C, the text option 282D, and the watermark option 282E can respectively add filters, add background music, add text, and add watermarks to each frame of the first video.
- the time-lapse photography option 282F can be used to perform frame extraction processing and style transfer processing on the first video, so as to obtain a video with a time-lapse effect.
- Edit options 282 may contain more or fewer options.
- Video editing interface 280 may also include style selection options 283 .
- the style selection options 283 may include a prompt control 283A, a day/night switching style option 283B, a season changing style option 283C, a rainy or sunny style option 283D, a cancel control 283E, and a next step control 283F. in:
- the prompt control 283A may be used to prompt the user to select a style that needs to be styled for the first video.
- Prompt control 283A may include the text prompt "Style Selection”.
- the embodiment of the present application does not limit the specific form of the prompt word control 283A.
- Cancel control 283E may be used by the user to cancel the style selection.
- the electronic device 100 may display the video editing interface 280 as shown in FIG. 7D.
- the next step control 283 can be used by the user to further complete related settings of time-lapse photography editing. For example, set the length of time for a time-lapse video.
- style options may also be included in the style selection options 283 described above.
- the electronic device 100 may display the video editing interface 280 as shown in FIG. 7F .
- the video editing interface 280 may also include a duration selection option 284 .
- the duration selection option 284 may include a prompt control 284A, a time option 284B, a previous step control 284C, and a save control 284D. in:
- Prompt control 284A may be used to prompt the user to select the length of time for the final generated time-lapse video.
- the prompt control 284A may include a text prompt "Duration selection (please determine the duration of the processed video)".
- time option 284B For the role of the time option 284B, reference may be made to the introduction of the time option 232B in FIG. 1E in the foregoing embodiment, and details are not repeated here.
- the previous step control 284C can be used by the user to return to the previous step and reselect the style for performing style transfer processing on the first video.
- the electronic device 100 may display the video editing interface 280 as shown in FIG. 7D.
- the save control 284D may be used by the electronic device 100 to store a user-selected style (eg, day and night style) and a length of time (eg, 10 seconds).
- the electronic device 100 may perform frame extraction and style transfer on the first video according to the style and time length selected by the user, to obtain a time-lapse video.
- the time length of the time-lapse video is the time length selected by the user.
- the electronic device 100 may use a fusion style transfer model (eg, a fusion style transfer model incorporating a daytime style transfer model and a nighttime style transfer model) to perform style transfer on the frame-extracted first video.
- a fusion style transfer model eg, a fusion style transfer model incorporating a daytime style transfer model and a nighttime style transfer model
- the electronic device 100 may display a user interface 270 as shown in FIG. 7G.
- the content contained in the user interface 270 shown in FIG. 7G is consistent with the controls contained in the user interface 270 shown in FIG. 7C .
- the difference is that the video contained in the video playing area 272 is the cover of the time-lapse video obtained by performing frame extraction and style transfer on the first video.
- the cover of the time-lapse video may be the first frame of the time-lapse video.
- the time control 271 may instruct the electronic device 100 to store the time for the above-mentioned time-lapse video. For example, on November 9, 2020, after 8:00 am. It can be seen that the time at which the electronic device 100 stores the first video is different from the time at which the above-mentioned time-lapse video is stored. The first video was shot and stored in the electronic device 100 at 7:30 am on November 9, 2020. The above time-lapse video is obtained by processing the first video by the electronic device 100 at 8:00 am on November 9, 2020 and stored in the electronic device 100 .
- the electronic device 100 may play the time-lapse video in response to a user operation acting on the play control 272A shown in FIG. 7G .
- a user operation acting on the play control 272A shown in FIG. 7G For the specific process of the delayed video playback, reference may be made to the video playback process shown in FIG. 2A to FIG. 2C. I won't go into details here.
- the user can select the style and time length to perform time-lapse processing on the video that has been shot.
- the above-mentioned video that has been shot may be, for example, a video obtained by the electronic device 100 through the camera when the video recording mode option 201B is selected in the camera mode option shown in FIG. 1B . That is to say, the electronic device 100 can perform frame extraction and style transfer processing on any video to obtain a time-lapse video.
- the time-lapse effect of the time-lapse video may not be affected by the time length of the original video. Any video shot by a user in a short period of time can have a time-lapse effect of shooting a video for a long time after the frame extraction and style transfer processing in the embodiments of the present application.
- the following describes a scene for shooting a panorama image with a style gradient effect provided by an embodiment of the present application.
- 8A to 8E exemplarily show schematic diagrams of scenes in which the electronic device 100 shoots a panorama image with a style transfer effect.
- the electronic device 100 may open the camera application and the camera. Wherein, the electronic device 100 may display the user interface 290 as shown in FIG. 8B .
- the user interface 290 may include a preview area 291 , a style option 292 , a camera mode option 201 , a gallery shortcut control 202 , a shutter control 203 , and a camera flip control 204 . in:
- the camera mode option 201 may further include a time-lapse panorama mode option 201G, and the time-lapse panorama mode option 201G is in a selected state.
- the electronic device 100 can capture a panorama image with a style gradient effect.
- style options 292 may be included in style options 292 .
- style options 292 For example, the day and night changing style option 292A, the four season changing style option 292B, and the rainy and sunny changing style option 292C. All of the above style options can be used to instruct the electronic device 100 to perform style transfer on the captured panorama, so as to convert the style of the panorama to the style corresponding to the style option.
- the style transfer model corresponding to the above-mentioned day-night transition style option 292A may be a fusion style transfer model obtained by fusing the daytime style transfer model and the nighttime style transfer model.
- the electronic device 100 may divide the captured panorama into m regions from left to right. There may be overlapping portions in the m regions. Further, the electronic device 100 may use the above-mentioned fusion style transfer model to perform style transfer on the m regions segmented from the panorama.
- the electronic device 100 may select a splicing area from each of the above-mentioned m areas that have undergone style transfer, and stitch the m areas to obtain a panorama image that has undergone style transfer.
- the style from the left to the right of the panorama obtained by the stitching may gradually change from a daytime style to a nighttime style.
- the style transfer model corresponding to the above-mentioned four-season change transition style option 231B may be a fusion style transfer model obtained from the spring style transfer model, the summer style transfer model, the autumn style transfer model, and the winter style transfer model.
- the electronic device 100 may use the above-mentioned fusion style transfer model to perform style transfer on the m regions obtained by segmenting the panorama image.
- the electronic device 100 may select a splicing area from each of the above-mentioned m areas that have undergone style transfer, and stitch the m areas to obtain a panorama image that has undergone style transfer.
- the style from the left to the right of the panorama obtained by the stitching can be gradually changed from spring style to summer style, then from summer style to autumn style, and then from autumn style to winter style.
- the style transfer model corresponding to the sunny and rainy alternate style option 231C may be a fusion style transfer model obtained by fusing the sunny weather style transfer model and the rainy weather style transfer model.
- the electronic device 100 may use the above-mentioned fusion style transfer model to perform style transfer on the m regions obtained by segmenting the panorama image.
- the electronic device 100 may select a splicing area from each of the above-mentioned m areas that have undergone style transfer, and stitch the m areas to obtain a panorama image that has undergone style transfer.
- the style from the left to the right of the panorama obtained by the stitching can be gradually changed from a sunny style to a rainy style.
- style option 292 may also include a single style transfer model (eg, a cartoon style transfer model).
- the embodiment of the present application does not limit the specific way of changing the style of the panorama image obtained by performing style transfer using the fusion style transfer model.
- the electronic device 100 may also perform style transfer processing on the multi-frame images obtained by segmenting the panorama, and then stitch the multi-frame images into a panorama.
- the style from the left to the right of the panorama obtained by the above splicing may gradually change from a night style to a day style.
- the manner of dividing the panorama image by the electronic device 100 may also be dividing from the upper side to the lower side.
- the style from the upper side to the lower side of the panorama obtained through the above style transfer processing and splicing may be gradually changed from a daytime style to a nighttime style, or gradually changed from a nighttime style to a daytime style.
- the electronic device 100 may also segment the panoramic image along any direction of the panoramic image.
- the preview area 291 can be used to display images captured by the camera in real time.
- the preview area 291 may contain an operation prompt 291A and a shooting progress indication 291B. in:
- the operation prompt 291A may be used to prompt the user for an operation instruction for shooting a panorama.
- the operation prompt 291A may include a text prompt "press the shutter key and move slowly in the direction of the arrow".
- the “shutter key” in the above text prompt is the shutter control 203 .
- the “arrow” in the above text prompt is the arrow in the shooting progress indication 291B.
- the shooting progress indication 291B may include a panorama thumbnail and arrows.
- the above-mentioned panorama thumbnails may be used to present thumbnails of panorama images obtained from the time when the panorama shooting is started to the current moment.
- the above arrows can be used to indicate the direction in which the electronic device 100 moves during the panorama shooting process.
- the above-mentioned arrow pointing in the horizontal right direction may indicate that during the panorama shooting process, the electronic device 100 moves in the horizontal right direction from the position at the moment when the panorama shooting starts.
- the electronic device 100 receives a user operation acting on the day/night switching style option 292A and a user operation acting on the shutter control 203 .
- the electronic device 100 can start panorama shooting.
- the electronic device 100 may display the user interface 290 as shown in FIG. 8C .
- User interface 290 may include preview area 291 , pause capture control 206 .
- the preview area can be used to display the images captured by the camera in real time.
- the preview area 291 may include a shooting progress indication 291B and an operation prompt 291C.
- the above-mentioned shooting progress indication 291B reference may be made to the descriptions of the foregoing embodiments.
- the above-mentioned operation instruction 291C can be used as an operation description for prompting the user to take a picture during the panorama shooting process.
- the operation prompt 291C may include the text prompt "Please keep the arrow on the center line".
- Pause capture control 206 may be used to end panorama capture.
- the electronic device 100 may stitch images captured by the camera into a panorama image during the process from starting the panorama shooting to ending the panorama shooting.
- the arrow in the above-mentioned shooting progress indication 291B may move with the movement of the electronic device 100 .
- the electronic device 100 may end the panorama shooting.
- the ending position of the above arrow may be, for example, the rightmost position in the shooting progress indication 291B.
- the electronic device 100 may stitch the images collected by the camera into a panorama during the process from starting the panorama shooting to ending the panorama shooting.
- the electronic device 100 may perform anti-shake processing on the multi-frame images collected during the above-mentioned panorama shooting process. Further, the electronic device 100 may stitch multiple frames of images subjected to anti-shake processing into a panorama.
- the embodiment of the present application does not limit the manner in which the electronic device 100 splices the images collected by the camera to obtain the panorama image, and the specific implementation method may refer to the method for capturing the panorama image in the prior art.
- the electronic device 100 may perform wind migration on the above-mentioned original panorama according to the style selected by the user to obtain a panorama with a style gradient effect.
- the electronic device 100 may store the above-mentioned panorama image with a style gradient effect.
- the electronic device 100 may display the user interface 290 .
- the user interface 290 For the content contained on the user interface 290, reference may be made to the description of the user interface 290 shown in FIG. 8B in the foregoing embodiment.
- the user can view the panorama image with the style gradient effect obtained by the above shooting through the gallery shortcut key 202 .
- the electronic device 100 may display the user interface 310 as shown in FIG. 8E.
- User interface 310 may include time controls 311 and first panorama 312 .
- the first panorama 312 is a panorama obtained through the panorama shooting process shown in FIG. 8B and FIG. 8C .
- the style of the first panorama 312 from left to right may gradually change from a day style to a night style.
- the above-mentioned time control 311 may be used to instruct the electronic device 100 to store the above-mentioned time of the first panorama 312 .
- the user interface 310 may further include more content, which is not limited in this embodiment of the present application.
- the electronic device 100 can use the fusion style transfer model to perform style transfer on the panorama image to obtain a panorama image with a style gradient effect.
- the above-mentioned method for processing a panorama image improves the interest of a user in shooting a panorama image.
- FIG. 9 exemplarily shows a method for implementing style transfer for panorama images.
- the main steps of performing style transfer on the panorama to obtain a panorama with a style gradient effect may include: dividing the panorama, performing style transfer on the divided regions and selecting a splicing area, and splicing the stitching area to obtain a panorama with a style gradient effect.
- Panorama a method for implementing style transfer for panorama images.
- the first panorama may be an original panorama obtained by stitching the images collected by the camera during the panorama shooting process shown in FIG. 8B to FIG. 8C .
- the electronic device 100 may divide the first panorama into m regions from left to right.
- the electronic device 100 may segment the first panorama image by capturing an image through a sliding window.
- the length of the sliding window may be d.
- the distance of each sliding of the sliding window is ⁇ c.
- the electronic device 100 slides the above-mentioned sliding window m-1 times to the right from the leftmost side of the first panorama, so as to obtain m regions each with a length of d.
- the above-mentioned ⁇ c is smaller than the above-mentioned d. That is, there are overlapping parts in adjacent regions.
- the electronic device 100 may perform style transfer for the m regions respectively according to the style selected by the user.
- style transfer for the above method of performing style transfer, reference may be made to the introduction of the electronic device 100 using the fusion style transfer model to perform style transfer on multiple frames of images in the video in the foregoing embodiment.
- the style selected by the user is a day and night transition style.
- the electronic device 100 may perform interpolation fusion on the daytime style transfer model and the nighttime style transfer model.
- the network structure of the resulting fusion style transfer model is the same as that of the daytime style transfer model and the nighttime style transfer model.
- the model for the electronic device 100 to perform style transfer on the jth region is the fusion style transfer model a j.
- the parameter of the fusion style transfer model a j at the first position may be ((m-j+1)/m) ⁇ day +((j-1)/m) ⁇ night .
- the above ⁇ day and ⁇ night are the parameters of the day style transfer model and the night style transfer model in the first position, respectively.
- the above-mentioned first position is any position in the network structure of the above-mentioned fusion style transfer model a j.
- the first position of the daytime style transfer model, the first position of the nighttime style transfer model, and the first position of the above-mentioned fusion style transfer model a j are all the same position in the same network structure.
- the above j is an integer greater than or equal to 1 and less than or equal to m.
- the electronic device 100 can use the fusion style transfer model a1 to the fusion style transfer model am to perform style transfer on the first area to the mth area, respectively.
- the styles corresponding to the fusion style transfer model 1 to the fusion style transfer model m are respectively style 1 to style m.
- the above fusion style transfer model 1 can be a daytime style transfer model.
- Style 1 can be a day style.
- the above-mentioned fusion style transfer model m may be a night style transfer model.
- Style m can be night style.
- the styles of the first region to the mth region are style 1 to style m, respectively.
- the style of the first area to the mth area gradually changes from a daytime style to a nighttime style.
- the electronic device 100 may cut out a part of the splicing area from each area from the first area to the mth area that has undergone style transfer.
- the electronic device 100 may perform splicing of the obtained splicing regions. In this way, the electronic device 100 can obtain a panorama image with a style gradient effect.
- the electronic device 100 may cut out splicing regions of the same length from each region.
- the length of the spliced region may be ⁇ c ⁇ .
- ⁇ c ⁇ L/m.
- the electronic device 100 intercepts the k th splicing area from the k th area the length from the leftmost area of the k th area is (k-1)*( ⁇ c ⁇ - ⁇ c) Start at the position, and intercept the splicing area with a length of ⁇ c ⁇ .
- the above k is an integer greater than or equal to 1 and less than or equal to m.
- the electronic device 100 starts from the leftmost side of the first region that has undergone style transfer, and intercepts a splicing region with a length of ⁇ c' to obtain the first splicing region.
- the electronic device 100 intercepts a spliced area with a length of ⁇ c ⁇ starting from a position with a length ⁇ c ⁇ - ⁇ c from the leftmost second area that has undergone style transfer, to obtain a second spliced area.
- the electronic device 100 starts from the position of the leftmost length of (m-1)*( ⁇ c ⁇ - ⁇ c) from the mth area that has undergone style transfer, intercepts the splicing area with the length ⁇ c ⁇ , and obtains the m splice area.
- the electronic device 100 may splicing the above-mentioned first splicing area to m th splicing area in order from left to right. Wherein, each splicing region does not have overlapping parts during splicing. As shown in FIG. 9 , the electronic device 100 can obtain a panoramic image with a length L.
- the panorama has a stylized gradient effect. For example, the panorama's style from left to right is gradually changing from a day style to a night style.
- the electronic device 100 may also acquire panorama images or other types of images from a gallery application, and perform style transfer on the obtained panorama images or other types of images by using the method in the aforementioned embodiment shown in FIG. 9 .
- the styles of the spliced regions cut out from adjacent regions can transition more smoothly. That is, the above-mentioned method of segmenting the first panoramic image and cutting out the splicing area from each area obtained through style transfer can improve the smoothness of the stylized effect of the panoramic image.
- the left-to-right style of the panorama generated by the electronic device 100 can be more smoothly changed from a daytime style to a nighttime style.
- the embodiments of the present application do not limit the specific values of the length d of the sliding window, the distance ⁇ c for each sliding of the sliding window, the number of areas m obtained by dividing the first panoramic image, and the length ⁇ c' of each splicing area.
- each sliding distance of the sliding window may be different. That is, the lengths of the regions obtained by dividing the first panoramic image by the electronic device 100 may not be equal.
- the length of the electronic device 100 intercepting the splicing area from each area may also be different. That is, the lengths of the stitching regions used for stitching the panorama may not be equal.
- FIG. 10 shows a schematic structural diagram of the electronic device 100 .
- the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
- SIM Subscriber identification module
- the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
- the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 .
- the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
- the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
- the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
- application processor application processor, AP
- modem processor graphics processor
- graphics processor graphics processor
- ISP image signal processor
- controller memory
- video codec digital signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- the controller may be the nerve center and command center of the electronic device 100 .
- the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
- a memory may also be provided in the processor 110 for storing instructions and data.
- the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
- the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
- the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices.
- the charging management module 140 is used to receive charging input from the charger.
- the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
- the power management module 141 receives input from the battery 142 and/or the charging management module 140 and supplies power to the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
- the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
- Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands.
- the mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 .
- the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
- the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
- LNA low noise amplifier
- the modem processor may include a modulator and a demodulator.
- the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
- the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
- the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
- the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
- the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
- WLAN wireless local area networks
- BT Bluetooth
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication
- IR infrared technology
- the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
- the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
- the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
- the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
- the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
- the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
- the GPU is used to perform mathematical and geometric calculations for graphics rendering.
- Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
- Display screen 194 is used to display images, videos, and the like.
- Display screen 194 includes a display panel.
- the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
- LED diode AMOLED
- flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
- the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
- the electronic device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
- the ISP is used to process the data fed back by the camera 193 .
- the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
- ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
- ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
- the ISP may be provided in the camera 193 .
- the ISP may also perform anti-shake processing on multiple frames of images in the video.
- the ISP can compensate the image according to the data collected by the motion sensor, so as to reduce problems such as image instability and out-of-focus caused by the shaking of the electronic device 100 during the shooting process.
- Camera 193 is used to capture still images or video.
- the object is projected through the lens to generate an optical image onto the photosensitive element.
- the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
- CMOS complementary metal-oxide-semiconductor
- the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
- the ISP outputs the digital image signal to the DSP for processing.
- DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
- the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
- a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.
- Video codecs are used to compress or decompress digital video.
- the electronic device 100 may support one or more video codecs.
- the electronic device 100 can play or record videos of various encoding formats, such as: Moving Picture Experts Group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
- MPEG Moving Picture Experts Group
- MPEG2 moving picture experts group
- MPEG3 MPEG4
- MPEG4 Moving Picture Experts Group
- the NPU is a neural-network (NN) computing processor.
- NN neural-network
- Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
- multiple style transfer models may be stored in the NPU.
- the NPU can use the style transfer model to perform style transfer on the images processed by ISP.
- the NPU can fuse multiple style transfer models using the methods shown in Figures 3 and 4, and use the fusion style transfer model obtained by fusion to separate the multiple frames of images. Perform style transfer.
- the external memory interface 120 can be used to connect an external memory card to expand the storage capacity of the electronic device 100 .
- the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.
- Internal memory 121 may be used to store computer executable program code, which includes instructions.
- the processor 110 executes various functional applications and data processing of the electronic device 100 by executing the instructions stored in the internal memory 121 .
- the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
- the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal.
- Speaker 170A also referred to as a “speaker” is used to convert audio electrical signals into sound signals.
- the receiver 170B also referred to as “earpiece”, is used to convert audio electrical signals into sound signals.
- the microphone 170C also called “microphone” or “microphone”, is used to convert sound signals into electrical signals.
- the earphone jack 170D is used to connect wired earphones.
- the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
- the gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 .
- the angular velocity of electronic device 100 about three axes ie, x, y, and z axes
- the gyro sensor 180B can be used for image stabilization.
- the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake.
- the gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
- the air pressure sensor 180C is used to measure air pressure.
- the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
- the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
- the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
- the electronic device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
- Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
- the light emitting diodes may be infrared light emitting diodes.
- the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
- the ambient light sensor 180L is used to sense ambient light brightness.
- the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket, so as to prevent accidental touch.
- the fingerprint sensor 180H is used to collect fingerprints.
- the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
- the temperature sensor 180J is used to detect the temperature.
- Touch sensor 180K also called “touch panel”.
- the touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
- the touch sensor 180K is used to detect a touch operation on or near it.
- the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
- Visual output related to touch operations may be provided through display screen 194 .
- the bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice.
- the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
- the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
- Motor 191 can generate vibrating cues.
- the motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
- the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
- the SIM card interface 195 is used to connect a SIM card.
- the electronic device may acquire the first image sequence.
- the above-mentioned first image sequence may be a video or a multi-frame image obtained by segmenting a panorama.
- the first image sequence is a video
- the above-mentioned first image sequence may be obtained by turning on the camera of the electronic device shown in the foregoing embodiments of FIGS. 1A to 1F and shooting.
- the above-mentioned first image sequence may be obtained from a gallery application by the electronic device shown in the foregoing embodiments of FIG. 7A to FIG. 7C .
- the panorama may be photographed by turning on the camera of the electronic device shown in FIGS. 8A to 8D .
- the electronic device may process the first image sequence based on the target transfer style to obtain the second image sequence.
- the above-mentioned target migration style may be, for example, the style of day and night transition, the style of changing seasons, and the style of alternating between rain and shine in the foregoing embodiment.
- the electronic device 100 may determine the above-mentioned target transfer style according to a user operation acting on any style option in the style options 231 .
- the above-mentioned target transfer style may be used to indicate that the style of the first frame of images in the second image sequence to the style of the n-th frame of images changes in the M styles in the order of the first style.
- the above-mentioned target transfer style can be used to determine the size of the above-mentioned M. That is, the number of style transfer models used for fusion.
- the high-level semantic information of the images in the second image sequence obtained by changing the sequence of the first style may present a sequence change in natural time.
- the target transfer style is day-night transfer style.
- the above M styles can be day style and night style.
- the above-mentioned first style order may be an order changing from day style to night style.
- the target migration style is the seasonal change style.
- the above M styles can be spring style, summer style, autumn style and winter style.
- the above-mentioned first style sequence may be from spring style to summer style, then from summer style to autumn style, and then from autumn style to night style. This embodiment of the present application does not limit the order in which the M styles are arranged in the above-mentioned first style order.
- the electronic device may use k fusion style transfer models to process the above-mentioned first image sequence based on the above-mentioned target transfer style.
- the k fusion style transfer models can be weighted and generated by M single style transfer models.
- the term “when” may be interpreted to mean “if” or “after” or “in response to determining" or “in response to detecting" depending on the context.
- the phrases “in determining" or “if detecting (the stated condition or event)” can be interpreted to mean “if determining" or “in response to determining" or “on detecting (the stated condition or event)” or “in response to the detection of (the stated condition or event)”.
- the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
- software it can be implemented in whole or in part in the form of a computer program product.
- the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
- the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
- the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
- the computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server, data center, etc., that includes an integration of one or more available media.
- the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.
- the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium.
- the program When the program is executed , which may include the processes of the foregoing method embodiments.
- the aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store program codes.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Software Systems (AREA)
- Studio Devices (AREA)
- Television Signal Processing For Recording (AREA)
- Image Processing (AREA)
Abstract
Description
Claims (15)
- 一种图像处理方法,其特征在于,所述方法包括:电子设备获取第一图像序列;所述电子设备基于目标迁移风格对所述第一图像序列进行处理,得到第二图像序列;所述第一图像序列和所述第二图像序列均包含n帧图像,所述第一图像序列中第i帧图像与所述第二图像序列中第i帧图像的高层语义信息相同,所述第一图像序列中第i帧图像与所述第二图像序列中第i帧图像的风格不同;所述目标迁移风格用于指示所述第二图像序列中第一帧图像的风格至第n帧图像的风格在M个风格中按第一风格顺序变化,所述n和所述M为大于1的整数,所述i为小于或等于所述n的正整数;所述电子设备保存所述第二图像序列。
- 根据权利要求1所述的方法,其特征在于,所述电子设备基于目标迁移风格对所述第一图像序列进行处理,具体包括:所述电子设备基于所述目标迁移风格,使用k个融合风格迁移模型对所述第一图像序列进行处理;所述k小于或等于n;所述k个融合风格迁移模型的输出图像为所述第二图像序列,其中,一个融合风格迁移模型的输出图像为所述第二图像序列中的一帧图像或连续多帧图像。
- 根据权利要求2所述的方法,其特征在于,所述一个融合风格迁移模型是M个单风格迁移模型加权生成的,所述一个融合风格迁移模型的输出图像的风格越接近第j个单风格迁移模型的输出图像的风格,生成所述一个融合风格迁移模型时所述第j个单风格迁移模型的权重越大;所述M个单风格迁移模型各自输出图像的风格组成所述M个风格,所述j为小于或等于M的正整数。
- 根据权利要求3所述的方法,其特征在于,所述k个融合风格迁移模型和所述M个单风格迁移模型是神经网络模型,具有相同的神经网络结构。
- 根据权利要求4所述的方法,其特征在于,所述单风格迁移模型是经过训练的,所述方法还包括:所述电子设备获取训练数据集,所述训练数据集包含一帧或多帧风格图像以及第一视频中的多帧内容图像;所述一帧或多帧风格图像的风格为经过训练的所述单风格迁移模型的输出图像的风格;所述电子设备利用待训练的单风格迁移模型处理所述第一视频中的多帧内容图像,得到多帧合成图像;所述电子设备利用损失函数训练所述待训练的单风格迁移模型,得到经过训练的所述单风格迁移模型;其中,所述损失函数包括高层语义信息损失函数、风格损失函数、时域约束损失函数,所述高层语义信息损失函数由所述多帧内容图像的高层语义信息和所述多帧合成图像的高层语义信息确定,所述风格损失函数由所述多帧内容图像的风格和所述多帧合成图像的风格确定,所述时域约束损失函数由所述多帧合成图像中一帧合成图像的风格和与所述一帧合成图像相邻的多帧合成图像的风格确定。
- 根据权利要求1-5中任一项所述的方法,其特征在于,所述电子设备获取第一图像序列,具体包括:所述电子设备开启摄像头采集得到第一视频,并根据所述第一视频得到所述第一图像序 列中的n帧图像;所述第一视频包含z帧图像,所述n帧图像是从所述z帧图像中抽取得到的。
- 根据权利要求6所述的方法,其特征在于,所述电子设备根据所述第一视频得到所述第一图像序列中的n帧图像之前,所述方法还包括:所述电子设备对所述第一视频进行防抖处理。
- 根据权利要求1-5中任一项所述的方法,其特征在于,所述电子设备获取第一图像序列,具体包括:所述电子设备根据用户选择的第一视频从本地存储的视频中获取所述第一视频,并根据所述第一视频得到所述第一图像序列中的n帧图像;所述第一视频包含z帧图像,所述n帧图像是从所述z帧图像中抽取得到的。
- 根据权利要求6-8中任一项所述的方法,其特征在于,所述抽取的抽帧率由用户选择的所述第一图像序列的播放时长决定,所述抽帧率为所述第一图像序列的播放时长和所述第一视频的采集时长的比值。
- 根据权利要求6-9中任一项所述的方法,其特征在于,所述电子设备保存所述第二图像序列,具体包括:所述电子设备将所述第二图像序列中的n帧图像按先后顺序串联保存为视频。
- 根据权利要求1-5中任一项所述的方法,其特征在于,所述电子设备获取第一图像序列,具体包括:所述电子设备获取第一图像,并对所述第一图像进行分割,得到所述第一图像序列中的n帧图像。
- 根据权利要求11所述的方法,其特征在于,所述电子设备保存所述第二图像序列,具体包括:所述电子设备从所述第二图像序列中的每一帧图像中截取一个拼接区域,得到n个拼接区域;所述n个拼接区域不存在重叠的部分;所述电子设备拼接所述n个拼接区域得到第二图像,并存储所述第二图像;所述第二图像的分辨率与所述第一图像的分辨率相同。
- 根据权利要求11或12所述的方法,其特征在于,所述第一图像序列中的每一帧图像的分辨率相同,所述第一图像序列中相邻两帧图像存在重叠的部分。
- 一种电子设备,包括显示屏、存储器、一个或多个处理器,其特征在于,所述存储器用于存储多个单风格迁移模型,还用于存储计算机程序;所述处理器用于调用所述计算机程序,使得所述电子设备执行权利要求1-13中任一项所述的方法。
- 一种计算机存储介质,其特征在于,包括:计算机指令;当所述计算机指令在电子设备上运行时,使得所述电子设备执行权利要求1-13中任一项所述的方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP21902503.8A EP4246955A4 (en) | 2020-12-07 | 2021-12-03 | IMAGE PROCESSING METHOD AND ELECTRONIC DEVICE |
| US18/256,158 US12567129B2 (en) | 2020-12-07 | 2021-12-03 | Image processing method and electronic device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011420630.6A CN114615421B (zh) | 2020-12-07 | 2020-12-07 | 图像处理方法及电子设备 |
| CN202011420630.6 | 2020-12-07 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022121796A1 true WO2022121796A1 (zh) | 2022-06-16 |
Family
ID=81856144
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/135353 Ceased WO2022121796A1 (zh) | 2020-12-07 | 2021-12-03 | 图像处理方法及电子设备 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US12567129B2 (zh) |
| EP (1) | EP4246955A4 (zh) |
| CN (1) | CN114615421B (zh) |
| WO (1) | WO2022121796A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116527940A (zh) * | 2023-04-07 | 2023-08-01 | 腾讯科技(深圳)有限公司 | 一种视频编码方法、装置及计算机设备、介质 |
| CN117440181A (zh) * | 2023-10-24 | 2024-01-23 | 广州虎牙科技有限公司 | 图像渲染方法、装置、计算机设备及可读存储介质 |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117750186B (zh) * | 2022-09-22 | 2025-11-04 | 荣耀终端股份有限公司 | 相机功能控制方法、电子设备及存储介质 |
| US12536713B2 (en) * | 2023-05-16 | 2026-01-27 | Salesforce, Inc. | Systems and methods for controllable image generation |
| CN119130778A (zh) * | 2023-05-31 | 2024-12-13 | 北京字跳网络技术有限公司 | 一种图像处理方法、装置、计算机设备及存储介质 |
| CN118014854B (zh) * | 2023-11-20 | 2024-09-27 | 北京汇畅数宇科技发展有限公司 | 基于ai模型的人脸风格化处理方法、装置及计算机设备 |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH09189610A (ja) * | 1996-01-11 | 1997-07-22 | Nippon Avionics Co Ltd | 2次元時間遅延積分型熱画像装置 |
| CN109360261A (zh) * | 2018-09-28 | 2019-02-19 | 北京达佳互联信息技术有限公司 | 图像处理方法、装置、电子设备及存储介质 |
| CN109636712A (zh) * | 2018-12-07 | 2019-04-16 | 北京达佳互联信息技术有限公司 | 图像风格迁移及数据存储方法、装置和电子设备 |
| CN109697690A (zh) * | 2018-11-01 | 2019-04-30 | 北京达佳互联信息技术有限公司 | 图像风格迁移方法和系统 |
| CN109919829A (zh) * | 2019-01-17 | 2019-06-21 | 北京达佳互联信息技术有限公司 | 图像风格迁移方法、装置和计算机可读存储介质 |
| CN110909790A (zh) * | 2019-11-20 | 2020-03-24 | Oppo广东移动通信有限公司 | 图像的风格迁移方法、装置、终端及存储介质 |
| US20200105029A1 (en) * | 2018-09-28 | 2020-04-02 | Samsung Electronics Co., Ltd. | Display apparatus control method and display apparatus using the same |
Family Cites Families (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9615177B2 (en) * | 2014-03-06 | 2017-04-04 | Sphere Optics Company, Llc | Wireless immersive experience capture and viewing |
| US9762846B2 (en) | 2015-05-08 | 2017-09-12 | Microsoft Technology Licensing, Llc | Real-time hyper-lapse video creation via frame selection |
| US9846840B1 (en) * | 2016-05-25 | 2017-12-19 | Adobe Systems Incorporated | Semantic class localization in images |
| US10147459B2 (en) * | 2016-09-22 | 2018-12-04 | Apple Inc. | Artistic style transfer for videos |
| US10565757B2 (en) * | 2017-06-09 | 2020-02-18 | Adobe Inc. | Multimodal style-transfer network for applying style features from multi-resolution style exemplars to input images |
| CN110278368A (zh) * | 2018-03-15 | 2019-09-24 | 株式会社理光 | 图像处理装置、摄影系统、图像处理方法 |
| CN110363293A (zh) * | 2018-03-26 | 2019-10-22 | 腾讯科技(深圳)有限公司 | 神经网络模型的训练、延时摄影视频的生成方法及设备 |
| JP7117872B2 (ja) * | 2018-03-28 | 2022-08-15 | キヤノン株式会社 | 画像処理装置、撮像装置、画像処理方法、及びプログラム |
| CN110086985B (zh) * | 2019-03-25 | 2021-03-30 | 华为技术有限公司 | 一种延时摄影的录制方法及电子设备 |
| CN110175951B (zh) | 2019-05-16 | 2022-12-02 | 西安电子科技大学 | 基于时域一致性约束的视频风格迁移方法 |
| CN110460770B (zh) * | 2019-07-25 | 2021-01-26 | 上海晰图信息科技有限公司 | 一种图像处理方法和系统 |
| CN111294509A (zh) * | 2020-01-22 | 2020-06-16 | Oppo广东移动通信有限公司 | 视频拍摄方法、装置、终端及存储介质 |
| CN111556244B (zh) | 2020-04-23 | 2022-03-11 | 北京百度网讯科技有限公司 | 视频风格迁移方法和装置 |
| CN111667399B (zh) * | 2020-05-14 | 2023-08-25 | 华为技术有限公司 | 风格迁移模型的训练方法、视频风格迁移的方法以及装置 |
-
2020
- 2020-12-07 CN CN202011420630.6A patent/CN114615421B/zh active Active
-
2021
- 2021-12-03 WO PCT/CN2021/135353 patent/WO2022121796A1/zh not_active Ceased
- 2021-12-03 EP EP21902503.8A patent/EP4246955A4/en active Pending
- 2021-12-03 US US18/256,158 patent/US12567129B2/en active Active
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH09189610A (ja) * | 1996-01-11 | 1997-07-22 | Nippon Avionics Co Ltd | 2次元時間遅延積分型熱画像装置 |
| CN109360261A (zh) * | 2018-09-28 | 2019-02-19 | 北京达佳互联信息技术有限公司 | 图像处理方法、装置、电子设备及存储介质 |
| US20200105029A1 (en) * | 2018-09-28 | 2020-04-02 | Samsung Electronics Co., Ltd. | Display apparatus control method and display apparatus using the same |
| CN109697690A (zh) * | 2018-11-01 | 2019-04-30 | 北京达佳互联信息技术有限公司 | 图像风格迁移方法和系统 |
| CN109636712A (zh) * | 2018-12-07 | 2019-04-16 | 北京达佳互联信息技术有限公司 | 图像风格迁移及数据存储方法、装置和电子设备 |
| CN109919829A (zh) * | 2019-01-17 | 2019-06-21 | 北京达佳互联信息技术有限公司 | 图像风格迁移方法、装置和计算机可读存储介质 |
| CN110909790A (zh) * | 2019-11-20 | 2020-03-24 | Oppo广东移动通信有限公司 | 图像的风格迁移方法、装置、终端及存储介质 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4246955A4 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116527940A (zh) * | 2023-04-07 | 2023-08-01 | 腾讯科技(深圳)有限公司 | 一种视频编码方法、装置及计算机设备、介质 |
| CN117440181A (zh) * | 2023-10-24 | 2024-01-23 | 广州虎牙科技有限公司 | 图像渲染方法、装置、计算机设备及可读存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| US12567129B2 (en) | 2026-03-03 |
| CN114615421B (zh) | 2023-06-30 |
| EP4246955A4 (en) | 2024-05-15 |
| US20240037708A1 (en) | 2024-02-01 |
| CN114615421A (zh) | 2022-06-10 |
| EP4246955A1 (en) | 2023-09-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113727017B (zh) | 拍摄方法、图形界面及相关装置 | |
| CN114615421B (zh) | 图像处理方法及电子设备 | |
| CN113556461B (zh) | 一种图像处理方法、电子设备及计算机可读存储介质 | |
| CN112532869B (zh) | 一种拍摄场景下的图像显示方法及电子设备 | |
| WO2022042776A1 (zh) | 一种拍摄方法及终端 | |
| WO2021052232A1 (zh) | 一种延时摄影的拍摄方法及设备 | |
| CN113497890B (zh) | 一种拍摄方法及设备 | |
| CN112887584A (zh) | 一种视频拍摄方法与电子设备 | |
| CN113727015A (zh) | 一种视频拍摄方法及电子设备 | |
| CN113170037A (zh) | 一种拍摄长曝光图像的方法和电子设备 | |
| US12382163B2 (en) | Shooting method and related device | |
| CN114466133B (zh) | 拍照方法及装置 | |
| WO2022156473A1 (zh) | 一种播放视频的方法及电子设备 | |
| WO2021180046A1 (zh) | 图像留色方法及设备 | |
| CN115529378A (zh) | 一种视频处理方法及相关装置 | |
| WO2024041394A1 (zh) | 拍摄方法及相关装置 | |
| WO2022143921A1 (zh) | 一种图像重建方法、相关装置及系统 | |
| CN115914823B (zh) | 拍摄方法及电子设备 | |
| WO2022206783A1 (zh) | 拍摄方法、装置、电子设备及可读存储介质 | |
| CN119277215B (zh) | 图像处理方法、电子设备、计算机程序产品及存储介质 | |
| CN113542575A (zh) | 设备位姿调整方法和图像拍摄方法及电子设备 | |
| CN113452895A (zh) | 一种拍摄方法及设备 | |
| CN121724850A (zh) | 一种图像增强的方法、电子设备和计算机存储介质 | |
| CN121099209A (zh) | 图像处理方法、电子设备、计算机程序产品及存储介质 | |
| HK40101788B (zh) | 一种拍摄方法及相关设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21902503 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 18256158 Country of ref document: US |
|
| ENP | Entry into the national phase |
Ref document number: 2021902503 Country of ref document: EP Effective date: 20230612 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWG | Wipo information: grant in national office |
Ref document number: 18256158 Country of ref document: US |