CN111345024A - Method and system for realizing automatic watermarking and square photographing - Google Patents

Method and system for realizing automatic watermarking and square photographing Download PDF

Info

Publication number
CN111345024A
CN111345024A CN201780096346.8A CN201780096346A CN111345024A CN 111345024 A CN111345024 A CN 111345024A CN 201780096346 A CN201780096346 A CN 201780096346A CN 111345024 A CN111345024 A CN 111345024A
Authority
CN
China
Prior art keywords
image
watermark
added
module
moved
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
CN201780096346.8A
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.)
Shenzhen Transsion Communication Co Ltd
Original Assignee
Shenzhen Transsion Communication 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 Shenzhen Transsion Communication Co Ltd filed Critical Shenzhen Transsion Communication Co Ltd
Publication of CN111345024A publication Critical patent/CN111345024A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Abstract

The invention discloses a method for realizing automatic watermarking and square photographing, which comprises the following steps: s1, setting a photographing mode; s2, sending a photographing instruction; s3, acquiring image data from the sensor end; s4, judging whether the square photographing mode is adopted, if so, executing a step S5, otherwise, executing a step S6; s5, cutting the image into a ratio of 1: 1; s6, judging whether a third-party algorithm needs to be processed, if so, performing third-party algorithm processing, and if not, not processing; s7, automatically adding watermarks to the obtained image to be added with the watermarks; and S8, generating the image with the watermark. The advantages are that: the situation of the square photographing function does not need to be considered separately, and the complexity of logic design and the probability of causing problems are reduced.

Description

Method and system for realizing automatic watermarking and square photographing Technical Field
The invention relates to the technical field of image processing methods, in particular to a method and a system for realizing double functions of automatic watermarking and square photographing.
Background
At present, no matter an android mobile phone or an IOS mobile phone, the photographing function is very light and the most attractive place for the eyes of customers, the richness of the photographing function of a product and the corresponding performance experience influence the sales volume of the product and the selection of the product by the customers to a great extent, and finally, whether the customers use or continue to use the product is determined, so that the increase of the photographing function is very important.
At present, there are a lot of digital photographs, manually drawn images, and display images of company products, etc. on the internet. However, the increase in the amount of network information will result in a rapid flow of information, with a large number of images on the internet being arbitrarily streamed from place to place without the consent of the owner. In order to solve the problem that the image is not allowed to be randomly streamed, the watermarking on the image can effectively protect the image of an image owner from being abused, and meanwhile, the watermarking on the image plays a role in identifying the image. Watermarking images has a wide range of applications, such as companies watermarking images to prevent others from misappropriating the images. At present, batch watermarking can only fix the position of the watermark, but is not as good as the position of the upper left corner, the upper right corner, the lower left corner or the lower right corner, and the like, and the area of the watermark position in the upper, lower, left and right areas is generally judged through the size and classification of images. However, when watermarking an image, the location of the watermark is important, and if the watermark is applied to a person's face, the user will not see the most important content in the image. However, if the watermark is added at the position of the blue sky in an image, the watching effect of a user is not influenced, and the purpose of intelligent watermarking is achieved. In the prior art, the watermark can only be fixedly added to the fixed position of the image, the most important content of some images can be easily covered by the watermark, the user experience is seriously influenced, the removal of the watermark at the fixed position in batches is relatively simple, and the image is easily stolen. In the prior art, an effective solution is not provided at present aiming at the problem that in the related art, the watermark can only be added to a fixed position in an image, so that part of important content is covered and the watermark is easy to remove.
Some mobile phones generate data while taking pictures, such as taking pictures, shooting pictures, drawing pictures, writing files and the like, add location information obtained through an internal or external GPS device into watermark information, and place the information in data information in a steganographic form or a field mode to form data containing verifiable GPS watermarks. The GPS watermark can not only verify the validity of the data, but also provide the information of the place where the data occurs. Particularly, in the new experience of digital photos using maps as indexes, the user can be given more abundant experience, such as that the user flies from one place to another place by combining with GOOGLEEARTH, and browses photos taken by the user by taking a place or a path as a clue, and the experience is different from that of watching a common photo album. The method is generally applied to equipment on the market at present, but for a security unit, the arrangement is such that a lot of secret information can be disclosed, and the possibility of disclosure exists, so that the development of a method for watermarking a photo during photographing with a security function is imperative.
Chinese patent application No.: CN200610113959.1, published as 8/30/2012, discloses a GPS watermark generation method, which has the technical scheme that, while an electronic device generates data (such as taking a picture, drawing a picture, and writing a file), the electronic device generates a verifiable GPS watermark by performing operation on location information obtained by an internal or external GPS device and data information, and combines the location information with the data information in a steganographic form or inserts the location information into the data information in a field manner to form data containing the GPS watermark. This method is currently used in devices on the market, but for security units, it is arranged so that many pieces of confidential information are disclosed, and there is a possibility of disclosure.
In the prior art, a dual implementation method of automatic watermarking and square photographing is that, as shown in fig. 1, S1' and a mobile app set a photographing mode; s2', sending a photographing instruction; s3', acquiring image data from the sensor end; s4', judging whether a third party algorithm needs to be processed, if so, obtaining the processed image data, and if not, not processing; s5 ', judging whether the square photographing mode is adopted, if not, executing a step S61 ', if so, executing a step S62 '; s61 ', calculating the offset (x, y) of the watermark relative to the lower left corner of the image, then adding the watermark, and continuing to execute the step S7'; s62 ', calculating the offset (x, y) of the watermark relative to the lower left corner of the image, adding the position offset of the square photographing cutting area, then adding the watermark, and continuing to execute the step S7'; s7 ', judging whether the square photographing mode is adopted or not again, if so, executing a step S81 ', otherwise, executing a step S82 '; s81', cutting a square region, generating an image, feeding the image back to the APP, and ending; and S82', generating an image, feeding back the image to the APP, and ending. In the method flow, the logic design is too complex, the square photographing mode is judged and correspondingly processed no matter when the automatic watermarking algorithm is processed or the image is finally generated, if other third-party algorithm processing is added, the logic design of the square photographing mode and the common photographing mode is more complex, so that the problem is more easily caused, and the problem that the watermark can only be added to the fixed position of the image also exists.
Disclosure of the invention
The invention aims to provide a method and a system for realizing double realization of automatic watermarking and square photographing, wherein after image data is obtained at a sensor end, square cutting is firstly carried out if the image data is in a square photographing mode, square cutting is not carried out if the image data is not in the square photographing mode, then automatic watermarking algorithm processing is carried out, finally corresponding data of an image is generated and fed back to an APP, so that extra corresponding offset does not need to be considered for the square photographing mode when the automatic watermarking algorithm processing is realized, and if a third algorithm sensitive to position offset is added for superposition, the situation of the square photographing function does not need to be considered independently, and the complexity of logic design and the probability of causing problems are reduced.
In order to achieve the purpose, the invention is realized by the following technical scheme:
a method for realizing automatic watermarking and square photographing is characterized by comprising the following steps:
s1, setting a photographing mode;
s2, sending a photographing instruction;
s3, acquiring image data from the sensor end;
s4, judging whether the square photographing mode is adopted, if so, executing a step S5, otherwise, executing a step S6;
s5, cutting the image into a ratio of 1: 1;
s6, judging whether a third-party algorithm needs to be processed, if so, performing third-party algorithm processing, and if not, not processing;
s7, automatically adding watermarks to the obtained image to be added with the watermarks;
and S8, generating the image with the watermark.
The above method for dual implementation of automatic watermarking and square photography, wherein the step S7 specifically includes:
s71, judging whether the user selects a default watermark adding mode or an optimal watermark adding mode, if so, adding a watermark to the image according to the set offset of the watermark relative to the lower left corner of the image, and executing a step S8, and if so, continuing to execute a step S72;
s72, carrying out blocking processing on the image to be added with the watermark to obtain a plurality of image areas;
s73, acquiring the gray value of each pixel point in the plurality of image areas;
s74, calculating the variance of the gray values of the plurality of image areas;
s75, taking the image area with the minimum gray value variance as the area to be added;
and S76, acquiring the watermark to be added, adding the watermark to be added to the area to be added, and continuing to execute the step S8.
The method for realizing double functions of automatic watermarking and square photographing includes, in step S72:
and dividing the image to be added with the watermark into a plurality of image areas according to the pixel value of the image to be added with the watermark.
The method for realizing double functions of automatic watermarking and square photographing, wherein the step S72 includes:
judging whether the pixel value of the image to be added with the watermark is smaller than a first preset pixel value or not;
if the pixel value of the image to be added with the watermark is smaller than the first preset pixel value, dividing the image to be added with the watermark into a first number of blocks;
and if the pixel value of the image to be added with the watermark is greater than the first preset pixel value, dividing the image to be added with the watermark into blocks with a second number, wherein the second number is greater than the first number.
The method for dual implementation of automatic watermarking and square photographing comprises the following steps:
if the pixel value of the image to be watermarked is greater than the first preset pixel value, dividing the image to be watermarked into a second number of blocks includes:
calculating the difference value between the pixel value of the image to be added with the watermark and the first preset pixel value;
obtaining a ratio obtained by dividing the difference value by a second preset pixel value;
calculating the product of the ratio and the second quantity, and taking the product as a third quantity;
dividing the image to be watermarked into the third number of blocks.
The above method for dual implementation of automatic watermarking and square photography, wherein the step S5 specifically includes:
s51, obtaining the attribute of the square cutting box;
s52, the image of the dragging operation is moved according to the dragging track through the dragging operation of the cutting frame to obtain the moved image;
and S53, performing equal-scale adjustment on the cutting frame according to the moved image and the attribute of the cutting frame.
The above method for dual implementation of automatic watermarking and square photography, wherein the step S52 specifically includes:
when the object of the dragging operation is a vertex in the cutting frame and the attribute of the cutting frame is fixed proportion cutting, the step of moving the object of the dragging operation according to the dragging track through the dragging operation of the cutting frame to obtain the moved object comprises the following steps: triggering the top point in the cutting frame to move according to the dragging operation of a user, taking the top point which is positioned at the same diagonal line with the moved top point as a fixed point, and acquiring the coordinates of the moved top point and the coordinates of the fixed point;
the step of adjusting the cutting frame according to the moved object and the attribute of the cutting frame is as follows:
calculating a distance ratio between the horizontal coordinate movement distance and the vertical coordinate movement distance in the moving vertex by taking the coordinate of the fixed point as a reference, judging whether the distance ratio is larger than a clipping ratio, if so, adjusting the horizontal coordinate of the moving vertex according to the vertical coordinate of the moving vertex and the clipping ratio, if not, adjusting the vertical coordinate of the dragging object according to the horizontal coordinate of the moving vertex and the clipping ratio, and obtaining an adjusted clipping frame according to the adjusted coordinate of the moving vertex and the coordinate of the fixed point.
A system for realizing automatic watermark and square double photographing is characterized by comprising:
the setting module is used for setting a photographing mode;
the photographing control module is used for receiving and sending a photographing instruction and controlling photographing;
the acquisition module is used for acquiring image data from the sensor end;
the judging module is used for judging the photographing mode set by the user;
the cutting module is used for responding and cutting the image according to the setting of a user;
the image processing module is used for carrying out third-party algorithm processing on the image;
the watermark adding module is used for adding a watermark to the image;
and the output module is used for outputting the image with the watermark.
The above-mentioned system for realizing automatic watermarking and square double photographing, wherein, the watermarking module comprises:
the dividing unit is used for carrying out block processing on the image to be added with the watermark and dividing the image to be added with the watermark into a plurality of picture areas;
the first acquisition module is used for acquiring the gray value of each pixel point in the plurality of picture areas;
a first calculation module, configured to calculate a variance of gray values of the plurality of picture regions;
a determining module, configured to determine a region to be added, where the region to be added is a picture region in which a variance of gray values in the plurality of picture regions is minimum;
the second acquisition module is used for acquiring the watermark to be added;
and the adding module is used for adding the watermark to be added to the area to be added.
The system for realizing automatic watermarking and square double photographing comprises a cutting module and a control module, wherein the cutting module comprises:
the cutting frame acquiring unit is used for acquiring a cutting frame and the attribute of the cutting frame;
the triggering unit is used for triggering the top point in the cutting box to move according to the dragging operation of a user and taking the top point which is positioned on the same diagonal line with the moved top point as a fixed point;
a coordinate acquisition unit configured to acquire coordinates of the moving vertex and coordinates of a fixed point;
a calculation unit configured to calculate a distance ratio between an abscissa movement distance and an ordinate movement distance in the moved vertex with reference to coordinates of a fixed point;
the judging unit is used for judging whether the distance proportion is larger than the cutting proportion or not and informing the judging result to the adjusting unit;
and the adjusting unit is used for adjusting the abscissa of the moved vertex according to the ordinate of the moved vertex and the clipping proportion when the distance proportion is larger than the clipping proportion, adjusting the ordinate of the moved vertex according to the abscissa of the moved vertex and the clipping proportion when the distance proportion is smaller than the clipping proportion, and obtaining an adjusted clipping frame according to the adjusted coordinate of the moved vertex and the coordinate of the fixed point.
Compared with the prior art, the invention has the following advantages: after image data are acquired at a sensor end, if the image data are in a square photographing mode, square cutting is firstly carried out, if the image data are not in the square photographing mode, square cutting is not carried out, then processing of an automatic watermarking algorithm is carried out, finally, data corresponding to the image are generated and fed back to a user, therefore, the square photographing mode does not need to be considered with extra corresponding offset when the automatic watermarking algorithm is processed, if a third-party algorithm sensitive to position offset is added for superposition, the situation of the square photographing function does not need to be considered independently, and the complexity of logic design and the probability of causing problems are reduced.
Brief description of the drawings
FIG. 1 is a flow chart of a dual implementation method of automatic watermarking and square photography in the prior art;
FIG. 2 is a flow chart of a dual implementation method of automatic watermarking and square photography according to the present invention;
FIG. 3 is a flow chart of a method of automatically adding a watermark according to the present invention;
FIG. 4 is a flow chart of an image cropping method of the present invention;
fig. 5 is a block diagram of the system of the present invention.
Best mode for carrying out the invention
The present invention will now be further described by way of the following detailed description of a preferred embodiment thereof, taken in conjunction with the accompanying drawings.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
As shown in fig. 2, the present invention provides a method for dual implementation of automatic watermarking and square photography, which comprises the following steps:
s1, setting a photographing mode;
s2, sending a photographing instruction;
s3, acquiring image data from the sensor end;
s4, judging whether the square photographing mode is adopted, if so, executing a step S5, otherwise, executing a step S6;
s5, cutting the image into a ratio of 1: 1;
s6, judging whether a third-party algorithm needs to be processed, if so, performing third-party algorithm processing, and if not, not processing;
s7, automatically adding watermarks to the obtained image to be added with the watermarks;
and S8, generating the image with the watermark.
The method of the invention enables the square cutting to be carried out firstly if the image data is obtained at the sensor end under the square photographing mode, and the square cutting is not carried out if the image data is not obtained at the sensor end, then the processing of the automatic watermarking algorithm is carried out, and finally the corresponding data of the image is generated and fed back to the user, thereby realizing the processing of the automatic watermarking algorithm without considering the additional corresponding offset to the square photographing mode, and if a third-party algorithm sensitive to the position offset is added for superposition, the situation of the square photographing function does not need to be considered separately, thereby reducing the complexity of logic design and the probability of causing problems.
As shown in fig. 3, preferably, the step S7 specifically includes:
s71, judging whether the user selects a default watermark adding mode or an optimal watermark adding mode, if so, adding a watermark to the image according to the set offset of the watermark relative to the lower left corner of the image, and executing a step S8, and if so, continuing to execute a step S72; the pixel value represents the size of the picture, and the larger the pixel value is, the larger the picture is;
s72, carrying out blocking processing on the image to be added with the watermark to obtain a plurality of image areas;
s73, acquiring the gray value of each pixel point in the plurality of image areas;
the gray value can be regarded as the brightness of the picture, and refers to the degree of shade of the color in the picture. For an 8-bit gray scale image, the gray scale value ranges from 0 to 255, with a gray scale value of 255 representing white and a gray scale value of 0 representing black. Each pixel point in the picture has a corresponding gray value. The gray level refers to the difference between brightness and darkness of the pixel points, and the more the gray level is, the clearer and more vivid the image level is. If the gray value of the pixel point is larger, the brightness of the pixel point is larger;
s74, calculating the variance of the gray values of the plurality of image areas;
the variance is the sum of the squares of the differences between the respective data and the mean; the variance is used for measuring the fluctuation degree of the data, and the smaller the variance is, the smaller the fluctuation degree of the data is. Calculating the variance of the gray values of the plurality of picture areas so as to find the picture area with the minimum variance of the gray values in the plurality of picture areas, wherein the smaller the variance is, the higher the color similarity of the picture area is, the more stable the picture area is, and the watermark is more suitable to be added to the picture area;
s75, taking the image area with the minimum gray value variance as the area to be added;
after the variance of the gray value of each picture area in the plurality of picture areas is calculated, the color difference of each picture area in the plurality of picture areas is judged by comparing the size of the variance of the plurality of picture areas. In the embodiment of the invention, the picture area with the minimum variance of the gray values in the plurality of picture areas is used as the area to be added with the watermark, so that the watching effect of a user on the picture is not influenced;
s76, acquiring a watermark to be added, adding the watermark to be added to the area to be added, and continuing to execute the step S8;
the image watermark adding method in the embodiment of the invention realizes the effect of intelligently determining the image watermark adding area by judging the minimum gray value variance in the plurality of image areas, and does not need to manually judge the adding area of the target image band.
The watermark to be added can be characters, pictures, a special mark or the combination of the characters, the pictures and the special mark. The user can select different watermarks from the memory to add to the target picture according to requirements. In the first embodiment of the invention, the target picture is divided into picture areas according to the size of the target picture, and the picture area with the minimum variance of the gray values in the multiple picture areas is used as the picture area to be added. The watermarks with different sizes are stored in the memory, and after the size of the picture area to be added is obtained, the watermark matched with the size of the picture area to be added is searched from the memory.
It should be noted that the above method is only a preferred implementation manner in the first embodiment of the present invention, and there may be other ways to obtain the watermark to be added.
According to the method for adding the watermark, the watermark to be added is added to the area to be added, so that the problems that the watermark can only be added to a fixed position in a picture to cause that part of important content is covered and the watermark is easy to remove are solved, and the effect of improving user experience is achieved.
The existing image segmentation methods mainly include the following categories: a threshold-based segmentation method, a region-based segmentation method, an edge-based segmentation method, a particular theory-based segmentation method, and the like. In this embodiment, in the step S72, the image to be watermarked is divided into a plurality of image areas according to pixel values of the image to be watermarked, where the pixel values represent sizes of pictures.
Specifically, the step S72 includes:
judging whether the pixel value of the image to be added with the watermark is smaller than a first preset pixel value or not;
if the pixel value of the image to be added with the watermark is smaller than the first preset pixel value, dividing the image to be added with the watermark into a first number of blocks;
and if the pixel value of the image to be added with the watermark is greater than the first preset pixel value, dividing the image to be added with the watermark into blocks with a second number, wherein the second number is greater than the first number.
In an embodiment of the present invention, if the pixel value of the image to be watermarked is greater than the first preset pixel value, dividing the image to be watermarked into a second number of blocks includes:
calculating the difference value between the pixel value of the image to be added with the watermark and the first preset pixel value;
obtaining a ratio obtained by dividing the difference value by a second preset pixel value;
calculating the product of the ratio and the second quantity, and taking the product as a third quantity;
dividing the image to be watermarked into the third number of blocks.
As shown in fig. 4, preferably, the step S5 specifically includes:
s51, obtaining the attribute of the square cutting box;
s52, the image of the dragging operation is moved according to the dragging track through the dragging operation of the cutting frame to obtain the moved image;
and S53, performing equal-scale adjustment on the cutting frame according to the moved image and the attribute of the cutting frame.
The above method for dual implementation of automatic watermarking and square photography, wherein the step S52 specifically includes:
when the object of the dragging operation is a vertex in the cutting frame and the attribute of the cutting frame is fixed proportion cutting, the step of moving the object of the dragging operation according to the dragging track through the dragging operation of the cutting frame to obtain the moved object comprises the following steps: triggering the top point in the cutting frame to move according to the dragging operation of a user, taking the top point which is positioned at the same diagonal line with the moved top point as a fixed point, and acquiring the coordinates of the moved top point and the coordinates of the fixed point;
the step of adjusting the cutting frame according to the moved object and the attribute of the cutting frame is as follows:
calculating a distance ratio between the horizontal coordinate movement distance and the vertical coordinate movement distance in the moving vertex by taking the coordinate of the fixed point as a reference, judging whether the distance ratio is larger than a clipping ratio, if so, adjusting the horizontal coordinate of the moving vertex according to the vertical coordinate of the moving vertex and the clipping ratio, if not, adjusting the vertical coordinate of the dragging object according to the horizontal coordinate of the moving vertex and the clipping ratio, and obtaining an adjusted clipping frame according to the adjusted coordinate of the moving vertex and the coordinate of the fixed point.
As shown in fig. 5, in order to implement the above method, the present invention further provides a system for implementing automatic watermarking and square double photographing, which includes:
the setting module 1 is used for setting a photographing mode;
the photographing control module 2 is used for receiving and sending a photographing instruction and controlling photographing;
the acquisition module 3 is used for acquiring image data from a sensor end;
the judging module 4 is used for judging the photographing mode set by the user;
the cutting module 5 is used for responding and cutting the image according to the setting of the user;
an image processing module 6, which is used for carrying out third-party algorithm processing on the image;
a watermark adding module 7, configured to add a watermark to the image;
and the output module 8 is used for outputting the image with the watermark.
The system for realizing automatic watermarking and square double photographing is characterized in that the watermarking adding module comprises:
the dividing unit is used for carrying out block processing on the image to be added with the watermark and dividing the image to be added with the watermark into a plurality of picture areas;
the first acquisition module is used for acquiring the gray value of each pixel point in the plurality of picture areas;
a first calculation module, configured to calculate a variance of gray values of the plurality of picture regions;
a determining module, configured to determine a region to be added, where the region to be added is a picture region in which a variance of gray values in the plurality of picture regions is minimum;
the second acquisition module is used for acquiring the watermark to be added;
and the adding module is used for adding the watermark to be added to the area to be added.
The system for realizing automatic watermarking and square double photographing comprises a cutting module, a storage module and a display module, wherein the cutting module comprises:
the cutting frame acquiring unit is used for acquiring a cutting frame and the attribute of the cutting frame;
the triggering unit is used for triggering the top point in the cutting box to move according to the dragging operation of a user and taking the top point which is positioned on the same diagonal line with the moved top point as a fixed point;
a coordinate acquisition unit configured to acquire coordinates of the moving vertex and coordinates of a fixed point;
a calculation unit configured to calculate a distance ratio between an abscissa movement distance and an ordinate movement distance in the moved vertex with reference to coordinates of a fixed point;
the judging unit is used for judging whether the distance proportion is larger than the cutting proportion or not and informing the judging result to the adjusting unit;
and the adjusting unit is used for adjusting the abscissa of the moved vertex according to the ordinate of the moved vertex and the clipping proportion when the distance proportion is larger than the clipping proportion, adjusting the ordinate of the moved vertex according to the abscissa of the moved vertex and the clipping proportion when the distance proportion is smaller than the clipping proportion, and obtaining an adjusted clipping frame according to the adjusted coordinate of the moved vertex and the coordinate of the fixed point.
While the present invention has been described in detail with reference to the preferred embodiments, it should be understood that the above description should not be taken as limiting the invention. Various modifications and alterations to this invention will become apparent to those skilled in the art upon reading the foregoing description. Accordingly, the scope of the invention should be determined from the following claims.

Claims (10)

  1. A method for realizing automatic watermarking and square photographing in a double mode is characterized by comprising the following steps:
    s1, setting a photographing mode;
    s2, sending a photographing instruction;
    s3, acquiring image data from the sensor end;
    s4, judging whether the square photographing mode is adopted, if so, executing a step S5, otherwise, executing a step S6;
    s5, cutting the image into a ratio of 1: 1;
    s6, judging whether a third-party algorithm needs to be processed, if so, performing third-party algorithm processing, and if not, not processing;
    s7, automatically adding watermarks to the obtained image to be added with the watermarks;
    and S8, generating the image with the watermark.
  2. The method for dual implementation of automatic watermarking and squaring according to claim 1, wherein the step S7 specifically comprises:
    s71, judging whether the user selects a default watermark adding mode or an optimal watermark adding mode, if so, adding a watermark to the image according to the set offset of the watermark relative to the lower left corner of the image, and executing a step S8, and if so, continuing to execute a step S72;
    s72, carrying out blocking processing on the image to be added with the watermark to obtain a plurality of image areas;
    s73, acquiring the gray value of each pixel point in the plurality of image areas;
    s74, calculating the variance of the gray values of the plurality of image areas;
    s75, taking the image area with the minimum gray value variance as the area to be added;
    and S76, acquiring the watermark to be added, adding the watermark to be added to the area to be added, and continuing to execute the step S8.
  3. The method for dual implementation of automatic watermarking and square photography according to claim 2, wherein in the step S72:
    and dividing the image to be added with the watermark into a plurality of image areas according to the pixel value of the image to be added with the watermark.
  4. The method for dual implementation of automatic watermarking and square photography according to claim 3, wherein the step S72 comprises:
    judging whether the pixel value of the image to be added with the watermark is smaller than a first preset pixel value or not;
    if the pixel value of the image to be added with the watermark is smaller than the first preset pixel value, dividing the image to be added with the watermark into a first number of blocks;
    and if the pixel value of the image to be added with the watermark is greater than the first preset pixel value, dividing the image to be added with the watermark into blocks with a second number, wherein the second number is greater than the first number.
  5. The method for dual implementation of automatic watermarking and squaring as recited in claim 4, wherein:
    if the pixel value of the image to be watermarked is greater than the first preset pixel value, dividing the image to be watermarked into a second number of blocks includes:
    calculating the difference value between the pixel value of the image to be added with the watermark and the first preset pixel value;
    obtaining a ratio obtained by dividing the difference value by a second preset pixel value;
    calculating the product of the ratio and the second quantity, and taking the product as a third quantity;
    dividing the image to be watermarked into the third number of blocks.
  6. The method for dual implementation of automatic watermarking and squaring according to claim 1, wherein the step S5 specifically comprises:
    s51, obtaining the attribute of the square cutting box;
    s52, the image of the dragging operation is moved according to the dragging track through the dragging operation of the cutting frame to obtain the moved image;
    and S53, performing equal-scale adjustment on the cutting frame according to the moved image and the attribute of the cutting frame.
  7. The method for dual implementation of automatic watermarking and squaring according to claim 6, wherein the step S52 specifically comprises:
    when the object of the dragging operation is a vertex in the cutting frame and the attribute of the cutting frame is fixed proportion cutting, the step of moving the object of the dragging operation according to the dragging track through the dragging operation of the cutting frame to obtain the moved object comprises the following steps: triggering the top point in the cutting frame to move according to the dragging operation of a user, taking the top point which is positioned at the same diagonal line with the moved top point as a fixed point, and acquiring the coordinates of the moved top point and the coordinates of the fixed point;
    the step of adjusting the cutting frame according to the moved object and the attribute of the cutting frame is as follows:
    calculating a distance ratio between the horizontal coordinate movement distance and the vertical coordinate movement distance in the moving vertex by taking the coordinate of the fixed point as a reference, judging whether the distance ratio is larger than a clipping ratio, if so, adjusting the horizontal coordinate of the moving vertex according to the vertical coordinate of the moving vertex and the clipping ratio, if not, adjusting the vertical coordinate of the dragging object according to the horizontal coordinate of the moving vertex and the clipping ratio, and obtaining an adjusted clipping frame according to the adjusted coordinate of the moving vertex and the coordinate of the fixed point.
  8. A system for realizing automatic watermarking and square double photographing is characterized by comprising:
    the setting module is used for setting a photographing mode;
    the photographing control module is used for receiving and sending a photographing instruction and controlling photographing;
    the acquisition module is used for acquiring image data from the sensor end;
    the judging module is used for judging the photographing mode set by the user;
    the cutting module is used for responding and cutting the image according to the setting of a user;
    the image processing module is used for carrying out third-party algorithm processing on the image;
    the watermark adding module is used for adding a watermark to the image;
    and the output module is used for outputting the image with the watermark.
  9. The system for performing automatic watermarking and square duplex photography according to claim 8, wherein the watermarking module comprises:
    the dividing unit is used for carrying out block processing on the image to be added with the watermark and dividing the image to be added with the watermark into a plurality of picture areas;
    the first acquisition module is used for acquiring the gray value of each pixel point in the plurality of picture areas;
    a first calculation module, configured to calculate a variance of gray values of the plurality of picture regions;
    a determining module, configured to determine a region to be added, where the region to be added is a picture region in which a variance of gray values in the plurality of picture regions is minimum;
    the second acquisition module is used for acquiring the watermark to be added;
    and the adding module is used for adding the watermark to be added to the area to be added.
  10. The system for performing automatic watermarking and square duplex photography according to claim 8, wherein the cropping module comprises:
    the cutting frame acquiring unit is used for acquiring a cutting frame and the attribute of the cutting frame;
    the triggering unit is used for triggering the top point in the cutting box to move according to the dragging operation of a user and taking the top point which is positioned on the same diagonal line with the moved top point as a fixed point;
    a coordinate acquisition unit configured to acquire coordinates of the moving vertex and coordinates of a fixed point;
    a calculation unit configured to calculate a distance ratio between an abscissa movement distance and an ordinate movement distance in the moved vertex with reference to coordinates of a fixed point;
    the judging unit is used for judging whether the distance proportion is larger than the cutting proportion or not and informing the judging result to the adjusting unit;
    and the adjusting unit is used for adjusting the abscissa of the moved vertex according to the ordinate of the moved vertex and the clipping proportion when the distance proportion is larger than the clipping proportion, adjusting the ordinate of the moved vertex according to the abscissa of the moved vertex and the clipping proportion when the distance proportion is smaller than the clipping proportion, and obtaining an adjusted clipping frame according to the adjusted coordinate of the moved vertex and the coordinate of the fixed point.
CN201780096346.8A 2017-08-30 2017-08-30 Method and system for realizing automatic watermarking and square photographing Pending CN111345024A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/099623 WO2019041163A1 (en) 2017-08-30 2017-08-30 Method and system for realising both automatic watermarking and square photography

Publications (1)

Publication Number Publication Date
CN111345024A true CN111345024A (en) 2020-06-26

Family

ID=65524568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201780096346.8A Pending CN111345024A (en) 2017-08-30 2017-08-30 Method and system for realizing automatic watermarking and square photographing

Country Status (2)

Country Link
CN (1) CN111345024A (en)
WO (1) WO2019041163A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115623245A (en) * 2022-12-19 2023-01-17 檀沐信息科技(深圳)有限公司 Image processing method and device in live video and computer equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113450243A (en) * 2020-03-24 2021-09-28 北京四维图新科技股份有限公司 Watermark adding method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156606A (en) * 2010-11-17 2011-08-17 华为终端有限公司 Finder frame processing method, picture processing method and user equipment
US20140307915A1 (en) * 2013-04-10 2014-10-16 Samsung Techwin Co., Ltd. Watermark processing device and method, and image capturing apparatus
CN104144297A (en) * 2014-08-19 2014-11-12 诚迈科技(南京)股份有限公司 System and method for automatically adding watermarks to shot pictures
CN104182927A (en) * 2014-09-12 2014-12-03 北京国双科技有限公司 Method and device for adding watermark to image
CN104378545A (en) * 2013-08-16 2015-02-25 中兴通讯股份有限公司 Photographing processing method and system
CN104836957A (en) * 2015-05-09 2015-08-12 陈包容 Photo shooting processing method and device
CN104994300A (en) * 2015-07-20 2015-10-21 魅族科技(中国)有限公司 Photographing method and terminal
CN105282441A (en) * 2015-09-29 2016-01-27 小米科技有限责任公司 Photographing method and device
CN106657761A (en) * 2016-09-29 2017-05-10 乐视控股(北京)有限公司 Picture shooting method and device for intelligent terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104952026B (en) * 2014-03-31 2019-09-27 腾讯科技(深圳)有限公司 The method and device of image procossing
US9712751B2 (en) * 2015-01-22 2017-07-18 Apple Inc. Camera field of view effects based on device orientation and scene content
CN106941589A (en) * 2017-03-30 2017-07-11 努比亚技术有限公司 Find a view photographic method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156606A (en) * 2010-11-17 2011-08-17 华为终端有限公司 Finder frame processing method, picture processing method and user equipment
US20140307915A1 (en) * 2013-04-10 2014-10-16 Samsung Techwin Co., Ltd. Watermark processing device and method, and image capturing apparatus
CN104378545A (en) * 2013-08-16 2015-02-25 中兴通讯股份有限公司 Photographing processing method and system
CN104144297A (en) * 2014-08-19 2014-11-12 诚迈科技(南京)股份有限公司 System and method for automatically adding watermarks to shot pictures
CN104182927A (en) * 2014-09-12 2014-12-03 北京国双科技有限公司 Method and device for adding watermark to image
CN104836957A (en) * 2015-05-09 2015-08-12 陈包容 Photo shooting processing method and device
CN104994300A (en) * 2015-07-20 2015-10-21 魅族科技(中国)有限公司 Photographing method and terminal
CN105282441A (en) * 2015-09-29 2016-01-27 小米科技有限责任公司 Photographing method and device
CN106657761A (en) * 2016-09-29 2017-05-10 乐视控股(北京)有限公司 Picture shooting method and device for intelligent terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115623245A (en) * 2022-12-19 2023-01-17 檀沐信息科技(深圳)有限公司 Image processing method and device in live video and computer equipment
CN115623245B (en) * 2022-12-19 2023-03-03 檀沐信息科技(深圳)有限公司 Image processing method and device in live video and computer equipment

Also Published As

Publication number Publication date
WO2019041163A1 (en) 2019-03-07

Similar Documents

Publication Publication Date Title
US11039064B2 (en) Image processing method and apparatus
US10559053B2 (en) Screen watermarking methods and arrangements
USRE43545E1 (en) Virtual skywriting
CN109064390B (en) Image processing method, image processing device and mobile terminal
WO2017016030A1 (en) Image processing method and terminal
JP5477196B2 (en) Display object generation method, digital media providing system, computer program therefor, and display object
CN110100251B (en) Apparatus, method, and computer-readable storage medium for processing document
US10839496B2 (en) Multiple exposure method, terminal, system, and computer readable storage medium
US20160210768A1 (en) Text-based image resizing
CN110933296A (en) Apparatus and method for providing content aware photo filter
JP2016505950A (en) Method and system for detecting and selecting the best pictures
CN105608716B (en) Information processing method and electronic equipment
CN108898082B (en) Picture processing method, picture processing device and terminal equipment
US20140104441A1 (en) Method and system for image capture and facilitated annotation
CN106599758A (en) Image quality processing method and terminal
US20160098863A1 (en) Combining a digital image with a virtual entity
WO2019015522A1 (en) Emoticon image generation method and device, electronic device, and storage medium
CN111345024A (en) Method and system for realizing automatic watermarking and square photographing
US8218823B2 (en) Determining main objects using range information
US20180293775A1 (en) Image animation in a presentation document
WO2015196681A1 (en) Picture processing method and electronic device
CN108932703B (en) Picture processing method, picture processing device and terminal equipment
EP2909792A1 (en) Method and system for image capture and facilitated annotation
CN113766258A (en) Live broadcast room virtual gift presentation processing method, equipment and storage medium
CN104954688A (en) Image processing method and image processing device

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: 20200626

RJ01 Rejection of invention patent application after publication