Watermark generation method and apparatus, and device

WO2026200416A1PCT designated stage Publication Date: 2026-10-01HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/080805
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-03-25
Filing Date
2026-03-02
Publication Date
2026-10-01

Smart Images

  • Figure CN2026080805_01102026_PF_FP_ABST
    Figure CN2026080805_01102026_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a watermark generation method and apparatus, and a device. The method comprises: acquiring n duplicate images (second images) of a first image; and, according to n values, modifying pixel values of a plurality of specified pixels of the n second images, and obtaining n third images containing watermark images, the n values all being non-zero, and the sum of the n values satisfying a threshold range centered at zero. When a first video stream generated from the n third images is displayed at a rate equal to or higher than a flicker fusion frequency, an image perceived by a human eye is an average of the sum of pixel values of respective pixels of the n third images, and the sum of the adjusted pixel values of pixels corresponding to the watermark images on the n third images is equal to zero or approximately equal to zero, so that the image perceived by the human eye does not contain the watermark image. When a screenshot or photograph is taken, since each third image in the first video stream contains the watermark image, there is a watermark on the screenshot or photographed image. Thus, the generated watermark can not only serve as an early warning function, but also remain imperceptible to users.
Need to check novelty before this filing date? Find Prior Art

Description

Watermark generation methods, devices and equipment

[0001] This application claims priority to Chinese Patent Application No. 202510367233.3, filed on March 25, 2025, entitled "Watermark Generation Method, Apparatus and Device", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of multimedia technology, and in particular to a watermark generation method, apparatus and device. Background Technology

[0003] Watermarking is a digital protection technique that uses computer algorithms to embed protective information into a file. It effectively protects information security, enables anti-counterfeiting and traceability, and acts as a deterrent, thereby reducing potential leaks. Watermarks are typically generated by embedding watermark information into an image. When the image is displayed, the watermark information is displayed semi-transparently across the entire screen, serving as a warning against user actions such as screenshotting or forwarding. However, a large area of ​​watermark information covering the screen can obscure the image content, negatively impacting the user experience. Summary of the Invention

[0004] This application provides a watermark generation method, apparatus, and device. The generated watermark can serve as an early warning function and also be invisible to users, thereby improving user experience. The technical solution is as follows.

[0005] In a first aspect, a watermark generation method is provided, the method comprising: acquiring n second images, wherein the second images are copies of the first images, and n is a positive integer greater than or equal to 2; modifying the pixel values ​​of multiple specified pixels on the n second images according to n values ​​to obtain n third images containing watermark images, wherein the n values ​​correspond one-to-one with the n second images, all n values ​​are non-zero and the sum of the n values ​​satisfies a threshold range centered at zero, and the multiple specified pixels are used to represent the information of the watermark images; and generating a first video stream based on the n third images, wherein the first video stream is displayed at a flash fusion frequency equal to or higher than the flash fusion frequency.

[0006] When the first video stream is displayed at a flash fusion frequency equal to or higher than the flash fusion frequency, the pixel values ​​of the image seen by the human eye are the average of the pixel values ​​of the n third images. Since the sum of the n values ​​satisfies a threshold range centered at zero, it means that the sum of the n values ​​is equal to or approximately equal to zero. Therefore, the sum of the adjusted pixel values ​​of the pixels at the corresponding positions of the watermark images on the n third images is equal to or approximately equal to zero. In other words, the pixel values ​​of the pixels at the corresponding positions of the watermark images on the n third images are restored to the pixel values ​​before the modification of the n second images. The second images are copies of the first images and do not contain the watermark image. Therefore, the image seen by the human eye does not contain the watermark image, and thus the watermark image on each image in the first video stream is not visible to the human eye. Furthermore, when taking a screenshot or photograph of the first video stream, the screenshot or photograph captures one of the n third images in the first video stream. This means that when taking a screenshot or photograph, the first video stream is frozen on a certain third image. Since each third image in the first video stream contains a watermark image, the screenshot or photograph has a watermark image, effectively serving as a warning. Therefore, the watermark generated in this application can both serve as a warning and be invisible to the user, improving the user experience.

[0007] In one possible implementation, the threshold range is -0.02 to +0.02. The threshold range can be understood as the set of zero and values ​​near zero. For example, the threshold range could be -0.02 to +0.02. That is, the sum of n values ​​is any value between -0.02 and +0.02. Or, more simply, the sum of n values ​​is equal to or close to zero.

[0008] In one possible implementation, if n is 2, the pixel values ​​of multiple specified pixels on n second images are modified according to n values ​​to obtain n third images containing watermarks. This includes: modifying the pixel values ​​of multiple specified pixels on the first second image according to a first value to obtain a first third image containing watermarks; and modifying the pixel values ​​of multiple specified pixels on the second second image according to a second value to obtain a second third image containing watermarks. The sum of the second value and the first value satisfies a threshold range. In this application, the first image is copied into two images, and the pixel values ​​of multiple specified pixels on the two images are modified using two values ​​(such as the first value and the second value), provided that the sum of the first value and the second value satisfies a threshold range centered at zero.

[0009] In one possible implementation, if n is 3, the pixel values ​​of multiple specified pixels on n second images are modified according to n values ​​to obtain n third images containing watermarks. This includes: modifying the pixel values ​​of multiple specified pixels on a third second image according to a third value to obtain a third third image containing watermarks; modifying the pixel values ​​of multiple specified pixels on a fourth second image according to a fourth value to obtain a fourth third image containing watermarks; and modifying the pixel values ​​of multiple specified pixels on a fifth second image according to a fifth value to obtain a fifth third image containing watermarks. The sum of the third, fourth, and fifth values ​​satisfies a threshold range. This application is not limited to copying the first image into two images; it can also copy three images and modify the pixel values ​​of multiple specified pixels on the three images using three values ​​(such as the third, fourth, and fifth values), provided that the sum of the third, fourth, and fifth values ​​satisfies a threshold range centered at zero.

[0010] In one possible implementation, n is determined based on the image frame rate and flash fusion frequency of the second video stream, which includes the first image. By determining the number of copied images based on the image frame rate and flash fusion frequency of the second video stream, the display effect of the video stream formed by this number of images on the display screen can be smoother, effectively avoiding flickering.

[0011] In one possible implementation, modifying the pixel values ​​of multiple specified pixels in a first second image according to a first value to obtain a first third image containing a watermark includes: if the first second image is an image in the RGB color space, converting the first second image from the RGB color space to a first target color space to obtain a first intermediate image; modifying the pixel values ​​of multiple specified pixels in the first intermediate image according to the first value to obtain a second intermediate image; and converting the second intermediate image from the first target color space back to the RGB color space to obtain the first third image containing the watermark. By converting a second image in the RGB color space into a first intermediate image in the first target color space, and then modifying the pixel values ​​of multiple specified pixels in that image, the video stream generated from the third image obtained based on the above modifications can achieve a better effect of providing the user with an invisible watermark image.

[0012] In one possible implementation, modifying the pixel values ​​of multiple specified pixels in a second second image according to a second value to obtain a second third image containing a watermark includes: if the second second image is an image in the RGB color space, converting the second second image from the RGB color space to a second target color space to obtain a third intermediate image; modifying the pixel values ​​of multiple specified pixels in the third intermediate image according to the second value to obtain a fourth intermediate image; and converting the fourth intermediate image from the second target color space to the RGB color space to obtain the second third image containing the watermark. By converting another second image in the RGB color space into a third intermediate image in the second target color space, and then modifying the pixel values ​​of multiple specified pixels in that image, the video stream generated based on the above modifications to obtain another third image can achieve a better effect of providing the user with an invisible watermark image.

[0013] In one possible implementation, both the first and second target color spaces include any one of the CIELAB, XYZ, or OKLAB color spaces. Modifying the pixel values ​​of the image within these listed color spaces improves the effect of making the watermark image invisible to the user.

[0014] In one possible implementation, the pixel values ​​of each pixel in the third image satisfy the following conditions: the R, G, and B values ​​are all between a first threshold and a second threshold, with the first threshold being less than the second threshold. For example, the first threshold is 0, and the second threshold is 1. By ensuring that the pixel values ​​of each pixel in the third image are all between 0 and 1, it is guaranteed that the image converted back to the RGB color space can be displayed correctly.

[0015] In one possible implementation, the first value is determined based on the first intensity and the pixel value of the pixel on the watermark image, and the second value is determined based on the second intensity and the pixel value of the pixel on the watermark image. The first intensity and the second intensity represent the weights of the pixel values ​​of the pixel on the watermark image, and the sum of the first intensity and the second intensity satisfies a threshold range centered at zero.

[0016] In one possible implementation, before modifying the pixel values ​​of multiple specified pixels on n second images according to n numerical values ​​to obtain n third images containing watermarks, the method further includes: generating a watermark image; and determining multiple specified pixels on the second and third images based on the watermark image. By generating the watermark image in advance according to the size of the first image, a reference can be provided for determining multiple specified pixels on the second and third images, ensuring the accuracy and aesthetics of the watermark image.

[0017] In one possible implementation, the size of the watermark image is the same as the size of the first image. By generating the watermark image according to the size of the first image, ensuring that the size of the watermark image is the same as the size of the first image, the watermark image fills the screen, effectively preventing the watermark image from being easily erased, making the watermark image difficult to remove.

[0018] In one possible implementation, the watermark image is a binary image. Since binary images offer the best visibility, using a binary image for the watermark ensures its visibility and enhances its warning effect. Furthermore, using a binary image allows for better control over the first and second numerical values, facilitating their adjustment.

[0019] Secondly, a watermark generation device is provided, comprising: an acquisition module for acquiring n second images, wherein the second images are copies of the first images, and n is a positive integer greater than or equal to 2; a modification module for modifying the pixel values ​​of multiple specified pixels on the n second images according to n values ​​to obtain n third images containing watermark images, wherein the n values ​​correspond one-to-one with the n second images, all n values ​​are non-zero and the sum of the n values ​​satisfies a threshold range centered at zero, and the multiple specified pixels are used to represent the information of the watermark images; and a generation module for generating a first video stream based on the n third images, wherein the first video stream is displayed at a flash fusion frequency equal to or higher than the flash fusion frequency.

[0020] In one possible implementation, the threshold ranges from -0.02 to +0.02.

[0021] In one possible implementation, if n is 2, the modification module is used to: modify the pixel values ​​of multiple specified pixels on the first second image according to the first value to obtain the first third image containing the watermark image; modify the pixel values ​​of multiple specified pixels on the second second image according to the second value to obtain the second third image containing the watermark image, wherein the sum of the second value and the first value satisfies the threshold range.

[0022] In one possible implementation, if n is 3, the modification module is used to: modify the pixel values ​​of multiple specified pixels on the third second image according to the third value to obtain the third third image containing the watermark; modify the pixel values ​​of multiple specified pixels on the fourth second image according to the fourth value to obtain the fourth third image containing the watermark; and modify the pixel values ​​of multiple specified pixels on the fifth second image according to the fifth value to obtain the fifth third image containing the watermark, wherein the sum of the third, fourth, and fifth values ​​satisfies the threshold range.

[0023] In one possible implementation, n is determined based on the image frame rate and flash fusion frequency of the second video stream, which includes the first image.

[0024] In one possible implementation, the modification module is used to: if the first second image is an image in the RGB color space, convert the first second image from the RGB color space to the first target color space to obtain a first intermediate image; modify the pixel values ​​of multiple specified pixels in the first intermediate image according to a first value to obtain a second intermediate image; and convert the second intermediate image from the first target color space to the RGB color space to obtain a first third image containing a watermark image.

[0025] In one possible implementation, the modification module is used to: if the second second image is an image in the RGB color space, convert the second second image from the RGB color space to the second target color space to obtain the third intermediate image; modify the pixel values ​​of multiple specified pixels on the third intermediate image according to the second value to obtain the fourth intermediate image; and convert the fourth intermediate image from the second target color space to the RGB color space to obtain the second third image containing the watermark image.

[0026] In one possible implementation, both the first target color space and the second target color space include any one of the CIELAB color space, XYZ color space, or OKLAB color space.

[0027] In one possible implementation, the pixel values ​​of each pixel in the third image satisfy the following conditions: the R value, G value, and B value are all between a first threshold and a second threshold, where the first threshold is less than the second threshold. For example, the first threshold is 0, and the second threshold is 1.

[0028] In one possible implementation, the first value is determined based on the first intensity and the pixel value of the pixel on the watermark image, and the second value is determined based on the second intensity and the pixel value of the pixel on the watermark image. The first intensity and the second intensity represent the weights of the pixel values ​​of the pixel on the watermark image, and the sum of the first intensity and the second intensity satisfies a threshold range.

[0029] In one possible implementation, the apparatus further includes: a generation module for generating a watermark image; and a determination module for determining a plurality of specified pixels on a second image and a third image based on the watermark image.

[0030] In one possible implementation, the size of the watermark image is the same as the size of the first image.

[0031] In one possible implementation, the watermark image is a binary image.

[0032] Thirdly, an electronic device is provided, the electronic device including a processor coupled to a memory; the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to enable the electronic device to implement the method of the first aspect.

[0033] Fourthly, a computer-readable storage medium is provided, wherein at least one instruction is stored therein, the instruction being loaded and executed by a processor to implement the method described in the first aspect.

[0034] Fifthly, a computer program product is provided, the computer program product comprising a computer program / instructions, the computer program / instructions being executed by a processor to enable a computer to perform the method described in the first aspect.

[0035] In a sixth aspect, a chip is provided, the chip including a processor for retrieving and executing instructions stored in a memory, causing a computer having the chip installed to perform the method described in the first aspect.

[0036] In a seventh aspect, a chip is provided, the chip comprising: an input interface, an output interface, a processor, and a memory, wherein the input interface, the output interface, the processor, and the memory are connected via an internal connection path, the processor is configured to execute code in the memory, and when the code is executed, a computer having the chip installed performs the method described in the first aspect.

[0037] It should be understood that the watermark generating device mentioned in the second aspect above can be the chip mentioned in the sixth or seventh aspect, or the electronic device mentioned in the third aspect. The beneficial effects achieved by the technical solutions and corresponding possible implementations of the second to seventh aspects of this application can be found in the above description of the technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description

[0038] Figure 1 is a schematic diagram of a visible watermark provided in related technologies;

[0039] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0040] Figure 3 is a schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;

[0041] Figure 4 is a flowchart illustrating a watermark generation method provided in an embodiment of this application;

[0042] Figure 5 is a flowchart illustrating another watermark generation method provided in an embodiment of this application;

[0043] Figure 6 is a flowchart illustrating another watermark generation method provided in an embodiment of this application;

[0044] Figure 7 is a flowchart illustrating another watermark generation method provided in an embodiment of this application;

[0045] Figure 8 is a flowchart illustrating another watermark generation method provided in an embodiment of this application;

[0046] Figure 9 is a flowchart illustrating another watermark generation method provided in an embodiment of this application;

[0047] Figure 10 is a flowchart illustrating another watermark generation method provided in an embodiment of this application;

[0048] Figure 11 is a flowchart illustrating another watermark generation method provided in an embodiment of this application;

[0049] Figure 12 is a schematic diagram of a watermark generation device provided in an embodiment of this application. Detailed Implementation

[0050] The terminology used in the implementation section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application.

[0051] Watermarking is crucial for tracing leaks of sensitive information. It effectively protects information security, prevents counterfeiting and facilitates traceability, and serves as a warning against leaks such as screenshotting and forwarding, thus deterring potential leaks. Watermarks can be visible or invisible. For example, a visible watermark is a semi-transparent, repeated display on the screen when multimedia files are shown.

[0052] For example, a visible watermark is generated by modifying the pixel values ​​of multiple specified pixels on each image included in a multimedia file to form a watermark on each image. Thus, at the first refresh display moment of the electronic device's screen, first image data is determined, which includes the pixel values ​​of multiple specified pixels, and an image is drawn based on these pixel values ​​to obtain an image with the watermark meaning, as shown in Figure 1, such as "Employee ID 12345". Similarly, at the second refresh display moment of the electronic device's screen, second image data is determined, which includes the pixel values ​​of multiple specified pixels, and an image is drawn based on these pixel values ​​to obtain an image with the watermark meaning, as shown in Figure 1. This process is repeated to obtain multiple images. These multiple images constitute a multimedia file. Thus, when the multimedia file is displayed, the watermark is repeatedly displayed on the screen in a semi-transparent manner. Although a visible watermark serves as a warning against user actions such as screenshotting and forwarding that could lead to data leaks, the visible watermark typically covers a large area of ​​the screen when displayed, obscuring the content of the multimedia file and affecting the user experience.

[0053] To address the aforementioned technical problems, this application provides a watermark generation method. The method includes: acquiring n second images, where each second image is a copy of a first image, and n is a positive integer greater than or equal to 2; modifying the pixel values ​​of multiple specified pixels on the n second images according to n numerical values ​​to obtain n third images containing watermark images, where the n numerical values ​​correspond one-to-one with the n second images, and the n second images correspond one-to-one with the n third images, all n numerical values ​​are non-zero and the sum of the n numerical values ​​satisfies a threshold range centered at zero, and the multiple specified pixels are used to represent information of the watermark image; and generating a first video stream based on the n third images. When the first video stream is displayed at a flash fusion frequency equal to or higher than the flash fusion frequency, the pixel values ​​of the image seen by the human eye are the average of the pixel values ​​of the n third images. Since the sum of the n values ​​satisfies a threshold range centered at zero, it means that the sum of the n values ​​is equal to or approximately equal to zero. Therefore, the sum of the pixel values ​​adjusted at the corresponding positions of the watermark images on the n third images is equal to or approximately equal to zero. In other words, the pixel values ​​of the pixels at the corresponding positions of the watermark images on the n third images are restored to the pixel values ​​before the modification of the n second images. The second images are copies of the first images and do not contain watermark images. Therefore, the image seen by the human eye does not contain watermark images, so the watermark images on the images in the first video stream are not visible to the human eye. In addition, when a screenshot or photograph is taken of the first video stream, the screenshot or photograph captures a certain third image in the first video stream. This means that when the screenshot or photograph is taken, the first video stream is frozen on a certain third image. Since each third image in the first video stream contains a watermark image, the screenshot or photograph has a watermark image, which effectively serves as a warning. Therefore, the watermark generated in this application can serve as an early warning function and also be invisible to users, thus improving the user experience.

[0054] The watermark generation method provided in this application can be applied to various scenarios for preventing the leakage of sensitive content, such as meeting scenarios, video scenarios, and game scenarios. Of course, this application is not limited to the above scenarios and can also be applied to other scenarios, such as file browsing scenarios, sharing scenarios, and screen projection scenarios.

[0055] The execution subject of the above watermark generation method can be an electronic device or a component located in the electronic device (e.g., a chip, chip system, or processor). The following description takes an electronic device as the execution subject. The electronic device can be a mobile phone, tablet computer, laptop, notebook computer, ultra-mobile personal computer (UMPC), handheld computer, netbook, personal digital assistant (PDA), wearable electronic device, etc. The specific form of the electronic device is not specially limited in the embodiments of this application.

[0056] Figure 2 is a structural block diagram of an electronic device provided in an embodiment of this application.

[0057] As shown in Figure 2, the electronic device 100 may include a processor 210, a memory 220, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, a wireless communication module 260, a display screen 270, and a sensor module 250, etc. The sensor module 250 may include a pressure sensor 250A, a touch sensor 250B, etc.

[0058] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0059] Processor 210 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0060] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0061] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0062] The charging management module 240 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 receives charging input from the wired charger via a USB interface 230. In some wireless charging embodiments, the charging management module 240 receives wireless charging input via the wireless charging coil of the electronic device. While charging the battery 242, the charging management module 240 can also supply power to the electronic device via the power management module 241.

[0063] The power management module 241 connects the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, providing power to the processor 210, display screen 270, and wireless communication module 260, etc. The power management module 241 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 241 may also be located within the processor 210. In other embodiments, the power management module 241 and the charging management module 240 may be located in the same device.

[0064] The wireless communication function of electronic devices can be realized through antenna 1, wireless communication module 260, modem processor and baseband processor, etc.

[0065] Antenna 1 is used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in conjunction with a tuning switch.

[0066] The wireless communication module 260 can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via antenna 1, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 210. The wireless communication module 260 can also receive signals to be transmitted from processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 1. In some embodiments, the wireless communication module 260 receives application information sent by a server.

[0067] Electronic devices implement display functions through a GPU, a display screen 270, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 270 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0068] The display screen 270 is used to display images, videos, etc. The display screen 270 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include one or N displays 270, where N is a positive integer greater than 1.

[0069] In some embodiments, the processor 210 is configured to acquire n second images, each a copy of a first image; modify the pixel values ​​of multiple specified pixels in the n second images according to n values ​​to obtain n third images containing a watermark, wherein all n values ​​are non-zero and the sum of the n values ​​satisfies a threshold range centered at zero, and the multiple specified pixels are used to represent information of the watermark image; and generate a first video stream based on the n third images. The processor then sends the first video stream to the display screen 270, which refreshes and displays each image in the first video stream at or above a flash fusion frequency. In this scenario, the pixel values ​​of the image seen by the human eye are the average of the pixel values ​​of the n third images. Since the sum of the n values ​​satisfies a threshold range centered at zero, it means that the sum of the n values ​​is equal to or approximately equal to zero. Therefore, the sum of the adjusted pixel values ​​of the pixels at the corresponding positions of the watermark images on the n third images is equal to or approximately equal to zero. In other words, the pixel values ​​of the pixels at the corresponding positions of the watermark images on the n third images are restored to the pixel values ​​before the modification of the n second images. The second images are copies of the first image and do not contain the watermark image. Therefore, the image seen by the human eye does not contain the watermark image, and thus the watermark image on each image in the first video stream is not visible to the human eye. Furthermore, when taking a screenshot or photograph of the first video stream, the screenshot or photograph captures a specific third image in the first video stream. This means that when taking a screenshot or photograph, the first video stream is frozen on a specific third image. Since each third image in the first video stream contains a watermark image, the screenshot or photograph has a watermark image, effectively serving as a warning. Therefore, the watermark generated in this application can serve as an early warning function and also be invisible to users, thus improving the user experience.

[0070] The memory 220 can be used to store computer executable program code, which includes instructions. The memory 220 may include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, phone books, etc.). Furthermore, the memory 220 can be non-transitory memory, which can be volatile or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM). Memory 1405 can also be a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital universal discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices. It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory. The processor 210 performs various functional applications and data processing of the electronic device by executing instructions stored in the memory 220 and / or instructions stored in the memory set in the processor.

[0071] Pressure sensor 250A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 250A can be disposed on display screen 270. There are many types of pressure sensors 250A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 250A, the capacitance between the electrodes changes. The electronic device determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 270, the electronic device detects the intensity of the touch operation based on pressure sensor 250A. The electronic device can also calculate the touch position based on the detection signal from pressure sensor 250A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0072] Touch sensor 250B, also known as a "touch device," can be located on display screen 270. The touch sensor 250B and display screen 270 together form a touchscreen, also known as a "touchscreen." Touch sensor 250B is used to detect touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 270. In other embodiments, touch sensor 250B may also be located on the surface of the electronic device, in a different position than display screen 270.

[0073] Of course, electronic devices may also include other functional units, and this application embodiment does not limit this.

[0074] In some embodiments, the software system of electronic device 100 may adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. For example, taking the layered architecture of the software system of electronic device 100 as an example, Figure 3 shows a schematic diagram of the software structure of electronic device 100 in Figure 2.

[0075] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces.

[0076] As shown in Figure 3, the electronic device 100 includes at least two layers, from top to bottom: the application layer (or application program layer) and the system service layer.

[0077] The application layer includes a series of application packages, such as system applications (e.g., Settings, Calendar, App Store, etc.) and third-party applications. For example, third-party applications may include, but are not limited to, third-party applications downloaded from app stores, such as video applications, game applications, and conferencing applications (not shown in the figure). In some embodiments, applications in the application layer can submit rendering instructions to the rendering service in the system service layer to complete the rendering of the application interface, etc.

[0078] The system service layer may include a rendering service. The rendering service may include an acquisition module, a modification module, and a rendering module. The acquisition module can be used to copy the first image indicated by the rendering command sent by the application layer, obtaining n second images. The modification module can be used to modify the pixel values ​​of multiple specified pixels on the n second images according to n values, obtaining n third images containing watermarked images, where the multiple specified pixels are used to describe the watermarked images. The rendering module can perform rendering based on the pixel values ​​of the multiple specified pixels on the copied images modified by the modification module, to obtain the rendering result, i.e., the n third images containing watermarked images, which can then be sent to a display screen for display. The acquisition and modification modules are not limited to the system service layer and can also be located in the application layer; this embodiment does not impose specific limitations.

[0079] It is understood that the software architecture of the electronic device 100 shown in Figure 3 is merely an illustrative example. In practical applications, it may include more or fewer modules, and the layers to which each module belongs may also differ. Other ways of dividing the layers are also possible, and this application does not impose any restrictions on them.

[0080] The technical solutions involved in the following embodiments can all be implemented in devices with the structures shown in Figures 2 and 3.

[0081] The following describes in detail a watermark generation method provided by an embodiment of this application with reference to examples. Figure 4 is a schematic flowchart of a watermark generation method provided by an embodiment of this application. As shown in Figure 4, the execution subject of this method can be an electronic device, and the method may include: S401-S403.

[0082] S401. Obtain n second images, where each second image is a copy of the first image, and n is a positive integer greater than or equal to 2.

[0083] The first image can be understood as a single frame in a streaming media file. This streaming media file could be a meeting video file recorded by a conferencing application, a game screen running in a game application, or a video file played by a video application. Therefore, the content represented by the first image differs depending on the application scenario. For example, in a conferencing scenario, the first image could be the meeting interface of the conferencing application. In a game scenario, the first image could be the game interface of the game application. In a video scenario, the first image could be the video playback interface of the video application.

[0084] A copy of the first image (i.e., the second image) can be understood as an image identical to the first image. The second image does not contain the base watermark image. The number of copies of the first image is n. In one example, the number of copies is... f t It is the target frame rate, used to represent the number of images displayed per second in the resulting video file or video stream; f sr It is the raw frame rate, used to characterize the number of images displayed per second in the source video, f sr <f t In one example, f t The flash fusion frequency can be equal to or higher than the flash fusion frequency, which can be 60Hz. For example, n can be an even number. For instance, n=2 means acquiring two second images. Similarly, n=4 means acquiring four second images. And n=6 means acquiring six second images. Of course, n can also be an odd number. For example, n=3 means acquiring three second images. And n=5 means acquiring five second images. In this embodiment, n can be any positive integer satisfying the above conditions, and will not be listed individually here. In this embodiment, n=2 and n=3 are used as examples for detailed explanation.

[0085] The aforementioned electronic device may include a rendering service, and applications, such as system applications or third-party applications, may be installed on the electronic device. The execution entity for obtaining n second images can be either the rendering service on the electronic device or an application on the electronic device. The following provides a detailed description of S401 for different execution entities. First, if the execution entity is a rendering service, then S401 can be implemented as follows: the rendering service receives rendering instruction 1 submitted by the application, which instructs the rendering of a first image; the rendering service copies the first image according to rendering instruction 1 to obtain n second images. Second, if the execution entity is an application, then S401 can be implemented as follows: the application copies the first image to obtain n second images and submits rendering instruction 2 to the rendering service, which instructs the rendering of n second images; the rendering service performs the rendering operation according to rendering instruction 2.

[0086] S402. Modify the pixel values ​​of multiple specified pixels on n second images according to n values ​​to obtain n third images containing watermark images. Multiple specified pixels are used to represent the information of the watermark images. All n values ​​are non-zero and the sum of the n values ​​satisfies the threshold range centered at zero.

[0087] It is worth noting that watermark images can be described from two aspects: intensity and content. At the content level, the watermark images of the n third images in this application have the same content. At the intensity level, the intensity values ​​of corresponding pixels in the watermark images of the n third images in this application are different. The watermark images described in this step emphasize content, not intensity; therefore, this step can be understood as multiple identical watermark images included in the n third images.

[0088] The threshold range can be understood as the set of zero and values ​​near zero. For example, in one embodiment, the threshold range could be -0.02 to +0.02. That is, the sum of n values ​​is any value between -0.02 and +0.02. Or, in simpler terms, the sum of n values ​​is zero; or the sum of n values ​​is close to zero, such as -0.02. Another example is +0.02. Yet another example is 0.01, and so on.

[0089] There are n numerical values ​​that correspond one-to-one with n second images, and n second images that correspond one-to-one with n third images. Some of the n third images may be the same or completely different. This means that modifying the pixel values ​​of multiple specified pixels in one second image using a single numerical value yields a third image; modifying the pixel values ​​of multiple specified pixels in another second image using another numerical value yields another third image, and so on. It should be noted that the pixel values ​​of each pixel in the second image and the pixel values ​​of each pixel in the third image obtained after modifying the pixels in the second image both satisfy the range 0-255.

[0090] In this context, modifying the pixel values ​​of multiple specified pixels on a second image using a single numerical value can be understood as modifying multiple specified pixels on a second image using a single numerical value, meaning that multiple specified pixels on an image are modified by the same numerical value. However, this embodiment is not limited to this; it can also modify one or some specified pixels among multiple specified pixels with a single numerical value, as long as the sum of the modified values ​​for the same pixel on n second images meets a threshold range.

[0091] In one example, as shown in Figure 5, assuming n = 2, S402 can be implemented as follows: Modify the pixel values ​​of multiple specified pixels in the first second image according to a first value to obtain a first third image containing the watermark; modify the pixel values ​​of multiple specified pixels in the second second image according to a second value to obtain a second third image containing the watermark, where the sum of the second value and the first value satisfies a threshold range. For example, the multiple specified pixels may include a first pixel, whose pixel value in the first second image is a1. The first value is +b1, the second value is -b1, and the sum of the first and second values ​​is b1 - b1 = 0. Therefore, modifying the pixel value of the first pixel in the first second image using the first value yields a pixel value of a1 + b1 in the first third image; modifying the pixel value of the first pixel in the second second image using the second value yields a pixel value of a1 - b1 in the second third image. Of course, the multiple specified pixels may also include a second pixel, whose pixel value in the first second image is a2. As described above, by modifying the pixel value of the second pixel in the first second image using the first numerical value, the pixel value of the second pixel in the first third image is obtained as a2+b1; by modifying the pixel value of the second pixel in the second second image using the second numerical value, the pixel value of the second pixel in the second third image is obtained as a2-b1. And so on. Multiple specified pixels can also include other pixels, such as the third pixel, the fourth pixel, etc., all of which are modified using the above method, and will not be described in detail here.

[0092] Of course, the sum of the first and second values ​​mentioned above is not limited to 0. For example, b1 is +19.98, and -b1 is -19.99. Therefore, the sum of the first and second values, +19.98 - 19.99 = -0.01. Thus, modifying the first pixel in the first second image using the first value yields a1 + 19.98 as the pixel value of the first pixel in the first third image; modifying the first pixel in the second second image using the second value yields a1 - 19.99 as the pixel value of the first pixel in the second third image. This example in the embodiments of this application is merely illustrative and is not limited to this example.

[0093] In another example, assuming n = 3, S402 can be implemented as follows: Modify the pixel values ​​of multiple specified pixels in the third second image according to the third value to obtain the third third image containing the watermark; modify the pixel values ​​of multiple specified pixels in the fourth second image according to the fourth value to obtain the fourth third image containing the watermark; modify the pixel values ​​of multiple specified pixels in the fifth second image according to the fifth value to obtain the fifth third image containing the watermark. The sum of the third, fourth, and fifth values ​​satisfies the threshold range, where the third, fourth, and fifth values ​​are all non-zero. For example, the multiple specified pixels include the first pixel, whose pixel value is a1 in the first second image. The third value is c1, the fourth value is -c2, and the fifth value is -c3. The sum of the third, fourth, and fifth values ​​is c1 - c2 - c3 = 0. Then, the pixel value of the first pixel in the first second image is modified by the third value to obtain the pixel value of the first pixel in the first third image as a1+c1; the pixel value of the first pixel in the second second image is modified by the fourth value to obtain the pixel value of the first pixel in the second third image as a1-c2; and the pixel value of the first pixel in the second second image is modified by the fifth value to obtain the pixel value of the first pixel in the second third image as a1-c3.

[0094] Of course, the sum of the third, fourth, and fifth values ​​mentioned above is not limited to 0. For example, c1 is +10, -c2 is -5.99, and c3 is -4. Therefore, the sum of the third, fourth, and fifth values ​​is +10 - 5.99 - 4 = +0.01. Thus, modifying the first pixel in the first second image using the third value yields a1 + 10; modifying the first pixel in the second second image using the fourth value yields a1 - 5.99; and modifying the first pixel in the second second image using the fifth value yields a1 - 4. This example in the embodiments of this application is merely illustrative and is not limited to this example.

[0095] Each of the above n values ​​is determined based on its corresponding intensity and the pixel value of the pixel in the watermark image. This intensity can be represented as the weight of the pixel value in the watermark image. For example, as shown in Figure 6, the first value is determined based on the first intensity and the pixel value of the pixel in the watermark image. Assuming the first intensity is γ1 and the pixel value of the pixel in the watermark image is β, then the first value + b1 is γ1*β. Similarly, the second value is determined based on the second intensity and the pixel value of the pixel in the watermark image. Assuming the second intensity is γ2 and the pixel value of the pixel in the watermark image is β, then the second value - b1 is γ2*β. The sum of the first intensity and the second intensity satisfies the threshold range. Since the pixel value of the pixel in the watermark image is a fixed value, the sum of the first value and the second value also satisfies the threshold range. Similarly, assuming there are n intensities, then at a certain pixel position (x, y), the intensity γ of n consecutive frames... i Satisfying: The sum of n intensities satisfies a threshold range; for example, the sum of n intensities equals zero, and its expression can be: Based on this, the pixel value of a specified pixel in the first third image is the sum of the pixel value of the specified pixel in the first second image and a first value. For example, if the specified pixel is the first pixel, the pixel value of the first pixel in the first third image is a1 + γ1 * β. Similarly, the pixel value of a specified pixel in the second third image is the sum of the pixel value of the specified pixel in the second second image and a second value. For example, if the specified pixel is the first pixel, the pixel value of the first pixel in the second third image is a2 + γ2 * β. And so on, until the pixel value of the first pixel in the nth third image is an + γ. n *β.

[0096] To enhance the effect of making the image invisible to the user, the second image needs to be converted to a different color space, and then the pixel values ​​of specified pixels on the image are modified. In one possible implementation, as shown in Figure 7, step S402 can be implemented as follows: if the second image is an image in the RGB color space, then the second image is converted from the RGB color space to a target color space to obtain an intermediate image; the pixel values ​​of multiple specified pixels on the intermediate image are modified according to a certain value to obtain another intermediate image; the other intermediate image is converted from a target color space to the RGB color space to obtain a third image containing the watermark image. In one embodiment, the target color space includes any one of the CIELAB color space, XYZ color space, or OKLAB color space. Of course, this application is not limited to the color spaces listed above, and may also include other color spaces, which will not be listed here.

[0097] For example, if the first second image is an image in the RGB color space, then the first second image is converted from the RGB color space to the first target color space to obtain a first intermediate image; the pixel values ​​of multiple specified pixels in the first intermediate image are modified according to a first value to obtain a second intermediate image; the second intermediate image is converted from the first target color space to the RGB color space to obtain a first third image containing the watermark image. By converting a second image in the RGB color space into a first intermediate image in the first target color space, and then modifying the pixel values ​​of multiple specified pixels in that image, the video stream generated from the third image obtained based on the above modifications can provide the user with a more invisible watermark image.

[0098] Similarly, if the second image is in the RGB color space, it is converted from the RGB color space to the third target color space to obtain the third intermediate image. The pixel values ​​of several specified pixels in the third intermediate image are modified according to the second value to obtain the fourth intermediate image. The fourth intermediate image is then converted from the third target color space back to the RGB color space to obtain the second third image containing the watermark. By converting another second image in the RGB color space into a third intermediate image in the second target color space, and then modifying the pixel values ​​of several specified pixels in that image, the video stream generated from the modified third image can achieve a better effect in providing the user with an invisible watermark image.

[0099] In one example, the pixel values ​​of each pixel in the n second images all satisfy the following condition: the R, G, and B values ​​are all between a first threshold and a second threshold, with the first threshold being less than the second threshold. For example, the first threshold is 0, and the second threshold is 1. By limiting the pixel values ​​of each pixel in the third image to satisfy that the R, G, and B values ​​are all between 0 and 1, it is ensured that the image converted back to the RGB color space can be displayed correctly. For example, to ensure that video frames converted back to the RGB space can be displayed correctly, the intensity γ... i It also needs to satisfy 0≤R r G r B r ≤1, where R r G r B r These represent the restored RGB three-channel pixel values ​​after modification.

[0100] The aforementioned multiple specified pixels can be predetermined, indicated by the rendering instructions, or determined based on the watermark image. The watermark image can be understood as a marker used to mark a multimedia file as a private file. The watermark image can be any marker representing private ownership, such as the identification information ID of an electronic device, a logo or trademark, or a "Do Not Take Photos" icon. In this embodiment, the "Do Not Take Photos" icon shown in Figures 5 to 7 is used as an example. The watermark image can be pre-generated. For example, Figure 8 is a flowchart illustrating another watermark generation method provided in this embodiment. As shown in Figure 8, before S401, the watermark generation method provided in this embodiment further includes: S404, generating a watermark image. S405, determining multiple specified pixels on the second and third images based on the watermark image. For example, assuming the multiple pixels corresponding to the watermark image are the multiple specified pixels. For example, if the watermark image is a "Do Not Take Photos" image, the multiple pixels corresponding to this watermark image are the multiple specified pixels. To prevent the watermark image from being easily erased and to fill the entire screen, in one example, the watermark image's size is the same as the first image's size. By generating the watermark image in advance according to the first image's size, a reference can be provided for determining multiple specified pixels in the second and third images, ensuring the watermark image's accuracy, aesthetics, and full coverage, making it difficult to erase. In some examples, the watermark image can be a binary image. Since binary images offer the best visibility, using a binary watermark image ensures its visibility and enhances its warning effect. Furthermore, using a binary watermark image allows for better control over the first and second values, facilitating their adjustment.

[0101] S403. Generate a first video stream based on n third images. The first video stream is displayed at a flash fusion frequency equal to or higher than that of the flash fusion.

[0102] This should be understood as combining n third images into a first video stream, where the first video stream includes n third images. Each of the n third images contains a watermark image. The pixel values ​​of the corresponding pixels in the watermark image are different for each of the n third images.

[0103] Continuing with the above example, n=2. The pixel value of the first pixel in the first second image is modified using a first value to obtain a pixel value of a1+b1 for the first pixel in the first third image; the pixel value of the first pixel in the second second image is modified using a second value to obtain a pixel value of a1-b1 for the first pixel in the second third image; the pixel value of the second pixel in the first second image is modified using a first value to obtain a pixel value of a2+b1 for the second pixel in the first third image; and the pixel value of the second pixel in the second second image is modified using a second value to obtain a pixel value of a2-b1 for the second pixel in the second third image. The two third images are then combined to form the first video stream. After generating the first video stream, it is sent to the display screen, which can refresh the display at or above the flash fusion frequency. When the flash fusion frequency is at or above the flash fusion frequency, the pixels of the image seen by the human eye are the average of the pixel values ​​of the first and third images and the sum of the pixel values ​​of the second and third images. For example, the pixel value of the first pixel of the image seen by the human eye is (a1+b1+a1-b1) / 2=a1, and the pixel value of the second pixel of the image seen by the human eye is (a2+b1+a2-b1) / 2=a2.

[0104] For example, continuing the previous example, if the first value is +19.98 and the second value is -19.99, then modifying the first pixel in the first second image using the first value results in a1 + 19.98 as the first pixel in the first third image; modifying the first pixel in the second second image using the second value results in a1 - 19.99 as the first pixel in the second third image. These two third images are then combined to form the first video stream. When the first video stream is refreshed at or above the flash fusion frequency, since the sum of the first and second values ​​is +19.98 - 19.99 = -0.01, which is approximately equal to 0, the pixel value of the first pixel in the image seen by the human eye is (a1 + 19.98 + a1 - 19.99) / 2 ≈ a1. Similarly, the pixel value of the second pixel in the image seen by the human eye is (a2 + 19.98 + a2 - 19.99) / 2 ≈ a2.

[0105] Continuing with the example above, n=3. The pixel value of the first pixel in the first second image is modified using a third value, resulting in a pixel value of a1+c1 for the first pixel in the first third image; the pixel value of the first pixel in the second second image is modified using a fourth value, resulting in a pixel value of a1-c2 for the first pixel in the second third image; and the pixel value of the first pixel in the second second image is modified using a fifth value, resulting in a pixel value of a1-c3 for the first pixel in the second third image. These three third images are then combined to form the first video stream. After generating the first video stream, it is sent to the display screen, which can refresh the display at or above the flash fusion frequency. Since c1-c2-c3=0... Therefore, when the flash fusion frequency is at or above the flash fusion frequency, the pixel value of the image seen by the human eye is the average of the pixel values ​​of the first and third images, the pixel values ​​of the second and third images, and the pixel values ​​of the third image. For example, the pixel value of the first pixel of the image seen by the human eye is (a1+c1+a1-c2+a1-c3) / 3=a1.

[0106] For example, continuing the previous example, if the third value is +10, the fourth value is -5.99, and the fifth value is -4, then modifying the first pixel in the first second image using the third value results in a1+10; modifying the first pixel in the second second image using the fourth value results in a1-5.99; and modifying the first pixel in the second second image using the fifth value results in a1-4. These three third images are then combined into the first video stream. When the first video stream is refreshed at or above the flash fusion frequency, since the sum of the third, fourth, and fifth values ​​is +10-5.99-4 = +0.01, which is approximately 0, the pixel value of the first pixel in the image seen by the human eye is (a1+10+a1-5.99+a1-4) / 3≈a1. Similarly, the pixel value of the second pixel of the image seen by the human eye is (a2+10+a2-5.99+a2-4) / 3≈a2.

[0107] When the first video stream is displayed at a flash fusion frequency equal to or higher than the flash fusion frequency, the pixel values ​​of the image seen by the human eye are the average of the pixel values ​​of the n third images. Since the sum of the n values ​​satisfies a threshold range centered at zero, it means that the sum of the n values ​​is equal to or approximately equal to zero. Therefore, the sum of the pixel values ​​adjusted at the corresponding positions of the watermark images on the n third images is equal to or approximately equal to zero. In other words, the pixel values ​​of the pixels at the corresponding positions of the watermark images on the n third images are restored to the pixel values ​​before the modification of the n second images. The second images are copies of the first images and do not contain the watermark image. Therefore, the image seen by the human eye does not contain the watermark image, as shown in Figure 9. The watermark image on each image in the first video stream is not visible to the human eye. Furthermore, when taking screenshots or photos of the first video stream, the screenshots or photos capture a specific third image within the first video stream. This means that the first video stream is frozen on a particular third image during the screenshot or photo capture. Since each third image in the first video stream contains a watermark image, as shown in Figure 9, the screenshot or photo captures an image with a watermark, effectively serving as a warning. Therefore, the watermark generated in this application serves both as a warning and is invisible to the user, improving the user experience.

[0108] In practical applications, a second video stream containing the first image needs to be shared or viewed. In this case, watermarks need to be embedded in each image of the second video stream. Specifically, before the second video stream is displayed, S401 is executed to copy each first image in the second video stream to obtain n second images; S402 is executed to modify the pixel values ​​of multiple specified pixels on the n second images to obtain n third images; S403 is executed to combine the n third images into a first video stream. Then the first video stream is displayed. The entity that shares or views the second video stream can be a third-party application installed on the electronic device or the operating system of the electronic device. The timing of the execution of S401-S403 differs depending on the entity. For example, as shown in Figures 5-7 and Figure 9, if the operating system of the electronic device shares or views the second video stream, S401-S403 are executed before the electronic device displays the content to be displayed and in the steps closest to the display. As shown in Figure 10, if a third-party application installed on the electronic device shares or browses the second video stream, the server corresponding to the third-party application sends the second video stream to the electronic device. The electronic device receives and decodes the second video stream, and executes S401-S403 after decoding the second video stream and before sending it for display.

[0109] In the above embodiments, the second video stream is described as a multimedia file for real-time transmission and display, which has high real-time requirements. Of course, the second video stream can also be a static file, meaning that the second video stream does not need to be transmitted and displayed in real time. Then, as shown in Figure 11, the electronic device can also generate watermarks for each image in the second video stream using the watermark generation method described above, and then store the first video stream containing the watermark for later distribution to users, such as user 1, user 2, and user 3.

[0110] The above describes a watermark generation method provided by an embodiment of this application. Corresponding to the above method, this application also provides a watermark generation device. This device is applied to an electronic device. The device is used to execute the watermark generation method performed by the electronic device in Figure 4 through the various modules shown in Figure 12. As shown in Figure 12, the watermark generation device 1200 provided by this application includes the following modules.

[0111] The acquisition module 1201 is used to acquire n second images, where each second image is a copy of the first image, and n is a positive integer greater than or equal to 2.

[0112] Modification module 1202 is used to modify the pixel values ​​of multiple specified pixels on n second images according to n values ​​to obtain n third images containing watermark images. The n values ​​correspond one-to-one with the n second images, and the n second images correspond one-to-one with the n third images. All n values ​​are non-zero and the sum of the n values ​​satisfies the threshold range centered at zero. Multiple specified pixels are used to represent the information of the watermark image.

[0113] The generation module 1203 is used to generate a first video stream based on n third images, and the first video stream is displayed at a flash fusion frequency equal to or higher than that.

[0114] In one possible implementation, the threshold ranges from -0.02 to +0.02.

[0115] In one possible implementation, if n is 2, then the modification module 1202 is used to: modify the pixel values ​​of multiple specified pixels on the first second image according to the first value to obtain the first third image containing the watermark image; modify the pixel values ​​of multiple specified pixels on the second second image according to the second value to obtain the second third image containing the watermark image, wherein the sum of the second value and the first value satisfies the threshold range.

[0116] In one possible implementation, if n is 3, then the modification module 1202 is used to: modify the pixel values ​​of multiple specified pixels on the third second image according to the third value to obtain the third third image containing the watermark; modify the pixel values ​​of multiple specified pixels on the fourth second image according to the fourth value to obtain the fourth third image containing the watermark; modify the pixel values ​​of multiple specified pixels on the fifth second image according to the fifth value to obtain the fifth third image containing the watermark, wherein the sum of the third value, the fourth value and the fifth value satisfies the threshold range.

[0117] In one possible implementation, n is determined based on the image frame rate and flash fusion frequency of the second video stream, which includes the first image.

[0118] In one possible implementation, the modification module 1202 is used to: if the first second image is an image in the RGB color space, convert the first second image from the RGB color space to the first target color space to obtain a first intermediate image; modify the pixel values ​​of multiple specified pixels in the first intermediate image according to the first value to obtain a second intermediate image; and convert the second intermediate image from the first target color space to the RGB color space to obtain a first third image containing a watermark image.

[0119] In one possible implementation, the modification module 1202 is used to: if the second second image is an image in the RGB color space, convert the second second image from the RGB color space to the second target color space to obtain the third intermediate image; modify the pixel values ​​of multiple specified pixels on the third intermediate image according to the second value to obtain the fourth intermediate image; convert the fourth intermediate image from the second target color space to the RGB color space to obtain the second third image containing the watermark image.

[0120] In one possible implementation, both the first target color space and the second target color space include any one of the CIELAB color space, XYZ color space, or OKLAB color space.

[0121] In one possible implementation, the pixel values ​​of each pixel in the third image satisfy the following conditions: the R value, G value, and B value are all between a first threshold and a second threshold, where the first threshold is less than the second threshold. For example, the first threshold is 0, and the second threshold is 1.

[0122] In one possible implementation, the first value is determined based on the first intensity and the pixel value of the pixel on the watermark image, and the second value is determined based on the second intensity and the pixel value of the pixel on the watermark image. The first intensity and the second intensity represent the weights of the pixel values ​​of the pixel on the watermark image, and the sum of the first intensity and the second intensity satisfies a threshold range.

[0123] In one possible implementation, the apparatus 1200 further includes: a generation module 1203 for generating a watermark image; and a determination module 1204 for determining a plurality of specified pixels on the second and third images based on the watermark image. In one example, the size of the watermark image is the same as the size of the first image.

[0124] In one possible implementation, the watermark image is a binary image.

[0125] It should be understood that the beneficial effects of the device provided in Figure 12 are the same as those of the watermark generation method provided in Figure 4 when implementing its functions, and will not be repeated here. Furthermore, the device provided in Figure 12 is only illustrated by the division of the above-mentioned functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, and will not be repeated here.

[0126] In an exemplary embodiment, an electronic device is provided, the electronic device including a processor coupled to a memory; the memory stores at least one instruction, which is loaded and executed by the processor to enable the electronic device to implement the method in FIG4.

[0127] In an exemplary embodiment, a computer program (product) is provided, comprising: computer program code, which, when executed by a computer, causes the computer to perform the method in FIG4.

[0128] In an exemplary embodiment, a computer-readable storage medium is provided that stores a program or instructions, which, when run on a computer, enable the computer to perform the method described in FIG4 above.

[0129] In an exemplary embodiment, a chip is provided, including a processor for calling and executing instructions stored in a memory, such that a computer on which the chip is installed performs the method in FIG4.

[0130] In an exemplary embodiment, another chip is provided, including: an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, a computer with the chip installed performs the method in FIG4.

[0131] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk).

[0132] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the setting results involved in this application were obtained with full authorization.

[0133] Those skilled in the art will recognize that the method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. To clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0134] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0135] When implemented using software, it can be implemented wholly or partially as a computer program product. This computer program product includes one or more computer program instructions. As an example, the methods of this application embodiment can be described in the context of machine-executable instructions, such as program modules that execute on a device on a real or virtual processor of the target. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In various embodiments, the functionality of program modules can be combined or divided among the described program modules. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside on both local and remote storage media.

[0136] Computer program code used to implement the methods of the embodiments of this application may be written in one or more programming languages. This computer program code may be provided to the processor of a determined device of a general-purpose computer, a special-purpose computer, or other programmable agent node, such that when executed by the computer or other programmable agent node, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a computer, partially on a computer, as a standalone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.

[0137] In the context of the embodiments of this application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, etc.

[0138] Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.

[0139] A machine-readable medium can be any tangible medium that contains or stores programs for or relating to an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. More detailed examples of machine-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0140] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be found in the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0141] In the embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or modules, or they may be electrical, mechanical, or other forms of connection.

[0142] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0143] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0144] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0145] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have substantially the same function and purpose. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another. For example, without departing from the various examples described, a first image can be referred to as a second image, and similarly, a second image can be referred to as a first image. Both the first image and the second image can be images, and in some cases, they can be separate and distinct images.

[0146] It should also be understood that, in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0147] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple second messages refer to two or more second messages. The terms "system" and "network" are often used interchangeably in this document.

[0148] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0149] It should also be understood that the term "and / or" as used herein refers to and covers any and all possible combinations of one or more of the associated listed items. The term "and / or" describes an association between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this application generally indicates that the preceding and following related objects are in an "or" relationship.

[0150] It should also be understood that the term “comprising” (also referred to as “includes”, “including”, “comprises” and / or “comprising”) as used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0151] It should also be understood that the terms “if” and “if” can be interpreted as meaning “when” or “upon”, or “in response to determination” or “in response to detection”. Similarly, depending on the context, the phrases “if determination…” or “if detection [the stated condition or event]” can be interpreted as meaning “when determination…”, or “in response to determination…”, or “when detection [the stated condition or event]” or “in response to detection [the stated condition or event]”.

[0152] It should be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.

[0153] It should also be understood that the phrases "an embodiment," "an embodiment," and "a possible implementation" used throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment or implementation is included in at least one embodiment of this application. Therefore, the phrases "in an embodiment," "an embodiment," or "a possible implementation" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0154] This application relates to the field of communication technology, and in particular to methods, apparatus, devices, systems and storage media for measuring network performance.

Claims

1. A method for generating a watermark, characterized in that, The method includes: Obtain n second images, where each second image is a copy of the first image, and n is a positive integer greater than or equal to 2; Modify the pixel values ​​of multiple specified pixels on the n second images according to n values ​​to obtain n third images containing watermark images. The n values ​​correspond one-to-one with the n second images. All n values ​​are non-zero and the sum of the n values ​​satisfies a threshold range centered at zero. The multiple specified pixels are used to represent the information of the watermark image. A first video stream is generated based on the n third images, and the first video stream is displayed at a flash fusion frequency equal to or higher than that.

2. The method according to claim 1, characterized in that, The threshold range is -0.02 to +0.

02.

3. The method according to claim 1 or 2, characterized in that, If n is 2, then modifying the pixel values ​​of multiple specified pixels on the n second images according to n values ​​to obtain n third images containing watermarks includes: Modify the pixel values ​​of the specified pixels in the first second image according to the first value to obtain the first third image containing the watermark image; Modify the pixel values ​​of the specified pixels in the second second image according to the second value to obtain a second third image containing the watermark image, wherein the sum of the second value and the first value satisfies the threshold range.

4. The method according to claim 1, characterized in that, If n is 3, then modifying the pixel values ​​of multiple specified pixels on the n second images according to n values ​​to obtain n third images containing watermarks includes: Modify the pixel values ​​of the specified pixels in the third second image according to the third value to obtain a third third image containing the watermark image; Modify the pixel values ​​of the specified pixels in the fourth second image according to the fourth value to obtain the fourth third image containing the watermark image; Modify the pixel values ​​of the specified pixels in the fifth second image according to the fifth value to obtain the fifth third image containing the watermark image, wherein the sum of the third value, the fourth value and the fifth value satisfies the threshold range.

5. The method according to any one of claims 1-4, characterized in that, The n is determined based on the image frame rate of the second video stream and the flash fusion frequency, the second video stream including the first image.

6. The method according to claim 3, characterized in that, The step of modifying the pixel values ​​of the plurality of specified pixels in the first second image according to the first value to obtain the first third image containing the watermark image includes: If the first second image is an image in the RGB color space, then the first second image is converted from the RGB color space to the first target color space to obtain the first intermediate image; Modify the pixel values ​​of the specified pixels in the first intermediate image according to the first value to obtain the second intermediate image; The second intermediate image is converted from the first target color space to the RGB color space to obtain the first third image containing the watermark image.

7. The method according to claim 6, characterized in that, The step of modifying the pixel values ​​of the plurality of specified pixels in the second second image according to the second value to obtain a second third image containing the watermark image includes: If the second image is an image in the RGB color space, then the second image is converted from the RGB color space to the second target color space to obtain the third intermediate image; Modify the pixel values ​​of the specified pixels in the third intermediate image according to the second value to obtain the fourth intermediate image; The fourth intermediate image is converted from the second target color space to the RGB color space to obtain a second third image containing the watermark image.

8. The method according to claim 6 or 7, characterized in that, Both the first target color space and the second target color space include any one of the CIELAB color space, XYZ color space, or OKLAB color space.

9. The method according to claim 6 or 7, characterized in that, The pixel values ​​of each pixel in the third image all satisfy the following: the R value, G value, and B value are all between 0 and 1.

10. The method according to any one of claims 3-9, characterized in that, The first value is determined based on the first intensity and the pixel value of the pixel in the watermark image, and the second value is determined based on the second intensity and the pixel value of the pixel in the watermark image. The first intensity and the second intensity represent the weights of the pixel values ​​of the pixel in the watermark image, and the sum of the first intensity and the second intensity satisfies the threshold range.

11. The method according to any one of claims 1-10, characterized in that, Before modifying the pixel values ​​of multiple specified pixels in the n second images according to n values ​​to obtain n third images containing watermarks, the method further includes: Generate the watermark image; Based on the watermarked image, the plurality of designated pixels on the second image and the third image are determined.

12. The method according to claim 11, characterized in that, The size of the watermark image is the same as the size of the first image.

13. The method according to any one of claims 1-12, characterized in that, The watermark image is a binary image.

14. A watermark generation device, characterized in that, The device includes: The acquisition module is used to acquire n second images, where each second image is a copy of the first image, and n is a positive integer greater than or equal to 2; The modification module is used to modify the pixel values ​​of multiple specified pixels on the n second images according to n values ​​to obtain n third images containing watermark images. The n values ​​correspond one-to-one with the n second images. The n values ​​are all non-zero and the sum of the n values ​​satisfies a threshold range centered at zero. The multiple specified pixels are used to represent the information of the watermark image. The generation module is used to generate a first video stream based on the n third images, and the first video stream is displayed at a flash fusion frequency equal to or higher than that.

15. The apparatus according to claim 14, characterized in that, The threshold range is -0.02 to +0.

02.

16. The apparatus according to claim 14 or 15, characterized in that, If n is 2, then the modification module is used to: Modify the pixel values ​​of the specified pixels in the first second image according to the first value to obtain the first third image containing the watermark image; Modify the pixel values ​​of the specified pixels in the second second image according to the second value to obtain a second third image containing the watermark image, wherein the sum of the second value and the first value satisfies the threshold range.

17. The apparatus according to claim 16, characterized in that, If n is 3, then the modification module is used to: Modify the pixel values ​​of the specified pixels in the third second image according to the third value to obtain a third third image containing the watermark image; Modify the pixel values ​​of the specified pixels in the fourth second image according to the fourth value to obtain the fourth third image containing the watermark image; Modify the pixel values ​​of the specified pixels in the fifth second image according to the fifth value to obtain the fifth third image containing the watermark image, wherein the sum of the third value, the fourth value and the fifth value satisfies the threshold range.

18. The apparatus according to any one of claims 14-17, characterized in that, The n is determined based on the image frame rate of the second video stream and the flash fusion frequency, the second video stream including the first image.

19. The apparatus according to claim 16, characterized in that, The modification module is used for: If the first second image is an image in the RGB color space, then the first second image is converted from the RGB color space to the first target color space to obtain the first intermediate image; Modify the pixel values ​​of the specified pixels in the first intermediate image according to the first value to obtain the second intermediate image; The second intermediate image is converted from the first target color space to the RGB color space to obtain the first third image containing the watermark image.

20. The apparatus according to claim 19, characterized in that, The modification module is used for: If the second image is an image in the RGB color space, then the second image is converted from the RGB color space to the second target color space to obtain the third intermediate image; Modify the pixel values ​​of the specified pixels in the third intermediate image according to the second value to obtain the fourth intermediate image; The fourth intermediate image is converted from the second target color space to the RGB color space to obtain a second third image containing the watermark image.

21. The apparatus according to claim 19 or 20, characterized in that, Both the first target color space and the second target color space include any one of the CIELAB color space, XYZ color space, or OKLAB color space.

22. The apparatus according to claim 19 or 20, characterized in that, The pixel values ​​of each pixel in the third image all satisfy the following: the R value, G value, and B value are all between 0 and 1.

23. The apparatus according to any one of claims 15-22, characterized in that, The first value is determined based on the first intensity and the pixel value of the pixel in the watermark image, and the second value is determined based on the second intensity and the pixel value of the pixel in the watermark image. The first intensity and the second intensity represent the weights of the pixel values ​​of the pixel in the watermark image, and the sum of the first intensity and the second intensity satisfies the threshold range.

24. The apparatus according to any one of claims 14-23, characterized in that, The device further includes: The generation module is also used to generate the watermark image; A determining module is configured to determine the plurality of specified pixels on the second image and the third image based on the watermark image.

25. The apparatus according to claim 24, characterized in that, The size of the watermark image is the same as the size of the first image.

26. The apparatus according to any one of claims 14-25, characterized in that, The watermark image is a binary image.

27. An electronic device, characterized in that, The electronic device includes a processor coupled to a memory; the memory stores at least one instruction, which is loaded and executed by the processor to enable the electronic device to implement the method of any one of claims 1-13.

28. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement the method of any one of claims 1-13.

29. A computer program product, characterized in that, The computer program product includes a computer program / instruction that is executed by a processor to enable a computer to perform the method described in any one of claims 1-13.

30. A chip, characterized in that, The chip includes a processor for retrieving and executing instructions stored in a memory, causing a computer equipped with the chip to perform the method of any one of claims 1-13.

31. A chip, characterized in that, The chip includes an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, a computer with the chip installed performs the method described in any one of claims 1-13.