Picture-based watermark processing method and device and electronic equipment

The main object in the picture is identified by the image segmentation method and the watermark position is determined using parameter interference values, which solves the problem that watermarks are easily evased in the prior art, and realizes the precise position determination of the watermark and selective watermark addition, which improves the overall effect of the picture.

CN119904346APending Publication Date: 2025-04-29WANGXU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411995912.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In the prior art, the watermarks added to the picture are easily circumvented by screenshots or other means because the watermarks are fixed or the number is small.

Method used

The main object and its position in the picture are identified by image segmentation method, and the watermark position is determined using the preset parameter interference value to ensure that the watermark is watermarked in important areas of the picture, and watermark can be optionally added.

Benefits of technology

The precise position determination of the watermark is achieved, making the watermark less likely to be avoided, avoiding the poor effect caused by excessive fixation of the watermark position, and at the same time reducing the number of watermarks and improving the overall picture effect of the picture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904346A_ABST
    Figure CN119904346A_ABST
Patent Text Reader

Abstract

The invention provides a picture-based watermark processing method and apparatus, and an electronic device, relates to the technical field of image processing, and solves the technical problem that a watermark added on a picture in an existing watermark adding mode is easily avoided by screenshot or other modes. The method comprises the following steps: acquiring a target picture to be watermarked; all main objects in the target picture and the object positions of the main objects are identified based on the target picture by using an image segmentation method, and the corresponding relation between the object positions and the object information of the main objects is determined; determining a to-be-watermarked position corresponding to each main body object in the target picture through a corresponding relation according to the parameter interference values; and according to a selection instruction for the main body object, determining a target to-be-watermarked position from the to-be-watermarked positions corresponding to the main body object, and performing watermarking processing on the target to-be-watermarked position in the target picture based on the to-be-watermarked position to obtain a watermarked target picture result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a picture-based watermark processing method, device and electronic device. Background Art

[0002] At present, the image watermarking technology is to randomly add watermarks on the image, or to add watermarks at fixed positions on the image, for example, to add watermarks at the lower left corner, the middle or the right side of the image, or to add watermarks flatly at all positions of the image. With the above existing watermarking methods, when the number of watermarks added to the image is small, the watermarks can be easily circumvented by screenshots or other methods. Summary of the invention

[0003] The purpose of the present invention is to provide a picture-based watermark processing method, device and electronic device to solve the technical problem that the watermark added to the picture by the existing watermarking method can be easily circumvented by screenshots or other methods.

[0004] In a first aspect, the present application provides a method for watermark processing based on an image, the method comprising:

[0005] Get the target image to be watermarked;

[0006] Based on the target image, an image segmentation method is used to identify all main objects in the target image and the object positions of the main objects, and a corresponding relationship between the object positions and the object information of the main objects is determined; wherein the target image corresponds to a preset parameter interference value, and the parameter interference value is used to characterize the relative position relationship between the watermark to be added and the object center position in the object position;

[0007] Determine the position to be watermarked corresponding to each of the main objects in the target image according to the parameter interference value and through the corresponding relationship;

[0008] According to the selection instruction for the main object, the target position to be watermarked is determined from the positions to be watermarked corresponding to the main object, and the target position to be watermarked in the target image is watermarked based on the watermark to be watermarked to obtain a target image result after watermarking.

[0009] In a possible implementation, determining the position to be watermarked corresponding to each main object in the target image according to the parameter interference value through the corresponding relationship includes:

[0010] Determine a first initial position to be watermarked corresponding to each object position according to the parameter interference value, and determine a second initial position to be watermarked corresponding to each subject object in the target image through the corresponding relationship based on the first initial position to be watermarked;

[0011] Determining watermark intersection positions between a plurality of second initial watermark positions corresponding to a plurality of different subject objects according to the second initial watermark positions, and judging whether watermarks interfere with each other between the plurality of second initial watermark positions according to the watermark intersection positions;

[0012] If the watermarks interfere with each other, the target second initial position to be watermarked where the watermarks interfere with each other is adjusted to obtain an adjusted final position to be watermarked.

[0013] In a possible implementation, the step of adjusting the target second initial position to be watermarked where the watermarks interfere with each other to obtain an adjusted final position to be watermarked includes:

[0014] The size of the position range of the target second initial position to be watermarked where the watermarks interfere with each other is reduced to reduce the interference intensity of the watermarks interfering with each other, and obtain a reduced final position to be watermarked; and / or,

[0015] The position vertex of the target second initial position to be watermarked where the watermarks interfere with each other is replaced to obtain a final position to be watermarked after the replacement, wherein the position vertex is a distance endpoint formed by a relative direction of the target second initial position to be watermarked relative to the center position of the object and a target distance in the relative position relationship corresponding to the parameter interference value, and replacing the position vertex includes replacing the distance endpoint corresponding to the first relative direction with the second relative direction.

[0016] In a possible implementation, determining the target position to be watermarked from the positions to be watermarked corresponding to the main object according to the selection instruction for the main object includes:

[0017] In response to a selection operation on all the subject objects, determining a target subject object selected by the selection operation from among all the subject objects;

[0018] A target position to be watermarked corresponding to the target main object is determined from all the positions to be watermarked corresponding to all the main objects.

[0019] In a possible implementation, the subject object includes at least one of an object object, a person object, an animal object, and a plant object; the target image corresponds to the target object to be watermarked;

[0020] If the target objects to be watermarked are all the object objects in the target image, the selection operation is a selection operation for all the object objects in all the subject objects, and the watermark to be watermarked is added to all the object objects in the target image result;

[0021] If the target objects to be watermarked are all the main objects in the target image, the selection operation is a selection operation for all the main objects, and the watermark to be watermarked is added to all the main objects in the target image result;

[0022] If the target objects to be watermarked are all the person objects in the target image, the selection operation is a selection operation for all the person objects in all the subject objects, and the watermark to be watermarked is added to all the person objects in the target image result;

[0023] If the target objects to be watermarked are the body parts of all the human objects in the target image, then the selection operation is a selection operation for all the human objects in all the subject objects, and the body parts of all the human objects in the target image result are added with the watermark to be added.

[0024] In one possible implementation, the relative position relationship includes the target distance and / or relative inclination between the watermark to be added and the center position of the object in the object position; the larger the parameter interference value, the smaller the target distance and / or relative inclination between the watermark to be added and the center position of the object, or the larger the parameter interference value, the larger the target distance and / or relative inclination between the watermark to be added and the center position of the object.

[0025] In a possible implementation, the parameter interference value includes a first parameter interference value, a second parameter interference value, a third parameter interference value, a fourth parameter interference value, and a fifth parameter interference value in order of watermark interference degree from small to large;

[0026] The first watermark placement position corresponding to the first parameter interference value is located at a corner position of the target image, and the corresponding watermark coverage is less than a preset coverage;

[0027] The distance between the second watermark placement position corresponding to the second parameter interference value and the range boundary of the position range of the main object in the target image is maintained at a first preset distance, and the second watermark placement position is obtained by calculating a first average value of each coordinate point corresponding to the object position and offsetting a first preset offset distance based on the first average value;

[0028] The third watermark placement position corresponding to the third parameter interference value is located at the range boundary of the position range of the main object in the target image, and the third watermark placement position is obtained by calculating the second average value of each coordinate point corresponding to the object position and offsetting the second preset offset distance based on the second average value; wherein the second preset offset distance is smaller than the first preset offset distance;

[0029] The fourth watermark placement position corresponding to the fourth parameter interference value is located within the position range of the main object in the target image, and the distance from the center position of the object is maintained at a second preset distance, and the fourth watermark placement position is obtained by calculating the third average value of each coordinate point corresponding to the object position and offsetting the third preset offset distance based on the third average value; wherein the third preset offset distance is less than the second preset offset distance;

[0030] The fifth watermark placement position corresponding to the fifth parameter interference value is located at the center position of the object, and the fifth watermark placement position is obtained by calculating the center position of the object.

[0031] In a possible implementation, each of the main objects corresponds to a plurality of position coordinates, and the plurality of position coordinates are used to represent the coordinates of a range boundary point of a position range of the main object in the target image.

[0032] In a second aspect, the present application provides a picture-based watermark processing device, comprising:

[0033] An acquisition module is used to acquire the target image to be watermarked;

[0034] an identification module, used to identify all main objects and the object positions of the main objects in the target image by using an image segmentation method based on the target image, and determine the corresponding relationship between the object positions and the object information of the main objects; wherein the target image corresponds to a preset parameter interference value, and the parameter interference value is used to characterize the relative position relationship between the watermark to be added and the object center position in the object position;

[0035] A determination module, configured to determine a position to be watermarked corresponding to each of the main objects in the target image according to the parameter interference value and through the corresponding relationship;

[0036] A processing module is used to determine a target position to be watermarked from the positions to be watermarked corresponding to the main object according to a selection instruction for the main object, and perform watermarking processing on the target position to be watermarked in the target image based on the watermark to be added to obtain a target image result after watermarking.

[0037] In a third aspect, the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0038] In a fourth aspect, the present application further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the method described in the first aspect.

[0039] This application brings the following beneficial effects:

[0040] The present application provides a picture-based watermark processing method, device and electronic device, which can obtain a target picture to be watermarked, identify all main objects and the object positions of the main objects in the target picture by using an image segmentation method based on the target picture, and determine the corresponding relationship between the object positions and the object information of the main objects, wherein the target picture corresponds to a preset parameter interference value, the parameter interference value is used to characterize the relative position relationship between the watermark to be added and the center position of the object in the object position, determine the position to be watermarked corresponding to each of the main objects in the target picture according to the parameter interference value through the corresponding relationship, and according to the selection instruction for the main object, select the watermark position from the main object. The target position to be watermarked is determined in the corresponding position to be watermarked, and the target position to be watermarked in the target image is watermarked based on the watermark to be added to obtain a target image result after watermarking. In this solution, according to the content of different main objects in the image, the added watermarks are all on the main objects in the image, so as to achieve watermarking of important people or objects in the image. The added watermark position can be directly added to the objects and people in the image, and the watermark can be added selectively, either all of them or selectively to certain objects, so that the watermark placement is more accurate and not easy to be circumvented, thereby avoiding the watermark position being too fixed, resulting in poor effect and easy to be circumvented by screenshots and other methods.

[0041] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0043] Figure 1 A schematic diagram of a process flow of a picture-based watermark processing method provided in an embodiment of the present application;

[0044] Figure 2 Another schematic diagram of the process of watermark processing based on an image provided by an embodiment of the present application;

[0045] Figure 3 A schematic diagram of the structure of a picture-based watermark processing device provided in an embodiment of the present application;

[0046] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0048] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0049] At present, among the existing methods of adding watermarks, some add too few watermarks and the positions are too fixed, which can be easily circumvented by screenshots or other methods; others add too many tiled watermarks, resulting in poor image display. That is, if the image is tiled, too many watermarks will be added, which will interfere with viewing the image and affect the experience.

[0050] Based on this, the embodiments of the present application provide a picture-based watermark processing method, device and electronic device, which can solve the technical problem that the watermark added to the picture by the existing watermarking method can be easily circumvented by screenshots or other methods.

[0051] The embodiments of the present invention are further described below in conjunction with the accompanying drawings.

[0052] Figure 1 The following is a flow chart of a watermark processing method based on an image provided in an embodiment of the present application. Figure 1 As shown, the method includes:

[0053] Step S110, obtaining a target image to be watermarked.

[0054] As a possible implementation, a target picture to be watermarked is read, for example, a landscape picture, a person picture, an object picture, etc.

[0055] Step S120 , based on the target image, all main objects and the object positions of the main objects in the target image are identified by using an image segmentation method, and a corresponding relationship between the object positions and the object information of the main objects is determined.

[0056] The main object may include at least one of an object object, a person object, an animal object, and a plant object.

[0057] As an optional implementation, after acquiring the image, segmentation technology is used to identify the positions of all objects in the image, read the coordinates and record them, and correspond to the object information.

[0058] For example:

[0059]

[0060] The four coordinates in "body":"[[263,505],[273,2775],[190,2928],[2871,2958]]" represent the four coordinate points of the body in the image, from left to right and from top to bottom. The four coordinates here are just examples. In real scenes, if the body, clothes, etc. are irregular, there may be many coordinates.

[0061] In the embodiment of the present application, the target image corresponds to a preset parameter interference value, and the parameter interference value is used to characterize the relative position relationship between the watermark to be added and the object center position in the object position. As an example, the relative position relationship includes the target distance and / or relative tilt between the watermark to be added and the object center position in the object position; the larger the parameter interference value, the smaller the target distance and / or relative tilt between the watermark to be added and the object center position, or the larger the parameter interference value, the larger the target distance and / or relative tilt between the watermark to be added and the object center position.

[0062] Exemplarily, the parameter interference value includes a first parameter interference value, a second parameter interference value, a third parameter interference value, a fourth parameter interference value, and a fifth parameter interference value in order of watermark interference degree from small to large:

[0063] The first watermark placement position corresponding to the first parameter interference value is located at the corner position of the target image, and the corresponding watermark coverage is less than the preset coverage;

[0064] The distance between the second watermark placement position corresponding to the second parameter interference value and the range boundary of the position range of the main object in the target image is maintained at a first preset distance, and the second watermark placement position is obtained by calculating a first average value of each coordinate point corresponding to the object position and offsetting the first preset offset distance based on the first average value;

[0065] The third watermark placement position corresponding to the third parameter interference value is located at the range boundary of the position range of the main object in the target image, and the third watermark placement position is obtained by calculating the second average value of each coordinate point corresponding to the object position and offsetting the second preset offset distance based on the second average value; wherein the second preset offset distance is less than the first preset offset distance;

[0066] The fourth watermark placement position corresponding to the fourth parameter interference value is located within the position range of the main object in the target image, and the distance from the center position of the object is maintained at a second preset distance. The fourth watermark placement position is obtained by calculating a third average value of each coordinate point corresponding to the object position and offsetting a third preset offset distance based on the third average value; wherein the third preset offset distance is less than the second preset offset distance;

[0067] The fifth watermark placement position corresponding to the fifth parameter interference value is located at the center of the object, and the fifth watermark placement position is obtained by calculating the center of the object.

[0068] Exemplarily, a parameter interference value interference_degree is set, and several values ​​can be set as needed: 0 (first parameter interference value), 0.25 (second parameter interference value), 0.5 (third parameter interference value), 0.75 (fourth parameter interference value), and 1 (fifth parameter interference value).

[0069] Among them, 0 is the weakest, and is generally best at the rightmost vertex position with the least interference. The watermark is placed at the corner of the image with relatively small coverage; 0.25: The watermark is close to the body area but not in the center. The average value of each coordinate point is calculated and slightly offset, such as moving a certain distance in a certain direction of the average value; 0.5: The watermark is at the edge of the body area, and the watermark is placed slightly offset from the average value, such as above or below the body; 0.75: The watermark is near the center of the body, but does not completely cover the center. After calculating the average value, it is slightly offset by a small distance so that the watermark is near the center but not completely covered; 1: The watermark is completely in the center of the body, and the watermark is placed directly at the calculated center position.

[0070] By using the first parameter interference value, the second parameter interference value, the third parameter interference value, the fourth parameter interference value and the fifth parameter interference value, the watermarking position calculated according to the parameter interference value of the watermark is made more accurate.

[0071] Step S130 : determining the position to be watermarked corresponding to each main object in the target image according to the parameter interference value through the corresponding relationship.

[0072] In a possible implementation, calculations are performed according to detailed needs, and a set of watermark positions to be added is calculated according to an algorithm, that is, the coordinate position of each object in the picture corresponding to the watermark to be added.

[0073] For example, Figure 2 As shown, this step S130 may specifically include the following steps: step S210, determining the first initial watermark position corresponding to each object position according to the parameter interference value, and determining the second initial watermark position corresponding to each main object in the target image through the corresponding relationship based on the first initial watermark position; step S220, determining the watermark intersection position between multiple second initial watermark positions corresponding to multiple different main objects according to the second initial watermark position, and judging whether there is watermark mutual interference between multiple second initial watermark positions according to the watermark intersection position; step S230, if there is watermark mutual interference, adjusting the target second initial watermark position with watermark mutual interference to obtain the adjusted final watermark position. In this way, it is possible to avoid the situation where watermarks interfere with each other among multiple watermarks added to the image.

[0074] Optionally, the above-mentioned adjustment of the target second initial watermark position to be watermarked where watermarks interfere with each other to obtain the adjusted final watermark position may specifically include the following steps: reducing the position range size of the target second initial watermark position to be watermarked where watermarks interfere with each other to reduce the interference intensity of the watermarks interfering with each other to obtain the reduced final watermark position; and / or replacing the position vertex of the target second initial watermark position to be watermarked where watermarks interfere with each other to obtain the replaced final watermark position, wherein the position vertex is a distance endpoint formed by a target distance in a relative position relationship corresponding to a relative direction of the target second initial watermark position relative to the center position of the object and a parameter interference value, and replacing the position vertex includes replacing the distance endpoint corresponding to the first relative direction with the second relative direction.

[0075] As an example, calculate the intersection of watermarks of different objects. If they interfere with each other, replace other vertices. For example, 0 is the weakest, and the rightmost vertex is generally the best. However, if the rightmost vertex is very close to other objects and there is interference, replace it with the leftmost vertex. As another example, reduce the range of the watermark position to minimize the interference.

[0076] In the embodiment of the present application, the position vertex (such as the left vertex) of the target second initial position to be watermarked where watermarks interfere with each other is replaced to obtain the final position to be watermarked after the replacement (such as the right vertex), wherein the position vertex is the distance endpoint formed by the relative direction (including the left, right, top, bottom and other relative directions) of the target second initial position to be watermarked relative to the center position of the object and the target distance corresponding to the parameter interference value, and the replacement of the position vertex (including the left vertex) includes the replacement result of the distance endpoint (i.e. the right vertex) corresponding to the replacement of the first relative direction (such as the left) with the second relative direction (such as the right). Through the above-mentioned processing methods, the degree of mutual interference between multiple watermarks can be eliminated or reduced more efficiently and effectively.

[0077] As an optional implementation, each subject object corresponds to a plurality of position coordinates, and the plurality of position coordinates are used to characterize the coordinates of the range boundary points of the position range of the subject object in the target image. For example, the position range of the second initial position to be watermarked of the target mentioned above. In this way, the data of the position of each subject object in the target image is made more accurate.

[0078] Through the above watermark position calculation process, a coordinate set is finally obtained, for example:

[0079]

[0080] Step S140, according to the selection instruction for the main object, determine the target position to be watermarked from the positions to be watermarked corresponding to the main object, and perform watermarking processing on the target position to be watermarked in the target image based on the watermark to be added to obtain the target image result after watermarking.

[0081] For example, watermarks are added as needed. For example, if watermarks need to be added to all items, watermarks are added to all items; if watermarks are added only to human body parts, watermarks are added only to human body parts; if watermarks are added to animals, watermarks are added to animals.

[0082] As an optional implementation, in step S140, according to the selection instruction for the subject object, the target position to be watermarked is determined from the positions to be watermarked corresponding to the subject object, which may specifically include the following steps: in response to the selection operation for all subject objects, the target subject object selected corresponding to the selection operation is determined from all subject objects; and the target position to be watermarked corresponding to the target subject object is determined from all the positions to be watermarked corresponding to all subject objects. Through the above processing method, it is possible to selectively add watermarks to the subject object, making the effect of adding watermarks to the picture more flexible.

[0083] In an optional implementation, the target image corresponds to a target object to be watermarked; if the target object to be watermarked is all the object objects in the target image, the selection operation is a selection operation for all the object objects in all the subject objects, and the watermark to be added is added to all the object objects in the target image result; if the target object to be watermarked is all the subject objects in the target image, the selection operation is a selection operation for all the subject objects, and the watermark to be added is added to all the subject objects in the target image result; if the target object to be watermarked is all the person objects in the target image, the selection operation is a selection operation for all the person objects in all the subject objects, and the watermark to be added is added to all the person objects in the target image result; if the target object to be watermarked is the body parts of all the person objects in the target image, the selection operation is a selection operation for all the person objects in all the subject objects, and the body parts of all the person objects in the target image result are added to the watermark to be added.

[0084] For example, if you need to add watermarks to all places in the picture, then add watermarks to all objects such as items and people in the picture; if you only need to add watermarks to people, then add watermarks to the coordinates of the people; if you only need to add watermarks to animals, then only add watermarks to animals. Through the above processing methods, it is possible to achieve flexible control and precise control of the watermarking position.

[0085] In the embodiment of the present application, according to the content of different main objects in the picture, the added watermarks are all on the main objects in the picture, so as to add watermarks to important people or objects in the picture. The added watermark position can be directly added to the objects and people in the picture, and the watermark can be added selectively, either all of them or selectively added to certain objects, so that the watermark placement is more accurate and not easy to be circumvented, thereby avoiding the watermark being too fixed in position and resulting in poor effect and easy to be circumvented by screenshots, etc. Moreover, by adding watermarks only to the main objects in the picture, the number of watermarks is also greatly reduced, thereby improving the overall picture effect of the watermarked picture, so that after the picture is watermarked, the watermark does not appear abrupt, thereby realizing a method of intelligently adding watermarks to people or objects in the picture.

[0086] Figure 3 A schematic diagram of the structure of a watermark processing device based on an image is provided. Figure 3 As shown, the picture-based watermark processing device 300 includes:

[0087] An acquisition module 301 is used to acquire a target image to be watermarked;

[0088] The identification module 302 is used to identify all the main objects and the object positions of the main objects in the target image by using an image segmentation method based on the target image, and determine the corresponding relationship between the object positions and the object information of the main objects; wherein the target image corresponds to a preset parameter interference value, and the parameter interference value is used to characterize the relative position relationship between the watermark to be added and the object center position in the object position;

[0089] A determination module 303 is used to determine a position to be watermarked corresponding to each of the main objects in the target image according to the parameter interference value and through the corresponding relationship;

[0090] The processing module 304 is used to determine the target watermark position from the positions to be watermarked corresponding to the main object according to the selection instruction for the main object, and perform watermarking processing on the target watermark position in the target image based on the watermark to be added to obtain the target image result after watermarking.

[0091] The image-based watermark processing device provided in the embodiment of the present application has the same technical features as the image-based watermark processing method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.

[0092] An electronic device provided in an embodiment of the present application is Figure 4As shown, the electronic device 400 includes a processor 402 and a memory 401, wherein the memory stores a computer program that can be run on the processor, and the processor implements the steps of the method provided in the above embodiment when executing the computer program.

[0093] See also Figure 4 The electronic device further includes: a bus 403 and a communication interface 404, a processor 402, a communication interface 404 and a memory 401 are connected via the bus 403; the processor 402 is used to execute an executable module stored in the memory 401, such as a computer program.

[0094] The memory 401 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 404 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0095] The bus 403 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0096] Among them, the memory 401 is used to store programs, and the processor 402 executes the program after receiving the execution instruction. The method executed by the device defined by the process disclosed in any embodiment of the present application can be applied to the processor 402 or implemented by the processor 402.

[0097] The processor 402 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 402. The above processor 402 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined to execute. The software module may be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 401, and the processor 402 reads the information in the memory 401 and completes the steps of the above method in combination with its hardware.

[0098] Corresponding to the above-mentioned image-based watermark processing method, an embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the steps of the above-mentioned image-based watermark processing method.

[0099] The image-based watermark processing device provided in the embodiment of the present application can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in the embodiment of the present application are the same as those of the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the device embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.

[0100] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0101] For another example, the flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0102] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0103] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0104] If the function is implemented in the form of a software functional unit 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 the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the image-based watermark processing method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0105] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0106] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solution of the present application, rather than to limit it. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solution recorded in the aforementioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solution of the embodiment of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A watermark processing method based on an image, characterized in that: The method comprises: Get the target image to be watermarked; Based on the target image, an image segmentation method is used to identify all main objects in the target image and the object positions of the main objects, and a corresponding relationship between the object positions and the object information of the main objects is determined; wherein the target image corresponds to a preset parameter interference value, and the parameter interference value is used to characterize the relative position relationship between the watermark to be added and the object center position in the object position; Determine the position to be watermarked corresponding to each of the main objects in the target image according to the parameter interference value and through the corresponding relationship; According to the selection instruction for the main object, the target position to be watermarked is determined from the positions to be watermarked corresponding to the main object, and the target position to be watermarked in the target image is watermarked based on the watermark to be watermarked to obtain a target image result after watermarking.

2. The method according to claim 1, characterized in that The step of determining the position to be watermarked corresponding to each main object in the target image according to the parameter interference value and through the corresponding relationship includes: Determine a first initial position to be watermarked corresponding to each object position according to the parameter interference value, and determine a second initial position to be watermarked corresponding to each subject object in the target image through the corresponding relationship based on the first initial position to be watermarked; Determining watermark intersection positions between a plurality of second initial watermark positions corresponding to a plurality of different subject objects according to the second initial watermark positions, and judging whether watermarks interfere with each other between the plurality of second initial watermark positions according to the watermark intersection positions; If the watermarks interfere with each other, the target second initial position to be watermarked where the watermarks interfere with each other is adjusted to obtain an adjusted final position to be watermarked.

3. The method according to claim 2, characterized in that The step of adjusting the target second initial position to be watermarked where the watermarks interfere with each other to obtain the adjusted final position to be watermarked includes: The size of the position range of the target second initial position to be watermarked where the watermarks interfere with each other is reduced to reduce the interference intensity of the watermarks interfering with each other, and obtain a reduced final position to be watermarked; and / or, The position vertex of the target second initial position to be watermarked where the watermarks interfere with each other is replaced to obtain a final position to be watermarked after the replacement, wherein the position vertex is a distance endpoint formed by a relative direction of the target second initial position to be watermarked relative to the center position of the object and a target distance in the relative position relationship corresponding to the parameter interference value, and replacing the position vertex includes replacing the distance endpoint corresponding to the first relative direction with the second relative direction.

4. The method according to claim 1, characterized in that: The step of determining a target position to be watermarked from the positions to be watermarked corresponding to the main object according to the selection instruction for the main object includes: In response to a selection operation on all the subject objects, determining a target subject object selected by the selection operation from among all the subject objects; A target position to be watermarked corresponding to the target main object is determined from all the positions to be watermarked corresponding to all the main objects.

5. The method according to claim 4, characterized in that The subject object includes at least one of an object object, a person object, an animal object, and a plant object; the target image corresponds to the target object to be watermarked; If the target objects to be watermarked are all the object objects in the target image, the selection operation is a selection operation for all the object objects in all the subject objects, and the watermark to be watermarked is added to all the object objects in the target image result; If the target objects to be watermarked are all the main objects in the target image, the selection operation is a selection operation for all the main objects, and the watermark to be watermarked is added to all the main objects in the target image result; If the target objects to be watermarked are all the person objects in the target image, the selection operation is a selection operation for all the person objects in all the subject objects, and the watermark to be watermarked is added to all the person objects in the target image result; If the target objects to be watermarked are the body parts of all the human objects in the target image, then the selection operation is a selection operation for all the human objects in all the subject objects, and the body parts of all the human objects in the target image result are added with the watermark to be added.

6. The method according to claim 1, characterized in that The relative position relationship includes the target distance and / or relative inclination between the watermark to be added and the center position of the object in the object position; the larger the parameter interference value, the smaller the target distance and / or relative inclination between the watermark to be added and the center position of the object, or the larger the parameter interference value, the larger the target distance and / or relative inclination between the watermark to be added and the center position of the object.

7. The method according to claim 6, characterized in that The parameter interference values ​​include a first parameter interference value, a second parameter interference value, a third parameter interference value, a fourth parameter interference value and a fifth parameter interference value in order of watermark interference degree from small to large; The first watermark placement position corresponding to the first parameter interference value is located at a corner position of the target image, and the corresponding watermark coverage is less than a preset coverage; The distance between the second watermark placement position corresponding to the second parameter interference value and the range boundary of the position range of the main object in the target image is maintained at a first preset distance, and the second watermark placement position is obtained by calculating a first average value of each coordinate point corresponding to the object position and offsetting a first preset offset distance based on the first average value; The third watermark placement position corresponding to the third parameter interference value is located at the range boundary of the position range of the main object in the target image, and the third watermark placement position is obtained by calculating the second average value of each coordinate point corresponding to the object position and offsetting the second preset offset distance based on the second average value; wherein the second preset offset distance is smaller than the first preset offset distance; The fourth watermark placement position corresponding to the fourth parameter interference value is located within the position range of the main object in the target image, and the distance from the center position of the object is maintained at a second preset distance, and the fourth watermark placement position is obtained by calculating the third average value of each coordinate point corresponding to the object position and offsetting the third preset offset distance based on the third average value; wherein the third preset offset distance is less than the second preset offset distance; The fifth watermark placement position corresponding to the fifth parameter interference value is located at the center position of the object, and the fifth watermark placement position is obtained by calculating the center position of the object.

8. The method according to claim 3, characterized in that Each of the main objects corresponds to a plurality of position coordinates, and the plurality of position coordinates are used to represent the coordinates of the range boundary points of the position range of the main object in the target image.

9. A watermark processing device based on an image, characterized in that: include: An acquisition module is used to acquire the target image to be watermarked; an identification module, used to identify all main objects and the object positions of the main objects in the target image by using an image segmentation method based on the target image, and determine the corresponding relationship between the object positions and the object information of the main objects; wherein the target image corresponds to a preset parameter interference value, and the parameter interference value is used to characterize the relative position relationship between the watermark to be added and the object center position in the object position; A determination module, configured to determine a position to be watermarked corresponding to each of the main objects in the target image according to the parameter interference value and through the corresponding relationship; A processing module is used to determine a target position to be watermarked from the positions to be watermarked corresponding to the main object according to a selection instruction for the main object, and perform watermarking processing on the target position to be watermarked in the target image based on the watermark to be added to obtain a target image result after watermarking.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the method according to any one of claims 1 to 8.