Image processing method and device

By providing a variety of watermark identification options in the watermark setting interface of dynamic photos, and adding different types of watermark images to multi-frame image frames of dynamic photos based on user input, the problem of single watermark display effect in the prior art is solved, and a diverse watermark display effect is achieved.

CN120151646APending Publication Date: 2025-06-13VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510367988.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The prior art display effect of watermarks in dynamic photos is relatively simple and lacks diversity.

Method used

By displaying the watermark setting interface, users are allowed to select different types of watermark identifiers, and obtain multi-frame watermark images based on user input, and add different types of watermark images on multi-frame image frames of dynamic photos.

Benefits of technology

It realizes the diversified display effect of watermarks on dynamic photos, improving the flexibility and aesthetics of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120151646A_ABST
    Figure CN120151646A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device. The image processing method comprises the steps that a watermark setting interface is displayed, the watermark setting interface comprises at least one watermark identifier, and each watermark identifier is used for indicating one type of watermark images; receiving a first input of a user to a first watermark identifier in the at least one watermark identifier; in response to the first input, M frames of watermark images are obtained, and the watermark image type of the M frames of watermark images is the watermark image type indicated by the first watermark identifier; based on the M frames of watermark images, adding the watermark images on the N frames of image frames; wherein N and M are positive integers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of electronic devices, and particularly relates to an image processing method and apparatus thereof. Background Art

[0002] With the continuous improvement of the functions of electronic devices such as mobile phones, it has become increasingly common to use electronic devices to take dynamic photos. A dynamic photo is a photo in a file format that encapsulates a cover photo and a video segment.

[0003] To enhance the sophistication and aesthetic feeling of dynamic photos, an electronic device can add a watermark to the dynamic photo. In related technologies, the electronic device usually uses the watermark on the cover photo as the watermark for each frame of the video in the dynamic photo. In this way, the watermarks displayed on all the images in the dynamic photo are the same, making the display effect of the watermark on the dynamic photo relatively single. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide an image processing method and apparatus thereof, which can improve the diversity of the display effect of the watermark on the dynamic photo.

[0005] In a first aspect, the embodiments of this application provide an image processing method, which includes:

[0006] Display a watermark setting interface, which includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image;

[0007] Receive a first input from the user on a first watermark identifier among the at least one watermark identifier;

[0008] In response to the first input, obtain M frames of watermark images, and the watermark image type of the M frames of watermark images is the watermark image type indicated by the first watermark identifier;

[0009] Based on the M frames of watermark images, add watermark images to N image frames;

[0010] Wherein, N and M are positive integers.

[0011] In a second aspect, the embodiments of this application provide an image processing apparatus, which includes:

[0012] A display module, configured to display a watermark setting interface, which includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image;

[0013] A receiving module, configured to receive a first input from the user on a first watermark identifier among the at least one watermark identifier displayed by the display module;

[0014] A processing module, configured to obtain M frames of watermark images in response to the first input received by the above receiving module, where the watermark image type of the M frames of watermark images is the watermark image type indicated by the above first watermark identifier;

[0015] Based on the M frames of watermark images, add watermark images to N frames of image frames;

[0016] Wherein, N and M are positive integers.

[0017] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the image processing method described in the first aspect are implemented.

[0018] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the image processing method described in the first aspect are implemented.

[0019] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the image processing method described in the first aspect.

[0020] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the image processing method described in the first aspect.

[0021] In the embodiments of the present application, a watermark setting interface is displayed. The watermark setting interface includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image; a first input of the user to the first watermark identifier among the at least one watermark identifier is received; in response to the first input, M frames of watermark images are obtained, and the watermark image type of the M frames of watermark images is the watermark image type indicated by the first watermark identifier; based on the M frames of watermark images, watermark images are added to N frames of image frames; wherein, N and M are positive integers. In this solution, by displaying the watermark display screen, at least one watermark identifier indicating different types of watermark images can be presented to the user. In this way, when the electronic device receives an input of any watermark identifier, watermark images can be added to N frames of image frames based on the obtained multiple frames of watermark images indicated by the watermark identifier. In this way, different types of multiple frames of watermark images can be added to N frames of image frames, so that the watermark images added to the N frames of image frames are not the same, thereby enhancing the diversification of the display effect of the watermarks on the images. Description of the Drawings

[0022] Figure 1It is a schematic flowchart of an image processing method provided by an embodiment of the present application;

[0023] Figure 2A It is a schematic diagram of a mobile phone interface provided by an embodiment of the present application;

[0024] Figure 2B It is a schematic diagram of a mobile phone interface provided by an embodiment of the present application;

[0025] Figure 2C It is a schematic diagram of a mobile phone interface provided by an embodiment of the present application;

[0026] Figure 2D It is a schematic diagram of a mobile phone interface provided by an embodiment of the present application

[0027] Figure 3 It is a schematic flowchart of an image processing method provided by an embodiment of the present application;

[0028] Figure 4 It is a schematic flowchart of an image processing method provided by an embodiment of the present application;

[0029] Figure 5 It is a schematic flowchart of an image processing method provided by an embodiment of the present application;

[0030] Figure 6 It is a schematic flowchart of an image processing method provided by an embodiment of the present application;

[0031] Figure 7 It is a schematic diagram of an image processing apparatus provided by an embodiment of the present application;

[0032] Figure 8 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

[0033] Figure 9 It is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0034] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, rather than all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application belong to the scope protected by the present application.

[0035] The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / ", generally means that the related objects before and after are in an "or" relationship.

[0036] The terms "at least one (item)", "at least one of", etc. in the description and claims of this application refer to any one, any two or more combinations of the objects it contains. For example, at least one (item) of a, b, and c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" means two or more, and its meaning is similar to that of "at least one (item)".

[0037] The following will combine the accompanying drawings to describe in detail the image processing method and device provided by the embodiments of this application through specific embodiments and their application scenarios.

[0038] The image processing method provided by the embodiments of this application can be applied to scenarios where watermarks are added to consecutive multiple frames of images, such as scenarios where watermarks are added to dynamic photos or a video.

[0039] With the rise of image special effects functions such as photo watermarks, it has become increasingly common to use these functions to decorate media files such as one's own photos or videos to enhance the sense of sophistication and beauty of the photos or videos, and to demonstrate personal intellectual property (IP) and the brand effect of the company through watermarks.

[0040] In the related art, when adding a watermark to a dynamic photo, the watermark on the cover photo is usually used as the watermark for each frame of the video in the dynamic photo. In this way, the watermarks displayed on all the images in the dynamic photo are the same, resulting in a relatively single display effect of the watermark on the dynamic photo.

[0041] To this end, an embodiment of the present application provides an image processing method, which displays a watermark setting interface. The watermark setting interface includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image; receives a first input from the user to the first watermark identifier among the at least one watermark identifier; in response to the first input, obtains M frames of watermark images, and the watermark image type of the M frames of watermark images is the watermark image type indicated by the first watermark identifier; based on the M frames of watermark images, adds watermark images to N frames of image frames; where N and M are positive integers. In this solution, by displaying the watermark display screen, at least one watermark identifier indicating different types of watermark images can be presented to the user. In this way, when the electronic device receives an input of any watermark identifier, it can add watermark images to N frames of image frames based on the obtained multiple frames of watermark images indicated by the watermark identifier. In this way, different types of multiple frames of watermark images can be added to N frames of image frames, so that the watermark images added to the N frames of image frames are not the same, thereby enhancing the diversity of the display effect of the watermarks on the images.

[0042] The execution subject of the image processing method provided by the embodiment of the present application may be an image processing device. Exemplarily, the image processing device may be an electronic device, or a functional component or functional entity in the electronic device. Hereinafter, taking the execution subject as an electronic device as an example, the image processing method provided by the embodiment of the present application will be described exemplarily.

[0043] Figure 1 is a schematic flowchart of the image processing method provided by the embodiment of the present application. As Figure 1 shown, the image processing method provided by the embodiment of the present application may include the following steps 101 to step 104.

[0044] Step 101: The electronic device displays a watermark setting interface.

[0045] In some embodiments of the present application, the watermark setting interface includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image.

[0046] In some embodiments of the present application, in a scenario where a dynamic photo or video needs to be edited, the electronic device may display an editing interface for the dynamic photo or video. Further, when the electronic device receives an input to the watermark control on the above-mentioned editing interface of the user, it may respond to the input of the user to the watermark control and display the above-mentioned watermark setting interface.

[0047] In some embodiments of the present application, the input of the user to the watermark control may include at least one of the following: a click input, a slide input, a press input, a voice input, a gesture input, or other feasible inputs, which are not limited in the embodiments of the present application.

[0048] In some embodiments of the present application, the above-mentioned one watermark identifier may include a preview image of a frame image in the above-mentioned one type of watermark image and a description text of the above-mentioned one type of watermark image.

[0049] For example, when the electronic device is a mobile phone, as Figure 2A shown, the watermark setting interface 21 on the mobile phone screen 20 may include a text watermark identifier 211, a photo frame watermark identifier 212, a traditional Chinese style watermark identifier 213, and a video watermark identifier 214. Among them, the type of watermark image indicated by the text watermark identifier 211 is a text watermark image, the type of watermark image indicated by the photo frame watermark identifier 212 is a photo frame watermark image, the type of watermark image indicated by the traditional Chinese style watermark identifier 213 is a traditional Chinese style watermark image, and the type of watermark image indicated by the video watermark identifier 214 is a video watermark image. The text watermark identifier 211 includes a preview image 2111 of the text watermark image and the text "Signature, artistic word text watermark" 2112; the photo frame watermark identifier 212 includes a preview image 2121 of the photo frame watermark image and the text "Colorful photo frame watermark for people" 2122; the traditional Chinese style watermark identifier 213 includes a preview image 2131 of the traditional Chinese style watermark image and the text "Traditional Chinese style watermark" 2132; the video watermark identifier 214 includes a preview image 2141 of the video watermark image and the text "Video capability watermark" 2142.

[0050] Step 102, the electronic device receives a first input from the user for a first watermark identifier among at least one watermark identifier.

[0051] In some embodiments of the present application, the above-mentioned first watermark identifier may be any one of the above-mentioned at least one watermark identifier.

[0052] In some embodiments of the present application, the above-mentioned first input is used to trigger the electronic device to obtain M frame watermark images, and the watermark image type of the M frame watermark images is the watermark image type indicated by the above-mentioned first watermark identifier.

[0053] In some embodiments of the present application, the above-mentioned first input may include at least one of the following: a click input, a slide input, a press input, a voice input, a gesture input, or other feasible inputs, and the embodiments of the present application do not limit this.

[0054] In some embodiments of the present application, the above-mentioned gesture input may include but is not limited to at least one of the following: a click gesture, a slide gesture, a drag gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double press gesture, a double click gesture, a specific gesture input, or other possible gesture inputs. The specific form of the gesture input may be determined according to actual needs, and in some embodiments, this is not limited.

[0055] In some embodiments of the present application, the above click input may be a single click input, a double click input, or a click input of any number of times, etc., and may also be a long press input or a short press input. In some embodiments, there is no limitation thereto.

[0056] In some embodiments of the present application, the above sliding input may be a sliding input in any direction, such as an upward sliding, a downward sliding, a leftward sliding, or a rightward sliding, etc. In some embodiments, there is no limitation thereto.

[0057] Step 103: The electronic device obtains M frame watermark images in response to the first input.

[0058] In some embodiments of the present application, the watermark image type of the above M frame watermark images is the watermark image type indicated by the above first watermark identifier.

[0059] In some embodiments of the present application, at least one frame of watermark image corresponding to the watermark image type indicated by each watermark identifier may be pre-stored in the memory of the electronic device. When the electronic device receives the first input to the above first watermark identifier, it may obtain M frame watermark images whose watermark image type is the watermark image type indicated by the above first watermark identifier from the memory.

[0060] Step 104: The electronic device adds watermark images to N frame image frames based on the M frame watermark images.

[0061] Wherein, N and M are positive integers.

[0062] In some embodiments of the present application, in combination Figure 1 , as Figure 3 shown, the above step 104 may be implemented by the following steps 104a1 and 104a2:

[0063] Step 104a1: The electronic device determines the watermark image corresponding to each frame image frame from the M frame watermark images.

[0064] In some embodiments of the present application, if M is greater than or equal to N, the electronic device may determine the i-th frame watermark image in the first N frame watermark images among the above M frame watermark images as the watermark image corresponding to the i-th frame image frame in the above N frame image frames, where i ∈ [1, N]; or, if M is less than N, the electronic device may determine the j-th frame watermark image among the above M frame watermark images as the watermark image corresponding to the (M - L * j)-th frame video image in the above M frame video images, where j ∈ [1, M], L is a positive integer, and L * j is less than or equal to M.

[0065] For example, if M is 10 and N is 5, the electronic device may determine the i-th watermark image in the first 5 watermark images among the 10 watermark images as the corresponding watermark image of the i-th image frame among the 5 image frames, where i ∈ [1, 5].

[0066] For another example, if M is 3 and N is 9, the electronic device may determine the first watermark image among the 3 watermark images as the corresponding watermark image of the first image frame, the fourth image frame, and the seventh image frame among the above 9 image frames; determine the second watermark image among the 3 watermark images as the corresponding watermark image of the second image frame, the fifth image frame, and the eighth image frame among the 9 image frames; determine the third watermark image among the 3 watermark images as the corresponding watermark image of the third image frame, the sixth image frame, and the ninth image frame among the 9 image frames.

[0067] It should be noted that if M is greater than or equal to N, the electronic device may first obtain any consecutive N watermark images from the above M watermark images, and then determine the i-th watermark image among the above any consecutive N watermark images as the corresponding watermark image of the i-th image frame among the above N image frames.

[0068] For example, if M is 6 and N is 4, the electronic device may first obtain any consecutive 4 watermark images from the 6 watermark images, and then determine the first watermark image among the any consecutive 4 watermark images as the corresponding watermark image of the first image frame among the 4 image frames; determine the second watermark image among the any consecutive 4 watermark images as the corresponding watermark image of the second image frame among the 4 image frames; determine the third watermark image among the any consecutive 4 watermark images as the corresponding watermark image of the third image frame among the 4 image frames; determine the fourth watermark image among the any consecutive 4 watermark images as the corresponding watermark image of the fourth image frame among the 4 image frames.

[0069] Step 104a2: The electronic device adds the watermark image corresponding to each image frame to the corresponding image frame in the N image frames.

[0070] In some embodiments of the present application, the electronic device may use a rendering tool to render the watermark image corresponding to each image frame onto the corresponding image frame and encode the corresponding image frame.

[0071] It should be noted that if the above M watermark images include dynamic effect elements, the electronic device may use a dynamic effect rendering tool to render the watermark image corresponding to each image frame onto the corresponding image frame.

[0072] In this way, by determining the watermark image corresponding to each frame image from the M-frame watermark image and adding the watermark image corresponding to each frame image to the corresponding image frame, the electronic device can add different watermark images to the N-frame image frames, thereby improving the display effect of the images.

[0073] In the image processing method provided in the embodiments of the present application, by displaying a watermark setting interface, the watermark setting interface includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image; receiving a first input from the user for a first watermark identifier among the at least one watermark identifier; in response to the first input, obtaining M-frame watermark images, and the watermark image type of the M-frame watermark images is the watermark image type indicated by the first watermark identifier; based on the M-frame watermark images, adding watermark images to the N-frame image frames; where N and M are positive integers. In this solution, by displaying the watermark display screen, at least one watermark identifier indicating different types of watermark images can be presented to the user. In this way, when the electronic device receives an input of any watermark identifier, watermark images can be added to the N-frame image frames based on the multiple frames of watermark images indicated by the obtained watermark identifier. In this way, different types of multiple frames of watermark images can be added to the N-frame video image frames, so that the watermark images added to the N-frame image frames are not the same, thereby improving the diversity of the display effect of the watermarks on the images.

[0074] In some embodiments of the present application, the N-frame image frames are image frames in a live photo or a video; before the above step 104, in combination Figure 1 , as Figure 4 shown, the image processing method provided in the embodiments of the present application may further include the following steps 105a and 105b:

[0075] Step 105a: The electronic device receives a second input.

[0076] In some embodiments of the present application, when the electronic device displays the first interface, the electronic device may receive a second input for a shooting control in the first interface, and the first interface may be a live photo shooting interface or a video shooting interface.

[0077] In some embodiments of the present application, the second input may include at least one of the following: a click input, a slide input, a press input, a voice input, a gesture input, or other feasible inputs, and the embodiments of the present application do not limit this.

[0078] Step 105b: The electronic device responds to the second input and captures a live photo or a video.

[0079] In some embodiments of the present application, when the first interface is a dynamic photo shooting interface, the electronic device can capture a dynamic photo in response to the second input; when the first interface is a video shooting interface, the electronic device can capture a video in response to the second input.

[0080] For example, when the electronic device is a mobile phone, as Figure 2B shown, if the mobile phone screen 20 displays a camera preview interface 22, then when the fourth input to the dynamic photo switch control 221 on the camera preview interface 22 is received, the electronic device can respond to the fourth input and turn on the dynamic photo shooting function of the mobile phone. At this time, the camera preview interface 22 is the dynamic photo shooting interface. Further, when the mobile phone receives the second input from the user to the shooting control 222 on the camera preview interface 22, it can respond to the second input and capture a dynamic photo.

[0081] In some embodiments of the present application, when the electronic device displays the first interface, the electronic device can respond to the fifth input to the setting control in the first interface and display an editing interface for dynamic photos or videos.

[0082] In some embodiments of the present application, the fourth input may include at least one of the following: the user's click input, swipe input, press input, voice input, gesture input, or other feasible inputs, and the embodiments of the present application do not limit this.

[0083] In some embodiments of the present application, the fifth input may include at least one of the following: the user's click input, swipe input, press input, voice input, gesture input, or other feasible inputs, and the embodiments of the present application do not limit this.

[0084] For example, as Figure 2B shown, a setting control 223 is displayed on the camera preview interface 22 (i.e., the dynamic photo shooting interface). When the mobile phone receives the fifth input from the user to the setting control 223, combined with Figure 2B , as Figure 2C shown, it can respond to the fifth input from the user to the setting control 223 and display an editing interface 23 for dynamic photos. A watermark control 231 is displayed on the editing interface 23. When the mobile phone receives the sixth input from the user to the watermark control 231, combined with Figure 2C , it can respond to the sixth input from the user to the watermark control 231 and display a watermark setting interface 21 as Figure 2A shown.

[0085] It should be noted that after the dynamic photo shooting function is enabled, the mobile phone will generate 4 data links for the camera. Among them, data link 1 is used to collect the preview image of the camera, data link 2 is used to collect the cover frame image in the dynamic photo, data link 3 is used to collect the video frame image in the dynamic photo, and data link 4 is used for image detection, such as human detection, when rendering watermarks on the images in the dynamic photo subsequently. Using different data links to collect the preview image of the camera and the video frame image in the dynamic photo can avoid the problem that the clarity of the video frame image is very poor and the watermark rendering effect on the video frame image is very poor when the data link for collecting the preview image of the camera is reused when collecting the video frame image in the dynamic photo, thereby improving the image quality of the video frame image and the rendering effect of the watermark on the video frame image.

[0086] In this way, by receiving the second input and in response to the second input, the electronic device can take a dynamic photo or video and add different watermark images to the taken dynamic photo or video based on the M-frame watermark images, thereby improving the display effect of the dynamic photo or video.

[0087] In some embodiments of the present application, in combination with Figure 1 , as Figure 5 shown, the above step 104 can be implemented through the following step 104b:

[0088] Step 104b: The electronic device adds the watermark image corresponding to each image frame to the first area in the corresponding image frame in the N frames of images.

[0089] Among them, different watermark image types correspond to different image areas; the above first area is the area corresponding to the above watermark image type.

[0090] In some embodiments of the present application, the electronic device can use a rendering tool to render the watermark image corresponding to each image frame into the first area in the corresponding image frame and encode the corresponding image frame.

[0091] For example, the area corresponding to the text watermark image type and the area corresponding to the national style watermark image can be the top area of the image, the area corresponding to the photo frame watermark image can be the border area of the image, and the area corresponding to the video watermark image can be the bottom area of the image. If the type of the above M-frame watermark images is the national style watermark image, the electronic device can use a rendering tool to render the watermark image corresponding to each image frame into the bottom area in the corresponding image frame.

[0092] In this way, by adding watermark images of different watermark image types to different image areas in the corresponding image frames, the electronic device can improve the diversity of the display effect of the watermarks on the images.

[0093] In some embodiments of the present application, after step 103 above, the image processing method provided by the embodiments of the present application may further include the following steps 106a and 106b, and step 104 above may be implemented through the following steps 104c:

[0094] Step 106a: The electronic device displays an image editing interface corresponding to the first watermark identifier.

[0095] In some embodiments of the present application, the above first input may also be used to trigger the editing of a type of watermark image indicated by the first watermark identifier. When the electronic device receives the above first input, it may display the above image editing interface.

[0096] In some embodiments of the present application, the above image editing interface includes at least one editing control, and the at least one editing control may include a background color editing control.

[0097] Step 106b: The electronic device receives a third input to the image editing interface.

[0098] In some embodiments of the present application, the above third input may include at least one of the following: a click input, a slide input, a press input, a voice input, a gesture input, or other feasible inputs, and the embodiments of the present application do not limit this.

[0099] The above step 106b may be implemented through the following steps 106b1:

[0100] Step 106b1: The electronic device receives a third input to the background color editing control.

[0101] In some embodiments of the present application, the above third input is used to trigger the editing of the background color of a type of watermark image indicated by the first watermark identifier. In other words, the above third input is used to trigger the editing of the background color of the above M-frame watermark images.

[0102] Step 104c: The electronic device updates the first watermark image in response to the third input and adds the updated first watermark image to the first image frame.

[0103] In some embodiments of the present application, the above first image frame is any one of the above N-frame image frames, and the above first watermark image is the watermark image corresponding to the above first image frame among the above M-frame watermark images.

[0104] The "updating the first watermark image" in the above step 104c may be implemented through the following steps 104c1 or 104c2:

[0105] Step 104c1: When the background color of the third input indication is the first preset color, the electronic device updates the background color of the first watermark image to the first preset color.

[0106] In some embodiments of the present application, the above-mentioned first preset color may be a solid color such as black or white.

[0107] Step 104c2: When the background color of the third input indication is the second preset color, the electronic device updates the background color of the first watermark image to the target color.

[0108] In some embodiments of the present application, the above-mentioned target color is determined based on the above-mentioned first image frame and the second preset color.

[0109] In some embodiments of the present application, the above-mentioned second preset color may be a solid color such as pink or red, as well as a gradient color.

[0110] For example Figure 2A As shown, if the mobile phone receives a first input to the border watermark identifier 212 on the watermark setting interface 21, it can respond to the first input and combine Figure 2A , such as Figure 2D As shown, an image editing interface 24 corresponding to the border watermark identifier 212 is displayed. The image editing interface 24 includes editing controls such as a background color editing control 241, a model name editing control 242, and a time and date editing control 243. The background color editing control 241 may include at least one color. When the mobile phone receives a third input to the background color editing control 241, it can respond to the third input. When the background color indicated by the third input is black, the background color of the first watermark image is updated to black. Or, when the background color indicated by the third input is the second preset color, the background color of the first watermark image is updated to the target color.

[0111] It should be noted that after the mobile phone updates the color of the first watermark image, or after the mobile phone receives an input to other editing controls on the image editing interface 24 and responds to the input of other editing controls on the image editing interface 24 to edit the first watermark image, as Figure 2D As shown, if the mobile phone receives a press input to the interface closing control 244 in the upper left corner of the image editing interface 24, it responds to the press input to close the image editing interface 24 and display the dynamic photo shooting interface. Further, when the mobile phone receives a second input to the shooting control 222 on the camera preview interface 22, it can respond to the second input, take a dynamic photo, and then add the edited first watermark image to the corresponding image frame in the dynamic photo.

[0112] In this way, when the background color indicated by the third input is the first preset color, the electronic device updates the background color of the first watermark image to the first preset color; when the background color indicated by the third input is the second preset color, the electronic device updates the background color of the first watermark image to the target color determined based on the first image frame and the second preset color. By doing so, different background colors can be set for the watermark image. Consequently, when adding the watermark image to the corresponding image frame, watermark images with different background colors can be added to the image frame, thereby enhancing the diversity of the display effect of the watermark on the image.

[0113] In this way, the electronic device can flexibly update the watermark image by displaying the image editing interface corresponding to the first watermark identifier, receiving the third input to the background color editing control, and in response to the third input, updating the first watermark image and adding the updated first watermark image to the first image frame. Therefore, when adding the updated watermark image to the image frame, the flexibility of the display effect of the watermark on the image is enhanced.

[0114] In some embodiments of the present application, before step 104c, the image processing method provided by the embodiments of the present application may further include the following steps 107a to 107c:

[0115] Step 107a: The electronic device obtains the image information of the image in the second area in the first image frame.

[0116] In some embodiments of the present application, the second area is the other area in the first image frame except for the area where the foreground object is located.

[0117] In some embodiments of the present application, the electronic device may perform image recognition on the first image frame, determine the foreground object from the first image, determine the area where the foreground object is located in the first image, and then determine the other area in the first image frame except for the area where the foreground object is located.

[0118] In some embodiments of the present application, the foreground object may include at least one of the following: people, animals, plants, scenery, buildings, and items.

[0119] In some embodiments of the present application, the people may include, but are not limited to: men, women, and children.

[0120] In some embodiments of the present application, the animals may include, but are not limited to: livestock, wild animals, pets, birds, fish, insects, etc.

[0121] In some embodiments of the present application, the plants may include, but are not limited to: flowers, grass, trees, wood, potted plants, etc.

[0122] In some embodiments of the present application, objects of the object type of scenery may include: cultural landscapes and natural landscapes. Among them, cultural landscapes may include: rockeries, gardens, etc.; natural landscapes may include: rivers, lakes, seas, the sun, the moon, clouds, starry skies, the sky, snow-capped mountains, forests, or grasslands, etc.

[0123] In some embodiments of the present application, objects of the object type of buildings include but are not limited to: roads, houses, bridges, sculptures, water towers, etc.

[0124] In some embodiments of the present application, objects of the object type of articles include but are not limited to: inanimate objects such as clothing accessories, daily necessities, office supplies, toys, labor tools, entertainment tools, etc.

[0125] For example, the object types of a laptop computer, a mobile phone, clothes, trousers, shoes, socks, hats, chairs, plates, basins, vases, washing machines, etc. are all articles.

[0126] In some embodiments of the present application, the above image information may be the pixel values of at least one pixel point in the image within the second region.

[0127] Step 107b: The electronic device determines the color information of each color in the image within the second region based on the image information.

[0128] In some embodiments of the present application, the color information of each color may be the proportion of each color among all the colors within the second region.

[0129] In some embodiments of the present application, the electronic device may determine the first quantity of the pixel points corresponding to each color based on the pixel values of at least one pixel point, and then calculate the ratio of the first quantity to the second quantity to determine the proportion corresponding to each color, where the second quantity is the quantity of the at least one pixel point.

[0130] Step 107c: The electronic device determines a target color that matches the second preset color from all the colors in the image within the second region based on the color information of each color.

[0131] In some embodiments of the present application, the electronic device may determine at least one first color that matches the second preset color from all the colors in the image within the second region, and then use the color with the largest proportion among the at least one first color as the target color.

[0132] For example, if the second preset colors are pink, red, and purple, and all the colors of the image in the second region include pink, blue, purple, and green, with the proportion of pink being 0.4 and the proportions of blue, purple, and green all being 0.2, the electronic device can determine that among all the colors of the image in the second region, the colors that match the second preset colors are red and purple. Since the proportion of red is greater than that of purple, the electronic device can determine that red is the target color.

[0133] In this way, by obtaining the image information of the image in the second region in the first image frame; determining the color information of each color of the image in the second region based on the image information; and determining the target color that matches the second preset color from all the colors of the image in the second region based on the color information of each color, the electronic device can update the background color of the watermark image to a color that matches the corresponding image frame. Furthermore, when adding the watermark image to the corresponding image frame, the diversity of the display effect of the watermark on the image can be improved.

[0134] In some embodiments of the present application, before the above step 104, the image processing method provided by the embodiments of the present application may further include at least one of the following steps 108a to 108d:

[0135] Step 108a: When the second image frame contains a human object, add an expression element to the second image frame based on the expression of the human object.

[0136] In some embodiments of the present application, the second image frame is any one of the N image frames.

[0137] In some embodiments of the present application, the electronic device may perform image recognition on the second image frame using a pre-trained image recognition model to determine whether the second image includes a human object and the emotion of the human object.

[0138] In some embodiments of the present application, when the second image frame contains a human object, an emotion element that matches the emotion of the human object may be added within a preset range of the human object on the second image frame.

[0139] In this way, when the second image frame contains a human object, by adding an expression element to the second image frame based on the expression of the human object, the display effect of the image can be improved.

[0140] Step 108b: When the second image frame contains a human object, save the human image in the second image frame.

[0141] In some embodiments of the present application, when the electronic device includes a human object in the second image frame, it may first save the human image in the second image frame, and then add an emotion element matching the emotion of the human object within a preset range of the human object on the second image frame, so that when removing the watermark on the second image frame, the second image frame can be restored based on the human image.

[0142] In this way, when the electronic device includes a human object in the second image frame, it saves the human image in the second image frame, so that when the electronic device needs to remove the watermark image on the second image frame, the second image frame can be restored based on the human image in the second image frame.

[0143] Step 108c: The electronic device increases light and shadow in the second watermark image.

[0144] In some embodiments of the present application, the second watermark image is the watermark image corresponding to the second image frame among the M-frame watermark images.

[0145] In some embodiments of the present application, the electronic device may increase light and shadow in the second watermark image based on the brightness distribution in the second image frame.

[0146] In this way, by increasing light and shadow in the printed image, when the electronic device adds the watermark image to the corresponding image frame, the display effect of the image can be improved.

[0147] In some embodiments of the present application, the electronic device may divide the second image frame to obtain a plurality of sub-images, and obtain the brightness of each sub-image among the plurality of sub-images; then determine at least one sub-image whose brightness is greater than or equal to a first threshold from the plurality of sub-images; finally, determine a fourth region where the at least one sub-image is located in the second image frame, and increase light and shadow in a fifth region in the second watermark image, where the fifth region is a region in the second watermark image that matches the fifth region.

[0148] Step 108d: When the electronic device includes a human object in the second image frame, it updates the background color of the second watermark image.

[0149] In some embodiments of the present application, when the second image frame includes a human object, the electronic device may update the background color of the second watermark image based on the emotion of the human object. Among them, the updated background color matches the emotion of the human object.

[0150] In this way, when the electronic device includes a human object in the second image frame and updates the background color of the second watermark image, it can match the background color of the watermark image with the emotion of the human object in the image frame. Furthermore, when adding the watermark image to the corresponding image frame, the diversity of the display effect of the watermark on the image can be improved.

[0151] In some embodiments of the present application, the above-mentioned M-frame watermark images include animation elements; before the above-mentioned step 104, the image processing method provided by the embodiments of the present application may further include the following steps 109a and 109b:

[0152] Step 109a: If at least some of the animation elements in the third watermark image are in the third area of the third image frame, the electronic device obtains a first sub-image in the third image frame.

[0153] In some embodiments of the present application, the above-mentioned third image frame is any one of the above-mentioned N-frame image frames, and the above-mentioned third watermark image is the watermark image corresponding to the above-mentioned third image frame among the above-mentioned M-frame watermark images.

[0154] In some embodiments of the present application, the above-mentioned first sub-image is: the image within the area where at least some of the above-mentioned animation elements are located in the above-mentioned third area.

[0155] In some embodiments of the present application, the above-mentioned third area may be the area where the main picture of the above-mentioned third image frame is located.

[0156] For example, when the above-mentioned animation element is a swimming fish, if the fish tail in the above-mentioned third watermark image is in the main picture area of the third image frame, the electronic device may obtain the image within the area where the fish tail is located in the main picture area.

[0157] In some embodiments of the present application, the above-mentioned first sub-image is: the image within the area where at least some of the above-mentioned animation elements are located in the above-mentioned third area;

[0158] Step 109b: The electronic device saves the first sub-image.

[0159] In some embodiments of the present application, the electronic device may save the above-mentioned first sub-image in the memory of the electronic device so that when removing the watermark image on the above-mentioned third image frame subsequently, the above-mentioned third image frame can be restored based on the above-mentioned first sub-image.

[0160] In this way, when at least some of the animation elements in the third watermark image are in the third area of the third image frame, the electronic device obtains the first sub-image in the third image frame and saves the first sub-image, so that when the electronic device needs to remove the watermark image on the third image frame, the third image frame can be restored based on the first sub-image.

[0161] Figure 6 It is a schematic flowchart of an image processing method provided by an embodiment of the present application. Taking an electronic device as a mobile phone as an example, the method may include the following steps 601 to 607:

[0162] Step 601, the mobile phone activates the live photo shooting function of the dynamic photo.

[0163] Exemplarily, as Figure 2B shown, when the mobile phone displays the camera preview interface 22 on the mobile phone screen 20, if a fourth input is received for the dynamic photo switch control 221 in the upper left corner of the camera preview interface 22, in response to the above fourth input, the live photo shooting function of the mobile phone is activated. At this time, the camera preview interface 22 is the dynamic photo shooting interface.

[0164] Step 602, the mobile phone activates the dynamic watermark function of the live photo.

[0165] Exemplarily, after the live photo shooting function of the mobile phone is activated, as Figure 2B shown, if a fifth input is received for the control 223 in the upper right corner of the camera preview interface 22, in combination with Figure 2B , as Figure 2C shown, then in response to the user's fifth input for the setting control 223, the dynamic watermark function of the live photo is activated, and the editing interface 23 of the dynamic photo is displayed, and a watermark control 231 is displayed on the editing interface 23.

[0166] Step 603, the mobile phone displays the dynamic photo shooting interface.

[0167] Exemplarily, when the mobile phone receives a sixth input for the watermark control 231, in combination with Figure 2C , it can respond to the user's sixth input for the watermark control 231 and display the watermark setting interface 21 as Figure 2A shown.

[0168] Exemplarily, when the mobile phone receives a first input for the first watermark identifier on the watermark setting interface 21, it can respond to the above first input and obtain the pag rendering resource to be drawn (i.e., the above M-frame watermark image).

[0169] Exemplarily, the mobile phone can also respond to the above first input, as Figure 2DAs shown, the image editing interface 24 corresponding to the display border watermark identifier 212 is shown. The image editing interface 24 includes editing controls such as a background color editing control 241, a model name editing control 242, a time and date editing control 242, etc. When the user operates on the image editing interface 24 and edits the above M-frame watermark images, a press input can be made on the interface closing control 244 at the upper left corner of the image editing interface 24. The mobile phone can respond to the press input, close the image editing interface 24, and display the dynamic photo shooting interface.

[0170] Step 604: The mobile phone responds to a second input on the shooting control on the dynamic photo shooting interface and captures a dynamic photo Livephoto.

[0171] Exemplarily, the dynamic photo Livephoto includes a cover photo captured by the mobile phone at the moment when the second input is received, video frames cached 1.5S before the moment when the second input is received, and video frames captured 1.5S after the moment when the second input is received.

[0172] Step 605: The mobile phone renders the watermark images corresponding to each video frame of Livephoto in the M-frame watermark images into the corresponding video frames.

[0173] Exemplarily, in the case where the watermark image type indicated by the above first watermark identifier is a "brand foundation" dynamic watermark type such as a text watermark type or a border watermark type, as Figure 2C shown, if the mobile phone receives a third input to the background color editing control 241 and the background color indicated by the third input is a first preset color such as white or black, it can respond to the third input, update the background color of the pag rendering resource to the first preset color, and then use the dynamic effect rendering tool to render each frame of the watermark image in the updated pag rendering resource into the corresponding video frame and perform video encoding.

[0174] It should be noted that the background color of the pag rendering resource can be white. When the background color indicated by the third input is white, the mobile phone can directly use the dynamic effect rendering tool to render each frame of the watermark image in the pag rendering resource into the corresponding video frame and perform video encoding; when the background color indicated by the third input is other first preset colors such as black, the mobile phone updates the background color of the pag rendering resource to the first preset color, and then uses the dynamic effect rendering tool to render each frame of the watermark image in the updated pag rendering resource into the corresponding video frame and perform video encoding.

[0175] Exemplarily, if the mobile phone receives a third input to the background color editing control 241 and the background color indicated by the third input is a second preset color such as red, yellow, or a gradient color in the "dopamine" color system, the content in the video frame image needs to be segmented first.

[0176] Step 1: The mobile phone can perform image matting on the video frame to remove the people, because the skin color and hair color of people will affect the color coordination of the overall picture. Step 2: Perform algorithm analysis on the video frame after removing the people to check what the main color tone of the remaining picture is, and perform a point light source recognition algorithm on the video frame to identify the light source area, position, and direction of the key content of the video frame, and then record the information for the light source direction, which is convenient for subsequent rendering of the dopamine 3D light and shadow image effect. Step 3: The color calculation method can also adopt a preset algorithm rule to reduce the proportion of color systems that are considered not good-looking by the dopamine rule, such as dark yellow color system, dark red color system, etc. Then, match the color identified by the AI main body of the picture with the second preset color indicated by the third input. For example: if the main color of the picture is "pink", compare it with the 20 preset colors and use the color closest to the current "pink" as the background color of the pag rendering resource. Step 4: First, update the background color of the pag rendering resource with the color identified by the AI, that is, the "background of the dynamic watermark", and then use the dynamic effect rendering pag algorithm to render the dynamic effect of the updated pag rendering resource onto each video frame.

[0177] It should be noted that during rendering, data calculation and rendering of image shadows can also be performed for the identified "light source position and light source angle" to ensure the gradient effect of dynamic dopamine and the 3D light and shadow effect.

[0178] Exemplarily, in the case where the watermark image type indicated by the above first watermark identifier is the in-picture watermark type, that is, adding a watermark within the livephoto picture, the mobile phone needs to perform image recognition on the video frame to check whether there are human objects in the video frame. If there are human objects, the video frame will be segmented, and the human picture and human background of each video frame will be processed. For example: after recognizing the facial expression of the person, if it is a smile, sadness, or other expressions, relevant expression elements such as smile and sadness will be displayed on the top of the person's head.

[0179] Exemplarily, the mobile phone can also update the background color of the pag rendering resource according to the recognized human expression, and then use the dynamic effect rendering tool to render the updated rendering resource into other areas except the area where the human object is located in each video frame as the background of the person, and perform video encoding.

[0180] Step 606: The mobile phone renders the watermark image corresponding to the cover frame photo of the Livephoto in the M-frame watermark image into the cover frame photo.

[0181] It should be noted that the process of rendering the watermark image on the cover frame photo can refer to the above step 605. To avoid repetition, it will not be elaborated here in this embodiment.

[0182] Step 607: Generate a LivePhoto with a dynamic watermark.

[0183] Exemplarily, the mobile phone can package the cover frame photo and the video frame with the watermark image rendered into the livephoto format to generate a Livephoto with a dynamic watermark.

[0184] Exemplarily, after generating a Livephoto with a dynamic watermark, the mobile phone can receive a seventh input of the user to the Livephoto with the dynamic watermark, and share the Livephoto with the dynamic watermark to a third-party platform for viewing.

[0185] The image processing method provided in the embodiment of the present application can combine the LivePhoto function with the dynamic watermark, and can allow mobile phone users of multiple models and platforms to use the LivePhoto dynamic watermark function in the system camera without relying on the platform or hardware. In addition, the image processing method provided in the embodiment of the present application can increase the fun and decoration of LivePhoto, and can also display the user's personal IP and other related information, greatly enhancing the user's personalized needs.

[0186] It should be noted that the above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or any two or more can be executed in combination with each other. The specific implementation method can be determined according to actual usage requirements, and the embodiments of the present application do not impose any restrictions on this.

[0187] The image processing method provided in the embodiment of the present application can be executed by an image processing device. In the embodiment of the present application, an image processing device executing the image processing method is taken as an example to illustrate the image processing device provided in the embodiment of the present application.

[0188] Figure 7 is a schematic diagram of the structure of an image processing device 700 provided in an embodiment of the present application. The image processing device 700 includes: a display module 701, a receiving module 702 and a processing module 703.

[0189] Among them, the display module 701 is used to display a watermark setting interface, which includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image; the receiving module 702 is used to receive a first input from a user for a first watermark identifier among the at least one watermark identifier displayed by the display module; the processing module 703 is used to obtain M frames of watermark images in response to the first input received by the receiving module, and the watermark image type of the M frames of watermark images is the watermark image type indicated by the first watermark identifier; based on the M frames of watermark images, a watermark image is added to N frames of image frames; wherein N and M are positive integers.

[0190] In some embodiments of the present application, the receiving module 702 is further configured to: before adding a watermark image to the N-frame image frames based on the M-frame watermark image, receive a second input; the processing module 703 is further configured to, in response to the second input, capture a dynamic photo or video; wherein, the N-frame image frames are the image frames in the dynamic photo or video.

[0191] In some embodiments of the present application, the processing module 703 is specifically configured to: determine the watermark image corresponding to each frame of the image frames from the M-frame watermark images; add the watermark image corresponding to each frame of the image frames to the corresponding image frames in the N-frame image frames; wherein, if M is greater than or equal to N, then determine the i-th watermark image in the first N-frame watermark images among the M-frame watermark images as the watermark image corresponding to the i-th image frame in the N-frame image frames, i ∈ [1, N]; or, if M is less than N, then determine the j-th watermark image among the M-frame watermark images as the watermark image corresponding to the (M - L*j)-th video image in the M-frame video images, j ∈ [1, M], L is a positive integer, and L*j is less than or equal to M.

[0192] In some embodiments of the present application, the processing module 703 is specifically configured to: add the watermark image corresponding to each frame of the image frames to the first area in the corresponding image frames in the N-frame image frames; wherein different watermark image types correspond to different image areas; the first area is the area corresponding to the watermark image type.

[0193] In some embodiments of the present application, the display module 701 is further configured to: after obtaining the M-frame watermark images, display an image editing interface corresponding to the first watermark identifier; the receiving module 702 is further configured to receive a third input to the image editing interface; the processing module is specifically configured to: in response to the third input, update the first watermark image and add the updated first watermark image to the first image frame, the first image frame is any one of the N-frame image frames, and the first watermark image is the watermark image corresponding to the first image frame among the M-frame watermark images.

[0194] In some embodiments of the present application, the image editing interface includes at least one editing control, and the at least one editing control includes a background color editing control; the receiving module 702 is specifically configured to: receive a third input to the background color editing control; the processing module 703 is specifically configured to: when the background color indicated by the third input is a first preset color, update the background color of the first watermark image to the first preset color; or, when the background color indicated by the third input is a second preset color, update the background color of the first watermark image to a target color, where the target color is determined based on the first image frame and the second preset color.

[0195] In some embodiments of the present application, the processing module 703 is further configured to: before updating the background color of the first watermark image to a target color, obtain image information of the image in the second region in the first image frame, where the second region is the other region in the first image frame except for the region where the foreground object is located; based on the image information, determine the color information of each color of the image in the second region; based on the color information of each color, determine a target color that matches the second preset color from all the colors of the image in the second region.

[0196] In some embodiments of the present application, before adding a watermark image to the N image frames based on the M-frame watermark image, the processing module 703 is further configured to perform at least one of the following: when the second image frame includes a human object, add an expression element to the second image frame based on the expression of the human object; when the second image frame includes a human object, save the human image in the second image frame; increase the light and shadow in the second watermark image; when the second image frame includes a human object, update the background color of the second watermark image; where the second image frame is any one of the N image frames, and the second watermark image is the watermark image corresponding to the second image frame in the M-frame watermark image.

[0197] In some embodiments of the present application, the M-frame watermark image includes dynamic effect elements; the processing module 703 is further configured to: before adding a watermark image to the N image frames based on the M-frame watermark image, if at least some of the dynamic effect elements in the third watermark image are in the third region of the third image frame, obtain a first sub-image in the third image frame, where the first sub-image is: the image in the region where at least some of the dynamic effect elements are located in the third region; save the first sub-image; where the third image frame is any one of the N image frames, and the third watermark image is the watermark image corresponding to the third image frame in the M-frame watermark image.

[0198] In the image processing apparatus provided in the embodiments of the present application, the image processing apparatus displays a watermark setting interface, which includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image; receives a first input from the user for a first watermark identifier among the at least one watermark identifier; in response to the first input, obtains M frames of watermark images, and the watermark image type of the M frames of watermark images is the watermark image type indicated by the first watermark identifier; based on the M frames of watermark images, adds watermark images to N image frames; where N and M are positive integers. In this solution, by displaying the watermark display screen, at least one watermark identifier indicating different types of watermark images can be presented to the user. In this way, when the electronic device receives an input for any watermark identifier, it can add watermark images to N image frames based on the multiple frames of watermark images indicated by the obtained watermark identifier. In this way, different types of multiple frames of watermark images can be added to N image frames, so that the watermark images added to the N image frames are not the same, thereby improving the diversity of the display effect of the watermarks on the images.

[0199] The image processing apparatus in the embodiments of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than a terminal. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device, an augmented reality / virtual reality device, a robot, a wearable device, a super mobile personal computer, a netbook, or a personal digital assistant, etc., and may also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.

[0200] The image processing apparatus in the embodiments of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.

[0201] The image processing apparatus provided in the embodiments of the present application can implement each process implemented by each embodiment of the above image processing method. To avoid repetition, it will not be elaborated here.

[0202] Optionally, as Figure 8As shown in the figure, an embodiment of the present application further provides an electronic device 800, including a processor 801 and a memory 802. A program or instruction that can run on the processor 801 is stored on the memory 802. When the program or instruction is executed by the processor 801, each step of the above-mentioned embodiment of the image processing method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.

[0203] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0204] Figure 9 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.

[0205] The electronic device 900 includes, but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, and a processor 910, etc.

[0206] Those skilled in the art can understand that the electronic device 900 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 910 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. Figure 9 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0207] Among them, the display unit 906 is used to display a watermark setting interface, and the watermark setting interface includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image; the user input unit 907 is used to receive a first input from the user to the first watermark identifier among the at least one watermark identifier displayed by the display module; the processor 910 is used to, in response to the first input received by the receiving module, obtain M frames of watermark images, and the watermark image type of the M frames of watermark images is the watermark image type indicated by the first watermark identifier; based on the M frames of watermark images, add watermark images to N frames of image frames; where N and M are positive integers.

[0208] In some embodiments of the present application, the user input unit 907 is further used to: before adding watermark images to N frames of image frames based on the M frames of watermark images, receive a second input; the processor 910 is further used to, in response to the second input, capture a dynamic photo or video; where the N frames of image frames are the image frames in the dynamic photo or video.

[0209] In some embodiments of the present application, the processor 910 is specifically configured to: determine a watermark image corresponding to each image frame from the M-frame watermark images; add the watermark image corresponding to each image frame to the corresponding image frame in the N-frame image frames; wherein, if M is greater than or equal to N, the i-th watermark image in the first N-frame watermark images among the M-frame watermark images is determined as the watermark image corresponding to the i-th image frame in the N-frame image frames, where i ∈ [1, N]; or, if M is less than N, the j-th watermark image in the M-frame watermark images is determined as the watermark image corresponding to the (M - L*j)-th video image in the M-frame video images, where j ∈ [1, M], L is a positive integer, and L*j is less than or equal to M.

[0210] In some embodiments of the present application, the processor 910 is specifically configured to: add the watermark image corresponding to each image frame to a first region in the corresponding image frame in the N-frame image frames; wherein different watermark image types correspond to different image regions; the first region is a region corresponding to the watermark image type.

[0211] In some embodiments of the present application, the display unit 906 is further configured to: after acquiring the M-frame watermark images, display an image editing interface corresponding to the first watermark identifier; the receiving module is further configured to receive a third input to the image editing interface; the processor 910 is specifically configured to: in response to the third input, update the first watermark image and add the updated first watermark image to the first image frame, where the first image frame is any image frame in the N-frame image frames, and the first watermark image is the watermark image corresponding to the first image frame among the M-frame watermark images.

[0212] In some embodiments of the present application, the image editing interface includes at least one editing control, and the at least one editing control includes a background color editing control; the user input unit 907 is specifically configured to: receive a third input to the background color editing control; the processor 910 is specifically configured to: in the case where the background color indicated by the third input is a first preset color, update the background color of the first watermark image to the first preset color; or, in the case where the background color indicated by the third input is a second preset color, update the background color of the first watermark image to a target color, where the target color is determined based on the first image frame and the second preset color.

[0213] In some embodiments of the present application, the processor 910 is further configured to: before updating the background color of the first watermark image to a target color, obtain the image information of the image in the second region in the first image frame, where the second region is the other region in the first image frame except for the region where the foreground object is located; determine the color information of each color of the image in the second region based on the image information; and determine a target color that matches the second preset color from all the colors of the image in the second region based on the color information of each color.

[0214] In some embodiments of the present application, before adding a watermark image to the N image frames based on the M-frame watermark image, the processor 910 is further configured to perform at least one of the following: when the second image frame contains a human object, add an expression element to the second image frame based on the expression of the human object; when the second image frame contains a human object, save the human image in the second image frame; increase the light and shadow in the second watermark image; when the second image frame contains a human object, update the background color of the second watermark image; where the second image frame is any one of the N image frames, and the second watermark image is the watermark image corresponding to the second image frame in the M-frame watermark image.

[0215] In some embodiments of the present application, the M-frame watermark image includes animation elements; the processor 910 is further configured to: before adding a watermark image to the N image frames based on the M-frame watermark image, if at least some of the animation elements in the third watermark image are in the third region of the third image frame, obtain the first sub-image in the third image frame, where the first sub-image is the image in the region where at least some of the animation elements are located in the third region; save the first sub-image; where the third image frame is any one of the N image frames, and the third watermark image is the watermark image corresponding to the third image frame in the M-frame watermark image.

[0216] In the electronic device provided in the embodiment of the present application, the electronic device displays a watermark setting interface, which includes at least one watermark identifier, and each watermark identifier is used to indicate a type of watermark image; receives a first input from the user for a first watermark identifier among the at least one watermark identifier; in response to the first input, obtains M frames of watermark images, and the watermark image type of the M frames of watermark images is the watermark image type indicated by the first watermark identifier; based on the M frames of watermark images, adds watermark images to N frames of image frames; where N and M are positive integers. In this solution, by displaying the watermark display screen, at least one watermark identifier indicating different types of watermark images can be presented to the user. In this way, when the electronic device receives an input for any watermark identifier, it can add watermark images to N frames of image frames based on the obtained multiple frames of watermark images indicated by the watermark identifier. In this way, different types of multiple frames of watermark images can be added to N frames of image frames, making the watermark images added to the N frames of image frames different from each other, thereby enhancing the diversity of the display effect of the watermarks on the images.

[0217] It should be understood that in the embodiment of the present application, the input unit 904 may include a Graphics Processing Unit (GPU) 9041 and a microphone 9042. The graphics processor 9041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 907 includes at least one of a touch panel 9071 and other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch controller. The other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.

[0218] The memory 909 can be used to store software programs and various data. The memory 909 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 909 can include volatile memory or non-volatile memory, or the memory 909 can include both volatile and non-volatile memory. Among them, the non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 909 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.

[0219] The processor 910 may include one or more processing units; optionally, the processor 910 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 910 either.

[0220] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above embodiment of the image processing method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0221] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.

[0222] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above embodiment of the image processing method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0223] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.

[0224] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the above embodiment of the image processing method, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0225] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.

[0226] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.

[0227] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.

Claims

1. An image processing method, characterized in that: The method comprises: Displaying a watermark setting interface, wherein the watermark setting interface includes at least one watermark identifier, each watermark identifier being used to indicate a type of watermark image; Receiving a first input of a first watermark identifier among the at least one watermark identifier by a user; In response to the first input, M frames of watermarked images are acquired, where the watermarked image type of the M frames of watermarked images is the watermarked image type indicated by the first watermark identifier; Based on the M frames of watermark images, adding a watermark image to the N frames of image frames; Wherein, N and M are positive integers.

2. The method according to claim 1, characterized in that Before adding the watermark image to the N image frames based on the M watermark images, the method further includes: receiving a second input; In response to the second input, capturing a dynamic photo or video; The N image frames are image frames in the dynamic photo or video.

3. The method according to claim 1, characterized in that The step of adding a watermark image to N frames of image frames based on the M frames of watermark image comprises: Determine the watermark image corresponding to each image frame from the M frames of watermark images; Adding the watermark image corresponding to each image frame to the corresponding image frame in the N image frames; Among them, if M is greater than or equal to N, the i-th watermark image in the first N watermark images in the M watermark images is determined as the corresponding watermark image of the i-th image frame in the N image frames, i∈[1,N]; or, if M is less than N, the j-th watermark image in the M watermark images is determined as the watermark image corresponding to the ML*j-th video image in the M video images, j∈[1,M], L is a positive integer, and L*j is less than or equal to M.

4. The method according to claim 3, characterized in that The step of adding a watermark image to N frames of image frames based on the M frames of watermark image comprises: Adding the watermark image corresponding to each image frame to the first area of ​​the image frame corresponding to the N image frames; Among them, different watermark image types correspond to different image areas; the first area is the area corresponding to the watermark image type.

5. The method according to claim 1, characterized in that Before adding the watermark image to the N image frames based on the M watermark images, the method further includes at least one of the following: In a case where the second image frame includes a human object, adding an expression element based on the expression of the human object on the second image frame; When the second image frame includes a person object, saving the person image in the second image frame; In the second watermark image, light and shadow are added; When the second image frame contains a person object, updating the background color of the second watermark image; The second image frame is any image frame among the N image frames, and the second watermark image is a watermark image corresponding to the second image frame among the M watermark images.

6. An image processing device, characterized in that: The device comprises: A display module, used to display a watermark setting interface, wherein the watermark setting interface includes at least one watermark identifier, each watermark identifier is used to indicate a type of watermark image; A receiving module, configured to receive a first input from a user regarding a first watermark identifier among the at least one watermark identifier displayed by the display module; a processing module, configured to obtain, in response to the first input received by the receiving module, M frames of watermark images, wherein the watermark image type of the M frames of watermark images is the watermark image type indicated by the first watermark identifier; Based on the M frames of watermark images, adding a watermark image to the N frames of image frames; Wherein, N and M are positive integers.

7. The device according to claim 6, characterized in that The receiving module is further used for: Based on the M frames of watermarked images, before adding the watermarked images to the N frames of image frames, receiving a second input; The processing module is further configured to capture a dynamic photo or video in response to the second input; The N image frames are image frames in the dynamic photo or video.

8. The device according to claim 6, characterized in that The processing module is specifically used for: Determine the watermark image corresponding to each image frame from the M frames of watermark images; Adding the watermark image corresponding to each image frame to the corresponding image frame in the N image frames; Among them, if M is greater than or equal to N, the i-th watermark image in the first N watermark images in the M watermark images is determined as the corresponding watermark image of the i-th image frame in the N image frames, i∈[1,N]; or, if M is less than N, the j-th watermark image in the M watermark images is determined as the watermark image corresponding to the ML*j-th video image in the M video images, j∈[1,M], L is a positive integer, and L*j is less than or equal to M.

9. The device according to claim 8, characterized in that The processing module is specifically used for: Adding the watermark image corresponding to each image frame to the first area of ​​the image frame corresponding to the N image frames; Among them, different watermark image types correspond to different image areas; the first area is the area corresponding to the watermark image type.

10. The device according to claim 6, characterized in that Before adding the watermark image to the N image frames based on the M watermark images, the processing module is further configured to perform at least one of the following: In a case where the second image frame includes a human object, adding an expression element based on the expression of the human object on the second image frame; When the second image frame includes a person object, saving the person image in the second image frame; In the second watermark image, light and shadow are added; When the second image frame contains a person object, updating the background color of the second watermark image; The second image frame is any image frame among the N image frames, and the second watermark image is a watermark image corresponding to the second image frame among the M watermark images.