[go: up one dir, main page]

CN108198123A - Watermark embedding method and terminal - Google Patents

Watermark embedding method and terminal Download PDF

Info

Publication number
CN108198123A
CN108198123A CN201711462005.6A CN201711462005A CN108198123A CN 108198123 A CN108198123 A CN 108198123A CN 201711462005 A CN201711462005 A CN 201711462005A CN 108198123 A CN108198123 A CN 108198123A
Authority
CN
China
Prior art keywords
watermark
image
value
background
characteristic value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711462005.6A
Other languages
Chinese (zh)
Inventor
谢伟蔚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Chuanying Information Technology Co Ltd
Original Assignee
Shanghai Chuanying Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Chuanying Information Technology Co Ltd filed Critical Shanghai Chuanying Information Technology Co Ltd
Priority to CN201711462005.6A priority Critical patent/CN108198123A/en
Publication of CN108198123A publication Critical patent/CN108198123A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • G06T1/0092Payload characteristic determination in a watermarking scheme, e.g. number of bits to be embedded

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

Watermark embedding method provided by the invention and terminal, by obtaining the background characteristics value of background image and the watermark feature value of watermarking images to be embedded, wherein, the type of characteristic value includes gray scale, at least one of tone, and background characteristics value is identical with the type of watermark feature value, according to background characteristics value and the similarity of watermark feature value, watermark feature value is adjusted, it will be in the watermarking images insertion background image after adjustment.By the above method, the automatic adjustment of the characteristics of image to watermarking images to be embedded is realized, so that the watermarking images being embedded into background image have higher contrast, improve shooting and make the efficiency of watermark picture, promote user experience.

Description

Watermark embedding method and terminal
Technical Field
The invention relates to the technical field of shooting, in particular to a watermark embedding method and a terminal.
Background
With rapid development of science and technology, the number of built-in camera pixels of mobile terminals such as smart phones or tablet computers is higher and higher, photographing through the mobile terminals becomes the first choice of numerous users, and the users can conveniently share pictures taken at will to friends through various network social platforms. In order to meet personalized requirements, camera applications installed on a plurality of mobile terminals generally integrate a watermark photographing function, and users can embed various watermarks in photographed pictures by utilizing the function so as to enrich the contents of the photographed pictures and improve the interestingness of the pictures.
At present, in an existing watermark embedding scheme, a user can select a watermark that the user likes or conforms to a current shooting scene from a local watermark library of a mobile terminal or an online watermark library, the watermark selected by the user is displayed on a picture layer of a shot picture or a preview picture, and the user adjusts the color, position, size, transparency and the like of the watermark according to personal preferences, so as to finally generate a personalized picture that the user is satisfied with.
However, in the above watermark embedding process, after the watermark picture is displayed on the layer, the image characteristics of the watermark picture and the image characteristics of the background picture are similar, the display effect of the watermark is not good, the user needs to perform more operations and adjustments on the watermark picture according to the background picture, the shooting efficiency is low, and the user experience of taking a picture is poor.
Disclosure of Invention
The invention provides a watermark embedding method and a terminal, which realize the automatic adjustment of the image characteristics of a watermark image to be embedded and improve the efficiency of shooting and making the watermark image.
The invention is realized by the following technical scheme:
a first aspect of the present invention provides a watermark embedding method, including:
acquiring a background characteristic value of a background image, wherein the type of the background characteristic value comprises at least one of gray level and color tone of the background image;
acquiring a watermark characteristic value of a watermark image to be embedded, wherein the type of the watermark characteristic value comprises at least one of gray scale and tone of the watermark image; the type of the watermark characteristic value is the same as that of the background characteristic value;
according to the similarity between the background characteristic value and the watermark characteristic value, adjusting the watermark characteristic value to obtain a new watermark characteristic value;
and embedding the watermark image into the background image according to the new watermark characteristic value.
Optionally, when the type of the background feature value includes a gray scale of a background image, the similarity is a gray scale similarity, and the adjusting the watermark feature value according to the similarity between the background feature value and the watermark feature value to obtain a new watermark feature value includes:
when the difference value between the first gray value of the background image and the second gray value of the watermark image is smaller than a preset gray value difference value, judging whether the first gray value is in a preset gray value range, wherein the preset gray value range is a gray value range obtained by uniformly dividing the gray value between the minimum gray value and the maximum gray value into three sections from small to large and taking the gray value of the middle section;
if so, taking the maximum gray value or the minimum gray value as a new watermark characteristic value;
and if not, performing negation operation on the second gray value to obtain a new watermark characteristic value.
Optionally, when the type of the background feature value includes a color tone of a background image, the similarity is a color tone similarity;
the adjusting the watermark characteristic value according to the similarity between the background characteristic value and the watermark characteristic value to obtain a new watermark characteristic value includes:
judging whether the color tone of the background image and the color tone of the watermark image are the same color tone or not;
if so, acquiring a preset tone according to the corresponding relation between the tone of the background image and the preset tone, and taking the preset tone as the tone of the watermark image, wherein the preset tone and the tone of the background image are different tones.
Optionally, the color tone of the background image is obtained according to the hue, saturation and brightness of each pixel point of the background image;
correspondingly, the color tone of the watermark image is obtained according to the hue, saturation and brightness of each pixel point of the watermark image.
Optionally, the obtaining a background feature value of the background image includes:
the embedding position of the watermark image is obtained,
determining an embedding area for embedding the watermark image into the background image according to the embedding position and the size of the watermark image to be embedded;
and acquiring a background characteristic value of the background image of the embedded area.
Optionally, before the obtaining the background feature value of the background image, the method further includes:
detecting whether a terminal starts an automatic watermark adjusting function or not;
if not, prompting the user to start the automatic watermark adjusting function, and receiving an instruction of the user to start the automatic watermark adjusting function.
Optionally, the background image is a background image in a current preview mode, or a shot background image;
the watermark image is a static watermark image or a dynamic watermark image.
A second aspect of the present invention provides a terminal, comprising:
the acquisition module is used for acquiring a background characteristic value of a background image, wherein the type of the background characteristic value comprises at least one of gray level and color tone of the background image;
the acquisition module is further configured to acquire a watermark characteristic value of the watermark image to be embedded, where the type of the watermark characteristic value includes at least one of a gray level and a tone of the watermark image; the type of the watermark characteristic value is the same as that of the background characteristic value;
the characteristic adjusting module is used for adjusting the watermark characteristic value according to the similarity between the background characteristic value and the watermark characteristic value to obtain a new watermark characteristic value;
and the embedding module is used for embedding the watermark image into the background image according to the new watermark characteristic value.
A third aspect of the invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the first aspects.
A fourth aspect of the present invention provides an electronic apparatus comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of the first aspects via execution of the executable instructions.
According to the watermark embedding method and the terminal provided by the embodiment of the invention, the background characteristic value of the background image and the watermark characteristic value of the watermark image to be embedded are obtained, wherein the type of the characteristic value comprises at least one of gray level and tone, the background characteristic value is the same as the type of the watermark characteristic value, the watermark characteristic value is adjusted according to the similarity between the background characteristic value and the watermark characteristic value, and the adjusted watermark image is embedded into the background image. By the method, the automatic adjustment of the image characteristics of the watermark image to be embedded is realized, so that the watermark image embedded into the background image has higher contrast, the efficiency of shooting and making the watermark image is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a watermark embedding method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a watermark embedding method according to another embodiment of the present invention;
FIG. 3 is a schematic diagram of a gray value adjustment algorithm provided by the present invention;
fig. 4 is a flowchart illustrating a watermark embedding method according to another embodiment of the present invention;
fig. 5 is a flowchart illustrating a watermark embedding method according to another embodiment of the present invention;
FIG. 6 is a schematic diagram of embedding a watermark image into a background image according to the present invention;
fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a terminal according to another embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," and the like in the description and in the claims, and in the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein.
It will be understood that the terms "comprises" and "comprising," and any variations thereof, as used herein, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The terminal in the embodiment of the present invention may include a smart phone (such as an Android phone, an IOS phone, a windows phone, etc.), a tablet computer, a palmtop computer, a notebook computer, a mobile internet device, or a wearable device, and the terminal is merely an example, and is not exhaustive and includes, but is not limited to, the terminal.
In general, a camera application installed on a terminal is provided with a plurality of photographing modes, such as a normal mode, a watermark mode, a panorama mode, an HDR mode, a beauty mode, and the like, and the camera application uses the normal photographing mode by default. Wherein,
the watermark photographing mode applied by the camera can be specifically provided with an automatic watermark photographing mode and a manual watermark photographing mode, and a user can freely set the specific watermark photographing mode according to requirements.
After the terminal opens the camera application and starts the photographing device, firstly, whether the camera application starts a watermark photographing mode is judged:
if the camera application has started the watermark photographing mode, the terminal further judges whether the watermark photographing mode has started the automatic watermark photographing mode, if so, the terminal automatically adds a target watermark image matched with the background image from a local watermark library or an online watermark library of the camera application; otherwise, the terminal can take a picture according to the watermark image manually selected by the user according to the operation of the user.
If the camera application does not start the watermark photographing mode, the terminal can control the photographing device to photograph according to the default common photographing mode of the camera application or other photographing modes selected by the user according to the operation of the user to obtain a photographed background image, and in the photographed background image, the user can select a watermark image to be embedded in a local watermark library or an online watermark library of the camera application according to personal preference.
In the prior art, the watermark image embedded into the background image is generally a watermark image of a fixed template, in other words, no matter whether the watermark image matched with the background image is automatically generated or the watermark image selected by a user, the color value, the saturation and the brightness of the embedded watermark image are default color values, saturation and brightness, when the similarity between the color value, the saturation or the brightness of the watermark image and the background image is higher, the display effect of the embedded watermark image is not good, and at this time, the user also needs to manually adjust the color value, the saturation or the brightness of the embedded watermark image to achieve a satisfactory embedding effect.
In order to solve the above problems in the prior art, embodiments of the present invention provide a watermark embedding method, which implements automatic adjustment of image characteristics of a watermark image to be embedded, so that the watermark image embedded in a background image has a higher contrast, and a user does not need to perform excessive operations and adjustments on the watermark image according to the background image, thereby improving efficiency of shooting and making the watermark image.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 1 is a schematic flowchart of a watermark embedding method according to an embodiment of the present invention, and as shown in fig. 1, the watermark embedding method according to the embodiment specifically includes the following steps:
s101, obtaining a background characteristic value of a background image;
wherein, the type of the background characteristic value comprises at least one of gray level and color tone of the background image;
in this embodiment, the background image is a background image in the current preview mode, or a background image that has been shot, which is not limited in this embodiment.
Specifically, the terminal obtains a background characteristic value of each pixel point of the background image, wherein the background characteristic value comprises a gray value and/or a hue value.
The background image in this embodiment may be specifically a color image or a black-and-white image, and this embodiment is not particularly limited. Correspondingly, the watermark image in this embodiment may be specifically a color image or a black-and-white image, and this embodiment is not particularly limited.
S102, acquiring a watermark characteristic value of a watermark image to be embedded;
the type of the watermark characteristic value comprises at least one of gray scale and tone of the watermark image; the type of watermark eigenvalue is the same as the type of background eigenvalue. In other words, when the background characteristic value acquired by the background image is a gray value, the watermark characteristic value of the watermark image to be embedded is a gray value; and when the background characteristic value acquired by the background image is a tone value, the watermark characteristic value of the watermark image to be embedded is the tone value. I.e. the background characteristic value of the background image corresponds to the type of watermark characteristic value of the watermark image.
Specifically, the terminal obtains a watermark characteristic value of each pixel point of the watermark image to be embedded, wherein the watermark characteristic value comprises a gray value and/or a tone value.
In this embodiment, the watermark image is a static watermark image or a dynamic watermark image. Wherein,
the dynamic watermark image is composed of a series of static watermark images, for example, the watermark image to be embedded is the dynamic watermark image, and the dynamic watermark image is obtained by sequentially displaying 8 static watermark images.
Correspondingly, S102 in this embodiment specifically includes: and acquiring the watermark characteristic value of each static watermark image of the dynamic watermark image.
S103, adjusting the watermark characteristic value according to the similarity between the background characteristic value and the watermark characteristic value to obtain a new watermark characteristic value;
in this embodiment, the size of the background image and the size of the watermark image have the following two cases:
in a possible case, the size of the background image is the same as that of the watermark image, and at the moment, each pixel point of the background image corresponds to each pixel point of the watermark image one by one;
in another possible case, the size of the background image is larger than that of the watermark image, and at this time, the corresponding relationship between a part of pixel points of the background image and each pixel point of the watermark image is determined according to the distribution position of the watermark image selected by the user.
And calculating the gray level similarity and/or the tone similarity of the background characteristic value corresponding to each pixel point and the watermark characteristic value according to the acquired background characteristic value of each pixel point of the background image and the watermark characteristic value of each pixel point of the watermark image to be embedded.
And if the gray level similarity is greater than a preset gray level similarity threshold value, adjusting the watermark characteristic value of the watermark image to be embedded so as to reduce the gray level similarity between the background image and the watermark image to be below the threshold value.
If the hue similarity is larger than the preset hue similarity threshold, adjusting the watermark characteristic value of the watermark image to be embedded so as to reduce the hue similarity of the background image to the watermark image to be lower than the threshold.
And S104, embedding the watermark image into the background image according to the new watermark characteristic value.
The terminal embeds the adjusted watermark image into the background image, the contrast of the characteristic value of each pixel point of the adjusted watermark image and the background image is high, and the display effect of the embedded watermark image is good.
In the watermark embedding method provided by this embodiment, the background characteristic value of the background image and the watermark characteristic value of the watermark image to be embedded are obtained, where the type of the characteristic value includes at least one of gray scale and color tone, and the background characteristic value is the same as the type of the watermark characteristic value, the watermark characteristic value is adjusted according to the similarity between the background characteristic value and the watermark characteristic value, and the adjusted watermark image is embedded in the background image. By the method, the automatic adjustment of the image characteristics of the watermark image to be embedded is realized, so that the watermark image embedded into the background image has higher contrast, the efficiency of shooting and making the watermark image is improved, and the user experience is improved.
When the type of the background feature value is the gray scale of the background image, the similarity in the above embodiment is specifically the gray scale similarity. The watermark embedding method is explained in detail by specific examples below.
Fig. 2 is a schematic flowchart of a watermark embedding method according to another embodiment of the present invention, and fig. 3 is a schematic diagram of a gray-level adjustment algorithm according to the present invention. As shown in fig. 2, the watermark embedding method provided in this embodiment specifically includes the following steps:
s201, acquiring a first gray value of a background image;
in this step, the terminal obtains a first gray value of each pixel point of the background image.
In this embodiment, the background image is a background image in the current preview mode, or a background image that has been shot, which is not limited in this embodiment.
The background image in this embodiment may be specifically a color image or a black-and-white image, and this embodiment is not particularly limited. In particular, the method comprises the following steps of,
for a black-and-white image, because the color and brightness of each pixel point of the background image are different, each pixel point on the shot black-and-white image presents different degrees of gray. The gray values of the continuous black-gray-white variation are quantized to 256 gray levels ranging from 0 to 255, 255 for white and 0 for black, as shown in fig. 3.
For a color image, any color is composed of three primary colors of red, green and blue, if the color of a certain pixel in a background image is RGB (R, G, B), it can be converted into a Gray value by a floating point algorithm, an average value algorithm, a shift algorithm, etc. in the prior art, i.e. R, G, B in the original RGB (R, G, B) are uniformly replaced by Gray to form a new color RGB (Gray ), and the black-and-white Gray image is formed by replacing the original RGB (R, G, B) with it. By the conversion method, the gray value of each pixel point of the color image is obtained.
As can be understood by those skilled in the art, when the background image is a color image, the first gray value of each pixel point of the background image is obtained based on the gray value conversion algorithm.
S202, acquiring a second gray value of the watermark image to be embedded;
and based on the same technical principle of S201, obtaining a second gray value of each pixel point of the watermark image to be embedded.
The watermark image in this embodiment may be specifically a color image or a black-and-white image, and this embodiment is not particularly limited.
S203, when the difference value between the first gray value of the background image and the second gray value of the watermark image is smaller than the preset gray difference value, judging whether the first gray value is in the preset gray value range, if so, executing S204 a; if not, S204b is executed.
The preset gray value range is obtained by uniformly dividing the gray value between the minimum gray value and the maximum gray value into three sections from small to large, and taking the gray value in the middle section, as shown in fig. 3, dividing the gray value range into a first gray section 3a, a second gray section 3b and a third gray section 3 c.
In this embodiment, the range of the first gray scale value of each pixel of the background image is between 0 and 255, and similarly, the range of the second gray scale value of each pixel of the watermark image is between 0 and 255.
If the difference between the first gray value of the background image and the second gray value of the watermark image is smaller than the preset gray difference, for example, the gray difference is 10, the contrast between the first gray value and the second gray value is considered to be low. At this time, the second gray value adjusting algorithm needs to be determined according to the fact that the value of the first gray value falls in the divided gray segment. The specific adjustment algorithm is shown in S204a and S204 b.
S204a, taking the maximum gray value or the minimum gray value as a new watermark characteristic value;
for example, the preset gray scale difference is 10, and the preset gray scale range is defined as 86-171, i.e. the second gray scale segment 3b shown in fig. 3, where the first gray scale value of the background image and the second gray scale value of the watermark image corresponding to the pixel point are 90 and 95, respectively. And adjusting the second gray value of the watermark image to be the maximum gray value or the minimum gray value to improve the contrast of the watermark image because the difference value between the first gray value and the second gray value is 5 and is less than the preset gray difference value 10, and the first gray value and the second gray value both fall within the preset gray value range.
S204b, carrying out inversion operation on the second gray value to obtain a new watermark characteristic value;
illustratively, the preset gray scale difference is 10, and the preset gray scale range is defined as 86-171, wherein the first gray scale value of the background image and the second gray scale value of the watermark image corresponding to the pixel point are 30 and 35, respectively. Since the difference between the first gray value and the second gray value is 5, which is smaller than the preset gray difference 10, and the first gray value and the second gray value both fall on the left side of the preset gray value range, the second gray value of the watermark image is adjusted to 220 according to the preset inversion algorithm, so as to improve the contrast of the watermark image.
And S205, embedding the watermark image into the background image according to the new watermark characteristic value.
The watermark embedding method provided by this embodiment determines a gray difference between a first gray value and a second gray value by obtaining the first gray value and the second gray value of a background image and a watermark image, and adjusts the second gray value of the watermark image according to a preset gray value adjustment algorithm, so that the watermark image has a higher contrast with respect to the background image, and the automatic adjustment of the gray characteristic value of the watermark image is realized.
When the type of the background feature value is the color tone of the background image, the similarity in the above embodiment is specifically the color tone similarity. The watermark embedding method is explained in detail by specific examples below.
Fig. 4 is a schematic flowchart of a watermark embedding method according to another embodiment of the present invention, and as shown in fig. 4, the watermark embedding method according to this embodiment specifically includes the following steps:
s301, obtaining the tone of a background image;
in this embodiment, the background image is a background image in the current preview mode, or a background image that has been shot, which is not limited in this embodiment.
The background image in this embodiment may be specifically a color image or a black-and-white image, and this embodiment is not particularly limited.
Specifically, the terminal obtains the tone of each pixel point of the background image, wherein,
the hue of the background image is obtained according to the hue, saturation and brightness of each pixel of the background image, and those skilled in the art can understand that the hue value includes a hue value, a saturation value and a brightness value.
Correspondingly, the color tone of the watermark image is obtained according to the hue, saturation and brightness of each pixel point of the watermark image.
S302, obtaining the tone of a watermark image to be embedded;
the watermark image in this embodiment may be specifically a color image or a black-and-white image, and this embodiment is not particularly limited.
S303, determining that the tone of the background image and the tone of the watermark image are the same tone;
in this step, the terminal determines whether the color tone of the background image is the same as the color tone of the watermark image, and if the color tone of the background image is the same as the color tone of the watermark image, for example, the background image and the watermark image are both red, and the color tone values are close, the contrast between the watermark image and the background image is low, and the resolution of the embedded watermark image is low. At this time, the color tone of the watermark image needs to be adjusted, and S304 is specifically executed.
It will be understood by those skilled in the art that if the color tone of the background image is different from the color tone of the watermark image, such as red and blue, the contrast between the different color tones is high, and no special processing is required for the watermark image to be embedded.
S304, acquiring a preset tone according to the corresponding relation between the tone of the background image and the preset tone;
and the terminal inquires a preset tone corresponding to the tone of the background image according to the preset tone corresponding relation table, wherein the preset tone and the tone of the background image have higher contrast.
Optionally, the terminal may also adjust one of a hue value, a saturation value, and a brightness value of the hue of the watermark image according to the hue of the background image to obtain an adjusted hue, where the adjusted hue is different from the hue of the background image.
For example, the color tone of the background image is a light red color tone, and the adjusted color tone is changed into a blue color tone, a green color tone or other color tones by adjusting the hue value; or,
the saturation value is adjusted, so that the adjusted hue is changed into bright red hue (the larger the saturation value is, the smaller the gray is, the more vivid the color is); or,
by adjusting the luminance value, the adjusted hue is changed to a dark hue (the smaller the luminance value, the closer to black).
S305, taking the preset tone as the tone of the watermark image;
wherein the preset tone and the background image are different tones.
And adjusting the color tone of the watermark image according to the acquired preset color tone or the adjusted color tone.
And S306, embedding the watermark image into the background image according to the tone of the new watermark image.
In the watermark embedding method provided in this embodiment, whether the color tones of the background image and the watermark image are the same color tone is determined by obtaining the color tones of the background image and the watermark image, if so, obtaining the preset color tone according to the corresponding relationship between the color tone of the background image and the preset color tone, and using the preset color tone as the color tone of the watermark image, thereby ensuring that the watermark image has a higher contrast with respect to the background image, and implementing automatic adjustment of the color tone characteristic value of the watermark image.
In addition to the above embodiments, when obtaining the background feature value of the background image, it is necessary to determine the background feature value of the background image to be obtained based on the embedding position of the watermark image selected by the user, and how to obtain the feature value in the watermark embedding method is described in detail through specific embodiments below.
Fig. 5 is a schematic flowchart of a watermark embedding method according to still another embodiment of this embodiment, and fig. 6 is a schematic diagram of embedding a watermark image into a background image according to the present invention, as shown in fig. 5-6, the watermark embedding method according to this embodiment specifically includes the following steps:
s401, acquiring an embedding position of a watermark image;
the size of the watermark image of the present embodiment is smaller than the size of the background image.
The terminal first needs to acquire an embedding position of the watermark image selected by the user, where the specific embedding position may be at any user-specified position such as the middle, left side, right side, top, and bottom of the background image, as shown in fig. 6, which is not specifically limited in this embodiment.
Note that the outline of the watermark image is not limited to the rectangular outline shown in fig. 6, and may be a circular outline or an irregular outline.
S402, determining an embedding area of the watermark image embedded into the background image according to the embedding position and the size of the watermark image to be embedded;
the terminal determines an embedding area where the watermark image is embedded into the background image according to the embedding position of the obtained watermark image and the size of the watermark image, and it can be understood that the size of the embedding area is the same as that of the watermark image, and the position of the embedding area is the same as that of the watermark image at the embedding position of the background image.
S403, acquiring a background characteristic value of the background image of the embedded area;
wherein, the type of the background characteristic value comprises at least one of gray level and color tone of the background image;
the shape of the embedded region of this embodiment corresponds to the outline of the watermark image, and on the basis of the above steps, the terminal obtains the background feature value of each pixel point of the background image in the embedded region.
S404, acquiring a watermark characteristic value of a watermark image to be embedded;
the type of the watermark characteristic value comprises at least one of gray scale and tone of the watermark image; the type of watermark eigenvalue is the same as the type of background eigenvalue.
S405, adjusting the watermark characteristic value according to the similarity between the background characteristic value and the watermark characteristic value to obtain a new watermark characteristic value;
and S406, embedding the watermark image into the background image according to the new watermark characteristic value.
S403 to S406 of this embodiment are the same as S101 to S104 of the above embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
The watermark embedding method provided by this embodiment describes how to obtain the background characteristic value of the background image in detail, and determines the embedding area where the watermark image is embedded into the background image by obtaining the embedding position of the watermark image and the size of the watermark image, and the terminal only needs to obtain the background characteristic value of the embedding area.
Optionally, on the basis of the foregoing embodiments, before the terminal acquires the background feature value of the background image in the watermark photographing mode, the method specifically includes the following steps: detecting whether a terminal starts an automatic watermark adjusting function or not;
if yes, executing S101, S201, S301 or S401;
if not, prompting the user to start the automatic watermark adjusting function, and receiving an instruction of the user to start the automatic watermark adjusting function.
The specific instruction comprises one or more of clicking, touching, sliding, gesture and voice.
Through the arrangement, a user who does not use the automatic watermark adjusting function can know the new function according to the prompt message of the terminal, and quickly start the automatic watermark adjusting function in the terminal camera application, so that the shooting experience of the user is improved.
Fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention, and as shown in fig. 7, the terminal 50 according to the embodiment includes:
an obtaining module 51, configured to obtain a background feature value of a background image, where a type of the background feature value includes at least one of a gray level and a color tone of the background image;
the obtaining module 51 is further configured to obtain a watermark characteristic value of the watermark image to be embedded, where the type of the watermark characteristic value includes at least one of a gray level and a color tone of the watermark image; the type of the watermark characteristic value is the same as that of the background characteristic value;
a feature adjusting module 52, configured to adjust the watermark feature value according to the similarity between the background feature value and the watermark feature value, to obtain a new watermark feature value;
an embedding module 53, configured to embed the watermark image into the background image according to the new watermark feature value
The terminal provided by the embodiment of the invention comprises an acquisition module, a characteristic adjustment module and an embedding module, wherein the acquisition module is used for acquiring the background characteristic value of a background image and the watermark characteristic value of a watermark image to be embedded, and correspondingly adjusting the watermark characteristic value of the watermark image according to the characteristic similarity of the background image and the watermark image, so that the watermark image finally embedded into the background image has higher contrast, the efficiency of shooting and making the watermark image is improved, and the user experience is improved.
Fig. 8 is a schematic structural diagram of a terminal according to another embodiment of the present invention, and further, on the basis of the embodiment of the apparatus shown in fig. 7, when the type of the background feature value includes a gray level of a background image, the similarity is a gray level similarity; the terminal 50 further includes:
a determining module 54, configured to determine whether the first gray value is within a preset gray value range when a difference between the first gray value of the background image and the second gray value of the watermark image is smaller than a preset gray value difference, where the preset gray value range is a gray value range obtained by uniformly dividing a gray value between a minimum gray value and a maximum gray value into three sections from small to large, and taking a middle section gray value;
the characteristic adjusting module 52 is configured to use the maximum gray value or the minimum gray value as a new watermark characteristic value when the first gray value is within a preset gray value range;
and when the first gray value is not in the preset gray value range, carrying out inversion operation on the second gray value to obtain a new watermark characteristic value.
Optionally, when the type of the background feature value includes a color tone of a background image, the similarity is a color tone similarity;
the determining module 54 is further configured to determine whether the color tone of the background image and the color tone of the watermark image are the same color tone;
the characteristic adjusting module 52 is further configured to, when the color tone of the background image and the color tone of the watermark image are the same color tone, obtain a preset color tone according to a corresponding relationship between the color tone of the background image and the preset color tone, and use the preset color tone as the color tone of the watermark image, where the preset color tone and the color tone of the background image are different color tones.
Optionally, the obtaining module 51 is further configured to obtain an embedding position of the watermark image,
the terminal 50 further includes:
a determining module 52, configured to determine, according to the embedding position and the size of the watermark image to be embedded, an embedding area where the watermark image is embedded in the background image;
the obtaining module 51 is further configured to obtain a background feature value of the background image of the embedded region.
Optionally, the terminal 50 further includes:
the detection module 55 is used for detecting whether the terminal starts the automatic watermark adjusting function;
and the transceiver module 56 is used for prompting a user to start the automatic watermark adjusting function when the terminal does not start the automatic watermark adjusting function, and receiving an instruction of the user to start the automatic watermark adjusting function.
The watermark embedding terminal of this embodiment may be configured to execute the technical solutions of the method embodiments shown in fig. 1 to 4, and the implementation principles and technical effects thereof are similar and will not be described herein again.
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when being executed by a processor, implements the technical solution according to any of the foregoing method embodiments, and the implementation principle and the technical effect are similar, and are not described herein again.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 9, the electronic device according to the embodiment includes:
a processor 61; and
a memory 62 for storing executable instructions of the processor;
the processor is configured to execute the technical solution of any one of the foregoing method embodiments by executing the executable instructions, and the implementation principle and technical effect thereof are similar, and are not described herein again.
The functions of the modules in the above-described apparatus may be implemented by the processor 61.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A watermark embedding method, comprising:
acquiring a background characteristic value of a background image, wherein the type of the background characteristic value comprises at least one of gray level and color tone of the background image;
acquiring a watermark characteristic value of a watermark image to be embedded, wherein the type of the watermark characteristic value comprises at least one of gray scale and tone of the watermark image; the type of the watermark characteristic value is the same as that of the background characteristic value;
according to the similarity between the background characteristic value and the watermark characteristic value, adjusting the watermark characteristic value to obtain a new watermark characteristic value;
and embedding the watermark image into the background image according to the new watermark characteristic value.
2. The method according to claim 1, wherein when the type of the background feature value includes a grayscale of a background image, the similarity is a grayscale similarity, and the adjusting the watermark feature value according to the similarity between the background feature value and the watermark feature value to obtain a new watermark feature value comprises:
when the difference value between the first gray value of the background image and the second gray value of the watermark image is smaller than a preset gray value difference value, judging whether the first gray value is in a preset gray value range, wherein the preset gray value range is a gray value range obtained by uniformly dividing the gray value between the minimum gray value and the maximum gray value into three sections from small to large and taking the gray value of the middle section;
if so, taking the maximum gray value or the minimum gray value as a new watermark characteristic value;
and if not, performing negation operation on the second gray value to obtain a new watermark characteristic value.
3. The method according to claim 1, wherein when the type of the background feature value includes a hue of a background image, the similarity is a hue similarity;
the adjusting the watermark characteristic value according to the similarity between the background characteristic value and the watermark characteristic value to obtain a new watermark characteristic value includes:
judging whether the color tone of the background image and the color tone of the watermark image are the same color tone or not;
if so, acquiring a preset tone according to the corresponding relation between the tone of the background image and the preset tone, and taking the preset tone as the tone of the watermark image, wherein the preset tone and the tone of the background image are different tones.
4. The method according to claim 3, wherein the hue of the background image is obtained according to hue, saturation and brightness of each pixel point of the background image;
correspondingly, the color tone of the watermark image is obtained according to the hue, saturation and brightness of each pixel point of the watermark image.
5. The method according to any one of claims 1 to 4, wherein the obtaining of the background feature value of the background image comprises:
the embedding position of the watermark image is obtained,
determining an embedding area for embedding the watermark image into the background image according to the embedding position and the size of the watermark image to be embedded;
and acquiring a background characteristic value of the background image of the embedded area.
6. The method of claim 1, wherein before obtaining the background feature value of the background image, the method further comprises:
detecting whether a terminal starts an automatic watermark adjusting function or not;
if not, prompting the user to start the automatic watermark adjusting function, and receiving an instruction of the user to start the automatic watermark adjusting function.
7. The method according to claim 1, wherein the background image is a background image in a current preview mode or a captured background image;
the watermark image is a static watermark image or a dynamic watermark image.
8. A terminal, comprising:
the acquisition module is used for acquiring a background characteristic value of a background image, wherein the type of the background characteristic value comprises at least one of gray level and color tone of the background image;
the acquisition module is further configured to acquire a watermark characteristic value of the watermark image to be embedded, where the type of the watermark characteristic value includes at least one of a gray level and a tone of the watermark image; the type of the watermark characteristic value is the same as that of the background characteristic value;
the characteristic adjusting module is used for adjusting the watermark characteristic value according to the similarity between the background characteristic value and the watermark characteristic value to obtain a new watermark characteristic value;
and the embedding module is used for embedding the watermark image into the background image according to the new watermark characteristic value.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-7 via execution of the executable instructions.
CN201711462005.6A 2017-12-28 2017-12-28 Watermark embedding method and terminal Pending CN108198123A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711462005.6A CN108198123A (en) 2017-12-28 2017-12-28 Watermark embedding method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711462005.6A CN108198123A (en) 2017-12-28 2017-12-28 Watermark embedding method and terminal

Publications (1)

Publication Number Publication Date
CN108198123A true CN108198123A (en) 2018-06-22

Family

ID=62585463

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711462005.6A Pending CN108198123A (en) 2017-12-28 2017-12-28 Watermark embedding method and terminal

Country Status (1)

Country Link
CN (1) CN108198123A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953994A (en) * 2020-08-31 2020-11-17 威创集团股份有限公司 Video watermark adding method and device
CN112287395A (en) * 2020-12-16 2021-01-29 北京信安世纪科技股份有限公司 Method, device and storage medium for binding stamp and signature original text
CN112883951A (en) * 2021-02-10 2021-06-01 支付宝(杭州)信息技术有限公司 Method, system and storage medium for protecting sensitive content
CN113947513A (en) * 2021-09-26 2022-01-18 安徽尚趣玩网络科技有限公司 Video watermark processing method, system, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7321667B2 (en) * 2002-01-18 2008-01-22 Digimarc Corporation Data hiding through arrangement of objects
CN102567974A (en) * 2010-12-16 2012-07-11 方正国际软件(北京)有限公司 Method and system for adjusting local color of image
CN105631797A (en) * 2015-12-24 2016-06-01 小米科技有限责任公司 Watermarking method and device
CN107256530A (en) * 2017-05-19 2017-10-17 努比亚技术有限公司 Adding method, mobile terminal and the readable storage medium storing program for executing of picture watermark
CN107392832A (en) * 2017-06-30 2017-11-24 广东欧珀移动通信有限公司 Image processing method and related product
CN107392833A (en) * 2017-07-27 2017-11-24 上海传英信息技术有限公司 A kind of adding method and adding set of the picture watermark based on smart machine

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7321667B2 (en) * 2002-01-18 2008-01-22 Digimarc Corporation Data hiding through arrangement of objects
CN102567974A (en) * 2010-12-16 2012-07-11 方正国际软件(北京)有限公司 Method and system for adjusting local color of image
CN105631797A (en) * 2015-12-24 2016-06-01 小米科技有限责任公司 Watermarking method and device
CN107256530A (en) * 2017-05-19 2017-10-17 努比亚技术有限公司 Adding method, mobile terminal and the readable storage medium storing program for executing of picture watermark
CN107392832A (en) * 2017-06-30 2017-11-24 广东欧珀移动通信有限公司 Image processing method and related product
CN107392833A (en) * 2017-07-27 2017-11-24 上海传英信息技术有限公司 A kind of adding method and adding set of the picture watermark based on smart machine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
钟桦等: "《数字水印与图像认证》", 31 August 2006, 西安电子科技大学出版社 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953994A (en) * 2020-08-31 2020-11-17 威创集团股份有限公司 Video watermark adding method and device
CN111953994B (en) * 2020-08-31 2021-08-06 威创集团股份有限公司 Video watermark adding method and device
CN112287395A (en) * 2020-12-16 2021-01-29 北京信安世纪科技股份有限公司 Method, device and storage medium for binding stamp and signature original text
CN112287395B (en) * 2020-12-16 2023-10-20 北京信安世纪科技股份有限公司 Method, apparatus and storage medium for binding stamp and signature original
CN112883951A (en) * 2021-02-10 2021-06-01 支付宝(杭州)信息技术有限公司 Method, system and storage medium for protecting sensitive content
CN113947513A (en) * 2021-09-26 2022-01-18 安徽尚趣玩网络科技有限公司 Video watermark processing method, system, electronic device and storage medium
CN113947513B (en) * 2021-09-26 2025-03-14 安徽尚趣玩网络科技有限公司 Video watermark processing method, system, electronic device and storage medium

Similar Documents

Publication Publication Date Title
WO2018176925A1 (en) Hdr image generation method and apparatus
US10397486B2 (en) Image capture apparatus and method executed by image capture apparatus
US8446481B1 (en) Interleaved capture for high dynamic range image acquisition and synthesis
CN103973983A (en) Method for intelligently adjusting brightness of picture on basis of detection of environmental brightness in photographing
CN105874786B (en) Image processing apparatus, image processing method and computer readable recording medium storing program for performing
CN108198123A (en) Watermark embedding method and terminal
CN104754239A (en) Photographing method and device
CN105528765B (en) Method and device for processing images
JPWO2015012040A1 (en) Image processing apparatus, imaging apparatus, image processing method, and program
KR102311367B1 (en) Image processing apparatus, image processing method, and storage medium
CN104735362A (en) Picture taking method and device
CN108200420B (en) Image adjusting method and device, readable storage medium and terminal
CN105554370A (en) Image processing apparatus and image processing method
CN111160267A (en) Image processing method, terminal and storage medium
CN107004390B (en) Display brightness control
CN111567034A (en) Exposure compensation method, device and computer readable storage medium
CN105957020A (en) Image generator and image generation method
CN105556957B (en) A kind of image processing method, computer storage media, device and terminal
CN110570370B (en) Image information processing method and device, storage medium and electronic equipment
CN110473156B (en) Image information processing method and device, storage medium and electronic equipment
CN112419218B (en) Image processing method and device and electronic equipment
KR20130134546A (en) Method for create thumbnail images of videos and an electronic device thereof
US10896344B2 (en) Information processing apparatus, information processing method, and computer program
CN116668862B (en) Image processing method and electronic device
WO2017101570A1 (en) Photo processing method and processing system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180622

RJ01 Rejection of invention patent application after publication