CN116883223B - Image watermark synthesis method and device, equipment, medium and product thereof - Google Patents

Image watermark synthesis method and device, equipment, medium and product thereof Download PDF

Info

Publication number
CN116883223B
CN116883223B CN202310620186.XA CN202310620186A CN116883223B CN 116883223 B CN116883223 B CN 116883223B CN 202310620186 A CN202310620186 A CN 202310620186A CN 116883223 B CN116883223 B CN 116883223B
Authority
CN
China
Prior art keywords
watermark
image
texture
information
textures
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.)
Active
Application number
CN202310620186.XA
Other languages
Chinese (zh)
Other versions
CN116883223A (en
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.)
Guangzhou Huanju Mark Network Information Co ltd
Original Assignee
Guangzhou Huanju Mark Network Information 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 Guangzhou Huanju Mark Network Information Co ltd filed Critical Guangzhou Huanju Mark Network Information Co ltd
Priority to CN202310620186.XA priority Critical patent/CN116883223B/en
Publication of CN116883223A publication Critical patent/CN116883223A/en
Application granted granted Critical
Publication of CN116883223B publication Critical patent/CN116883223B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures

Abstract

The application relates to an image watermark synthesis method and a device, equipment, medium and product thereof, wherein the method comprises the following steps: invoking a camera unit to acquire live image data, and converting the live image data into first image textures in a first texture space; converting the target watermark into watermark textures in a first image texture in a first texture space, and then rendering the first image texture into a graphical user interface to present a watermark-containing image, wherein watermark information of the target watermark is presented in the watermark-containing image; and in response to an image export instruction, synthesizing the watermark texture of the target watermark into the second image texture of the live image data in a second texture space, and exporting the watermark texture into a live image file. Corresponding watermark textures are generated in different texture spaces for field image data shot by the shooting unit, and different requirements of watermark preview and export are matched, so that the generation of the watermark textures is performed deep into the texture space of the shooting unit, and the generation is more efficient.

Description

Image watermark synthesis method and device, equipment, medium and product thereof
Technical Field
The present disclosure relates to image processing technologies, and in particular, to an image watermark synthesis method and apparatus, device, medium, and product thereof.
Background
In various image application software, a watermark adding function is often provided, a watermark image generated by a user is conveniently added to a designated picture, the functions of information remarking or information checking and the like are realized through the watermark image, wherein the watermark image can be provided with a corresponding template for the image application software on the terminal equipment by a server, and then the image application software can apply the template to call the corresponding watermark information to generate the watermark image.
The watermark information needs to be added on the photo/video under the shooting scene, and the composition and the display of the watermark information are rich and diversified. The existing photo watermarking method in the industry is to generate a watermark Bitmap by binding original view+ data of a mobile phone platform, then to carry out superposition and merging with the photographed and collected pictures, and finally to generate a photo with watermark or a series of photos to be finally encoded into a video. The traditional photo/video watermarking scheme has low generation efficiency, no real-time preview and watermark layout is very limited by the layout of the original View, so that the daily use requirements of users and the rapid development of services are not met.
The manner in which the watermark is rendered and generated using native View, while viable, presents a number of problems, including: repeating labor force: codes and implementation modes at two ends of Android and iOS are different, and each time new needs to be changed, the codes are required to be changed at the two ends; multi-port consistency cannot be achieved: even if Android and iOS simultaneously realize the same watermark requirement, the View system at both ends inherently has some subtle differences, which can lead to the watermark expression to have some subtle differences; difficult to extend to other platforms: if the watermark is required to be used at the Web end and the desktop end, a rendering system of the watermark needs to be built again from scratch at each end, and the workload is huge and heavy; multi-terminal code is difficult to maintain: if watermark rendering needs to be supported at 5 ends of Android, iOS, windows, macOS, web, in the past, 5 copies of code will be generated, which is quite costly to maintain.
Therefore, the scheme for generating the watermark image in the prior art has a liftable space, relates to the optimization of a background technical architecture supporting the generation of the watermark image, upgrades the implementation scheme of the watermark generation, and has wide technical prospect.
Disclosure of Invention
It is an object of the present application to solve the above-mentioned problems and provide an image watermark synthesis method and corresponding apparatus, device, non-volatile readable storage medium, and computer program product.
According to one aspect of the present application, there is provided an image watermark synthesis method, including the steps of:
invoking a camera unit to acquire live image data, and converting the live image data into first image textures in a first texture space;
converting the target watermark into watermark textures in a first image texture in a first texture space, and then rendering the first image texture into a graphical user interface to present a watermark-containing image, wherein watermark information of the target watermark is presented in the watermark-containing image;
and in response to an image export instruction, synthesizing the watermark texture of the target watermark into the second image texture of the live image data in a second texture space, and exporting the watermark texture into a live image file.
According to another aspect of the present application, there is provided an image watermark synthesis apparatus including:
the camera shooting conversion module is used for calling the camera shooting unit to acquire field image data and converting the field image data into first image textures in a first texture space;
the watermark rendering module is arranged to render the first image texture into a graphical user interface to present a watermark-containing image after converting the target watermark into the watermark texture in the first image texture in the first texture space, wherein watermark information of the target watermark is presented in the watermark-containing image;
and the watermark synthesis module is used for responding to an image export instruction, synthesizing the watermark texture of the target watermark into the second image texture of the live image data in a second texture space, and exporting the watermark texture into a live image file.
According to another aspect of the present application there is provided an image watermark composition apparatus comprising a central processor and a memory, the central processor being arranged to invoke the steps of executing a computer program stored in the memory to perform the image watermark composition method described herein.
According to another aspect of the present application, there is provided a non-transitory readable storage medium storing a computer program implemented in accordance with the image watermark synthesis method in the form of computer readable instructions, which when executed by a computer, perform the steps included in the method.
According to another aspect of the present application, there is provided a computer program product comprising computer programs/instructions which when executed by a processor implement the steps of the method as described in any of the embodiments of the present application.
Compared with the prior art, the method and the device have the advantages that the watermark texture of the target watermark and the image texture of the field image data obtained by shooting by the shooting unit are respectively rendered and synthesized through two different texture spaces, namely the first texture space and the second texture space, and are all executed in the texture space, so that the operation of the watermark texture in the rendering and synthesizing processes can be transferred to the GPU for execution, the infrastructure that the watermark image is generated without depending on the original View (View) is realized, the real-time preview function of the watermark image is realized, the two different conditions of display and export can be simultaneously realized, the display efficiency and the image quality requirement of the exported image are simultaneously considered, and the watermark generation service is more flexible and richer.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a network architecture schematic of an exemplary application environment of the present application;
FIG. 2 is an exemplary graphical user interface showing the effect of superimposing a watermark image over a preview image captured by a camera unit over the interface and showing a list of watermark templates under the interface;
FIG. 3 is a schematic diagram of a technical architecture of a watermark rendering service of the present application;
FIG. 4 is a schematic diagram of a technical architecture of a watermark data center of the present application;
FIGS. 5 and 6 are exemplary watermark images, wherein FIG. 5 contains a compass pattern and FIG. 6 contains a decibel pattern;
FIG. 7 is a flow chart of an embodiment of an image watermarking method of the present application;
FIG. 8 is a schematic flow chart of generating watermark images according to watermark resource packages in an embodiment of the present application;
FIG. 9 is a schematic flow chart of rendering display of a watermark image in an embodiment of the present application;
FIG. 10 is a flow chart of generating watermark textures through different rendering interfaces in an embodiment of the present application;
fig. 11 is a schematic flow chart of editing watermark information in the embodiment of the present application;
FIG. 12 is an exemplary watermark information editing interface;
fig. 13 is a schematic flow chart of repositioning watermark images in an embodiment of the present application;
FIG. 14 is a flowchart of deriving live image files according to an embodiment of the present application;
fig. 15 is a schematic block diagram of an image watermark synthesizing apparatus of the present application;
fig. 16 is a schematic structural diagram of an image watermark synthesizing apparatus used in the present application.
Detailed Description
Referring to fig. 1, a network architecture adopted in an exemplary application scenario of the present application includes a terminal device 80 and a server 82, where data communication between the terminal device 80 and the server 82 may be performed through the internet or a local area network.
The terminal device can be a mobile terminal such as a smart phone or other types of terminals such as a personal computer, a tablet computer and the like, and the terminal device comprises a camera unit for shooting a scene environment image so as to generate a scene image. After the camera shooting unit is started, the camera shoots and acquires live image data, then a texture space corresponding to a preview image of the live image data is created according to business logic of a bottom layer driver of the live image data, image textures of the preview image are generated in the texture space, and then the image textures are rendered into a graphical user interface to display the preview image. The terminal equipment can synthesize the target watermark for the preview image of the scene environment image shot by the terminal equipment through installing the image application software applying the method, so that the watermark-containing image can be obtained, and the watermark-containing image can be displayed in a graphical user interface of the terminal equipment and can be further exported as a scene image file. The operating system of the terminal device is not limited and may be any published or to be published operating system, including but not limited to IOS, android, homonyOS, linux, windows and the like,
The server 82 is configured to provide watermark templates for image application software in a terminal device, including providing a watermark template list comprising a plurality of candidate watermark templates, providing watermark resource packages of various watermark templates, and the like. The server 82 may also store and provide installation files for the image application software, may also store and provide installation files for a component in the image application software, such as a rendering virtual machine therein, may also be used to store and publish watermark-containing images generated by the terminal device, and the like. Of course, these functions of the server 82 may be distributed among a plurality of servers independently responsible for individual functions, and may be deployed as the case may be. The server 82 may refer to a front-end server in a service cluster, and each server in the service cluster may be distributed.
The image application software of the present application may be software that exhibits different functions depending on the application scenario served by the software, for example, may be camera software, image optimization software, image storage software, project management software of a scene such as a property field or a construction site, etc., and it is not easy to understand that the software with different functions may constitute the image application software referred to herein by applying a computer program product that is programmed and implemented according to the method of the present application.
The watermark template is used for generating corresponding watermarks and can be endowed with corresponding identifications so as to index calls. The watermark template may be composed of corresponding files in cross-platform language, and these files are then packaged into watermark resource packages of the watermark template. The watermark resource package can be issued to a server in an encrypted form for storage, and when the watermark resource package is used by the image application software, the file in the watermark resource package can be obtained by corresponding decryption. The files in the watermark resource package mainly comprise files of executable scripts of the generation business logic of the corresponding watermark, files of data configuration information of each data item in the watermark information, and files of layout configuration information of display patterns of the formatted watermark information. The executable script can be written in any cross-platform language, such as Lua development language, java development language and the like, and naturally, a rendering virtual machine in the image application software also supports the corresponding development language so as to analyze and execute the executable script in the watermark resource package. In some embodiments, the watermark resource package may further include a file of a pattern to be displayed in the watermark, wherein the data configuration information and the style configuration information may also be compiled into the same file, for example, an XML format file, and the executable script may be independently a single file to facilitate the call. It can be seen that the file composition form in the watermark resource package is flexible, and it is sufficient to provide executable scripts, data configuration information and layout configuration information required for describing the watermark through various files to generate the corresponding watermark.
The watermark templates can be used as candidate watermark templates, a watermark template list shown below the interface of fig. 2 is displayed in a graphical user interface for selection by a user, and when the user selects one candidate watermark template from the watermark templates, the candidate watermark templates selected by the user (marked items in fig. 2) form watermark templates of target watermarks, and the watermark templates can be used for generating target watermarks and are overlapped in preview images (shown above fig. 2) of the camera unit. In some embodiments, when the watermark template is displayed in the graphical user interface, the watermark template may be displayed as the corresponding identifier thereof, or as shown in fig. 2, by parsing the executable script in the watermark resource package for executing the watermark template, and applying the corresponding data configuration information and layout configuration information, a corresponding watermark preview image is generated and displayed in the graphical user interface to refer to the corresponding watermark template, so that the user can more intuitively see the watermark effect, and the user can conveniently and quickly select the target watermark.
After the terminal equipment runs, the image application software can realize the technical architecture shown in fig. 3, wherein the technical architecture consists of a plurality of protocol layers, including an application layer, an embedded layer, an engine layer and an execution layer. The application layer is mainly responsible for providing corresponding upper layer services for users, so that camera watermark generation services can be provided, and data communication interaction and the like are carried out with the server; the embedded layer is mainly responsible for adapting to an operating system, and mainly executes related business logic in a CPU (central processing unit) to provide services such as class encapsulation, image library environment creation, error collection and reporting, event notification, watermark data source acquisition, watermark template downloading and the like; the engine layer is mainly responsible for realizing transparent transmission service of the embedded layer and the execution layer, and is responsible for creating a rendering virtual machine to open a data channel between the embedded layer and the execution layer, so that the rendering virtual machine can call a rendering interface of the execution layer, transmit various data required by generating a target watermark to the rendering interface and process various events generated by the rendering interface; the execution layer mainly works on the GPU layer, and by providing various rendering interfaces for the rendering virtual machine of the engine layer to call, when the rendering virtual machine is called, corresponding drawing and rendering tasks are executed, and the generation display and the like of the target watermark and the watermark-containing image are realized. The rendering interface of the execution layer belongs to the rendering interface provided by the open graphics library (OpenGL, open Graphics Library), and may include a layout rendering interface, a text rendering interface, a pattern rendering interface, and the like according to different contents to be rendered.
In the process of generating the watermark texture, the rendering virtual machine adapts to the requirements of watermark information, patterns, styles and the like required by the watermark texture, and encapsulates a watermark data center framework to meet the requirements, wherein the watermark data center framework is composed of a plurality of realization layers, including a data source acquisition layer, a pattern encapsulation layer, a data conversion layer and a watermark display layer, as shown in fig. 4. The data source acquisition layer is mainly responsible for acquiring corresponding attribute data from corresponding data sources according to data items specified in the data configuration information of the target watermark, wherein the data sources include, but are not limited to, audio data acquired by an audio pickup device of the terminal device, various sensor data in the terminal device, position data provided by a global positioning system of the terminal device, time data provided by the terminal device, data provided by other network interfaces and the like. The pattern packaging layer is mainly responsible for determining a pattern specified in layout configuration information of the target watermark, and the pattern can be flexibly preset, for example, a compass pattern or a position pattern as shown in fig. 5, which is provided corresponding to position data, a decibel display pattern as shown in fig. 6, which is provided corresponding to audio data, a two-dimensional code pattern which packages all watermark information provided by data sources corresponding to all data items, and the like. The data conversion layer is mainly responsible for standardized conversion of formats of watermark information corresponding to various data items. The watermark presentation layer is mainly responsible for providing the view layer required for rendering the target watermark so that the watermark texture of the target watermark can be processed relatively independently at the GPU level based on the view layer.
Through the technical architecture and the watermark data center, the whole technical architecture for generating the watermark can be optimized, the watermark packaging service and the method for executing the application can be efficiently realized, the watermark rendering efficiency and rendering effect are improved, the development efficiency of image application software is optimized, and the updating efficiency of a watermark template is improved.
Referring to fig. 7, in one embodiment, an image watermark synthesizing method provided in the present application includes the following steps:
step S2100, calling a camera unit to acquire live image data, and converting the live image data into a first image texture in a first texture space;
according to the service logic, when external application software, such as image application software of the application, calls the camera unit to start generating the preview image of the field environment, at the program bottom layer, the camera unit processes optical information through an interface of a camera call open graphics library (OpenGL) to generate field image data, then under the control of the GPU, the field image data is converted into first image textures in a preset texture space, namely a first texture space, and finally the first image textures are displayed in a graphical user interface to be the preview image visible in the graphical user interface.
The above process of generating a preview image by the camera unit, all performed in the GPU, is typically limited in size, resolution, etc. to the size of the first texture space, so although in some embodiments the preview image may be derived directly from the first texture space to generate video and/or pictures, in other embodiments a larger texture space may be opened up additionally to generate higher quality video and/or pictures.
Step S2200, after converting the target watermark into watermark textures in the first image texture in a first texture space, rendering the first image texture into a graphical user interface to present a watermark-containing image, wherein watermark information of the target watermark is presented in the watermark-containing image;
the target watermark may be predetermined, for example, when the user opens the image application in the terminal device, a watermark template corresponding to the target watermark may be selected from given candidate watermark templates, as shown in fig. 2, so as to generate a watermark texture corresponding to the target watermark based on this watermark template.
In one embodiment, the image application software may be a camera software that, when turned on, drives the camera unit of the terminal device to acquire live image data and generate a corresponding preview image for display in the graphical user interface. In order to select the watermark template, a template acquisition inlet can be provided in the interface where the preview image is located, a user can browse a plurality of candidate watermark templates through the template acquisition, and select one of the candidate watermark templates as a target watermark, and the target watermark generated according to the watermark template can be displayed in a superimposed manner in the preview image, so that the preview image becomes a watermark-containing image.
In another embodiment, the image application software may be a project management software for property management, in which a photographing function is integrated, a user may designate in advance, or designate a watermark template corresponding to the target watermark in the preview image interface after the photographing function is activated, and similarly, the watermark template may be selected from a plurality of candidate watermark templates, and after the watermark template is selected, a watermark-containing image is presented in the photographing interface on the basis of the preview image corresponding to the live image data.
The watermark template can be written based on cross-platform scripting language so as to realize the description of watermark textures of the target watermark by analyzing and executing the scripting language. Each watermark template has its corresponding watermark resource package, which contains a plurality of files to give executable script, data configuration information and layout configuration information, and has its corresponding identification to realize indexing and calling of its corresponding watermark resource package and various files therein.
The executable script is written according to business logic corresponding to the generated watermark, and when the executable script is analyzed and executed, the executable script can generate a corresponding target watermark according to corresponding data configuration information and layout configuration information, and the watermark texture of the target watermark is described.
The data configuration information is mainly used to define each data item in watermark information presented by the target watermark, and the data items may include attribute data corresponding to one or more attributes, such as shooting time information, shooting position information, unique identification codes of terminal devices, and the like of field image data.
The layout configuration information is mainly used for formatting the display style of the watermark information, and comprises various style data, such as paths of patterns forming a main body or background of a target watermark and the like, size information, color information, display positions or display forms of various data items and the like of related patterns, which are preset according to requirements, wherein the patterns are suitable for different specific data items in the watermark information and correspondingly different, for example, if the watermark information only comprises shooting position information, the patterns can be compass style; if a plurality of data items are included in the watermark information, including, for example, shooting position information and shooting time information, the pattern may also be a form line pattern or the like.
When the executable script is analyzed and run, corresponding attribute data can be acquired according to the data items specified in the data configuration information, corresponding pattern resources can be loaded according to style data in the layout configuration information, and display forms, display positions, display sizes and the like of various data items can be determined. It will be appreciated that a watermark asset package is essentially a collection of data describing the effect of the generation of a corresponding watermark by means of executable scripts, data configuration information and layout configuration information.
Various files in the watermark resource package of the watermark template can be analyzed and extracted in advance and stored in the local storage equipment so as to be called efficiently. It will be appreciated that when a watermark template of a target watermark is required to be invoked for generating a corresponding watermark or an effect preview thereof, invocation of various files in a watermark resource package corresponding to the watermark template is also involved.
The method is suitable for the general technical architecture described in the application, the image application software in the terminal equipment is provided with the watermark access engine, the watermark access engine mainly realizes the problem of access adaptation of different operating systems, a rendering virtual machine special for a watermark template of a target watermark can be created for generating the target watermark through the watermark access engine, so that the application of the watermark template is executed in the corresponding rendering virtual machine, and the problem of adapting the watermark template to an execution layer is solved through the rendering virtual machine.
The rendering virtual machine can realize the analysis execution of the watermark template, in particular to the analysis execution of a script which is usually written in cross-platform language in the watermark template, and the execution of instructions in the script invokes various configuration information of the watermark template to realize the description, rendering, display and other business logic of watermark textures of corresponding target watermarks.
Therefore, after the user selects the watermark template of the target watermark, the watermark access engine can be loaded and started, the watermark access engine can complete the analysis of configuration information in a watermark resource package of the watermark template in the CPU by calling the rendering virtual machine, form a description suitable for an execution layer, and then create an environment required by the GPU, including corresponding threads, contexts and the like, so that the rendering virtual machine can control the GPU to complete the process of generating the target watermark.
In some embodiments, the watermark access engine may be implemented as a scheduling interface, which may be flexibly allocated as needed between the functions implemented by the rendering virtual machine created by the watermark access engine, for example, the functions of parsing and describing the configuration information of the watermark template, the functions of creating threads and contexts required by the GPU, and the like may also be migrated into the watermark access engine for implementation.
In some embodiments, when there are multiple target watermarks to be invoked, the watermark access engine may maintain a corresponding multiple rendering virtual machine instances corresponding to the multiple target watermarks, and when a certain target watermark is deleted by a user, may sell the corresponding rendering virtual machine instances, and recover a corresponding memory, so as to ensure operation efficiency of the terminal device.
In some embodiments, the watermark access engine is responsible for human-computer interaction response to implement an interaction event notification message mechanism in advance, and when a corresponding interaction event is triggered in the graphical user interface, a corresponding event notification is generated, so that the rendering virtual machine can respond to the corresponding event notification to change the target watermark, and operations such as rewriting and/or editing of watermark textures of the target watermark can be implemented.
In some embodiments, the watermark access engine may be responsible for receiving the update notification of the latest version of the watermark template pushed by the server, and when a watermark template issues the latest version, the server may broadcast a corresponding notification message to each accessed terminal device, and the terminal device may download the watermark resource package of the latest version of the corresponding watermark template in response to the notification message, so as to replace the old version of the watermark template.
When the rendering virtual machine for generating the target watermark is called by the watermark access engine, the rendering virtual machine can apply the watermark template of the target watermark so as to generate corresponding watermark textures.
When the rendering virtual machine applies the watermark template, the application of the watermark template is realized by executing the application on various files carried in a watermark resource package of the watermark template, the rendering interface provided by the execution layer is called to generate the watermark texture corresponding to the watermark template, and the watermark texture is superimposed on the first image texture corresponding to the field image data acquired by the camera unit of the terminal equipment.
In one embodiment, the watermark access engine is adapted to analyze and describe various configuration information of the watermark template, the watermark access engine transmits a watermark description tree and a watermark layout for describing the target watermark to the rendering virtual machine, and the rendering virtual machine calls each corresponding rendering interface in the execution layer according to the watermark description tree and the watermark layout to coordinate and complete drawing of watermark textures of the target watermark corresponding to the watermark template in a texture space corresponding to field image data of the camera unit.
In another embodiment, the rendering virtual machine is adapted to the situation that the rendering virtual machine is responsible for analyzing and describing various configuration information of the watermark template, the rendering virtual machine generates a watermark description tree and a watermark layout corresponding to the watermark template by itself, and then invokes each corresponding rendering interface in the execution layer according to the watermark description tree and the watermark layout, so as to coordinate and complete drawing of watermark textures of a target watermark corresponding to the watermark template in a texture space corresponding to field image data of the camera unit.
It is apparent that, in any of the above embodiments of the present application, the rendering virtual machine is configured to implement drawing and rendering of watermark textures by calling a rendering interface at a bottom layer of the terminal device, that is, the watermark textures of the present application are directly generated by performing drawing and rendering in the GPU, specifically, are generated in a texture space of a processing business process inherent to the camera unit, which is different from a case of creating a view layer in the CPU to generate watermark images in the conventional technology, it is ensured that the generation of watermark textures is implemented by means of a cross-platform language, without depending on a development language native to the image application software, and it is ensured that the development language adopted by the watermark template is completely decoupled from the development language adopted by the image application software due to such advantages.
When the rendering virtual machine superimposes and draws watermark textures corresponding to the target watermark into image textures of the field image data in a texture space corresponding to the field image data of the camera unit, the image textures are further rendered into a graphical user interface for display, at the moment, the graphical user interface can display a watermark-containing image, in the watermark-containing image, a preview image of the field image data is taken as a background, a watermark image corresponding to the watermark textures of the target watermark is taken as a foreground, and corresponding watermark information is provided through the watermark image.
In general, in some embodiments, the field information when the image capturing unit captures the field environment image is defined by the data configuration information in the watermark template, where the field information may include capturing position information and/or capturing time information, and in this case, by using the field information in the watermark image, the correspondence between the watermark image and the real environment may be checked, and by checking, it is determined whether the corresponding watermark image belongs to the field real image, so that downstream services such as verification, attendance checking, and the like on the construction site may be implemented.
In some embodiments, the continuous multi-frame watermark-containing image can be exported as live video files, and when the live video files are played, the corresponding watermark images can be seen from the played images, so that watermark information in the live video files can be obtained. Similarly, a single frame of watermark-containing image can be exported as a field picture file, and corresponding watermark images can be checked from the field image after the field picture file is displayed, so that watermark information in the field picture file can be obtained.
Step S2300, in response to an image export instruction, synthesizes a watermark texture of the target watermark into a second image texture of the live image data in a second texture space, and exports the watermark texture as a live image file.
In view of the fact that the memory in the first texture space used inherently by the camera unit is lower, in order to obtain a higher quality watermark-containing image output, when the user triggers the image export instruction, the rendering interface may be called by the rendering virtual machine, and the GPU draws another image texture of the live image data, namely the second image texture and another watermark texture of the target watermark, in the texture space used for the preview image of the camera unit, namely the other texture space of the first texture space, namely the second texture space, and then synthesizes the two into a live image file. The image file may be either a live video file as described above or a live picture file as described above, depending on the specific functional requirements. It will be appreciated that the memory space occupied by the second texture space for deriving the live image file is larger than the memory space occupied by the first texture space corresponding to the preview image of the camera unit, so that, in general, the image texture and watermark texture in the second texture space are also larger in scale than those in the first texture space, so as to obtain a higher-definition image file of a larger scale.
In one embodiment, when the watermark texture is generated in the second image texture in the second texture space, the position of the second image texture where the watermark texture is located is kept consistent with the position of the watermark texture in the first image texture, so that the effect of displaying the watermark image in the graphical user interface can be ensured to correspondingly migrate to the derived live image file. The location of the occurrence of the watermark texture in the image texture is typically described in the watermark layout.
From the above embodiments, the present application has various technical advantages, including but not limited to:
firstly, the most basic advantage is that the method and the device respectively realize the rendering and the synthesis of the watermark texture of the target watermark and the image texture of the field image data obtained by shooting by the shooting unit through two different texture spaces, namely a first texture space and a second texture space, and are all executed in the texture spaces, so that the operation of the watermark texture in the rendering and synthesizing processes can be transferred to the GPU for execution, the infrastructure that the original View is not needed to be relied on for generating the watermark image is realized, the real-time preview function of the watermark image is realized, the two different conditions of display and export are both considered, the display efficiency and the image quality requirement of the exported image are both considered, and the watermark generation service is more flexible and richer.
Based on the most basic advantages of the application, a new image watermark rendering technical architecture can be redesigned, a relatively independent watermark access engine is provided for image application software at a terminal device side, when a corresponding watermark template is determined by generating a target watermark, the watermark access engine creates a corresponding rendering virtual machine for the watermark template, the watermark template is suitable for being analyzed and executed to describe watermark textures of the target watermark, and the rendering virtual machine has corresponding analysis processing capacity, so that the rendering virtual machine applies the watermark template, the corresponding watermark textures of the watermark template are superimposed for image textures of field image data acquired by a camera unit, and then the image textures superimposed with the watermark textures are rendered into a graphical user interface of the terminal device, so that a watermark-containing image can be efficiently displayed in the graphical user interface.
In the application, each watermark template is analyzed by the corresponding rendering virtual machine, so that the rendering virtual machine realizes watermark rendering logic in a manner of supporting cross-platform language, the application of the watermark template compiled by the cross-platform scripting language is supported, when the watermark pattern in the watermark template is updated, the rendering virtual machine can analyze and execute the cross-platform language script of the watermark template to realize dynamic updating of the watermark under the condition of not modifying the codes of the image application software at the terminal equipment side, through the dynamic updating capability, frequent edition of the image application software under various operating systems can be avoided, the watermark can be quickly adjusted and updated on the premise of not influencing user experience, the flexibility and instantaneity of the watermark are improved, and the method is beneficial to meeting the requirements of rapid service development and functional exploration under different scenes.
In addition, when the rendering virtual machine applies the watermark template, the rendering virtual machine goes deep into the image texture of the field image data acquired by the camera unit to superimpose the watermark texture, in fact, a corresponding watermark image is generated in the texture space of the preview image generated by the camera unit, and the watermark generation process is transferred to the GPU for execution, so that the watermark corresponding to the watermark template is actually directly fused into the bottom data of the camera unit, the effect obtained from the watermark image is achieved, the corresponding watermark image is not needed to be realized depending on the image layer provided by the development framework of the image application software, the association between the watermark rendering business logic and the business logic of the image application software in terms of development language is decoupled, and the technical advantages obtained by the technical architecture are enhanced.
On the basis of any embodiment of the present application, referring to fig. 8, after converting, in a first texture space, a target watermark into a watermark texture in a first image texture, rendering the first image texture into a graphical user interface to present a watermark-containing image, including:
step S2210, obtaining a watermark resource packet of a target watermark;
the watermark resource package of the target watermark can be called from the local or can be stored in the local for recall after being pushed actively by the server, and an exemplary process for calling the watermark resource package is given below for reference, and the process comprises the following steps:
First, in response to a watermark selection instruction, determining a candidate watermark template selected by a user from a watermark template list as a watermark template of a target watermark:
in the lower watermark template list shown in fig. 2, when a user selects a target watermark from the watermark template list, clicking on the preview of the corresponding candidate watermark template, thereby triggering a corresponding watermark selection instruction. And the background process responds to the watermark selection instruction and takes the candidate watermark template selected by the user as the watermark template of the target watermark of the application.
Secondly, judging whether a watermark resource packet of a watermark template of the target watermark is stored locally or not, and if not, downloading the watermark resource packet from a server:
the watermark resource package of the watermark template may be stored in a storage space local to the terminal device, for example, in a memory or a flash memory thereof, and cached. The watermark resource package of the historically used watermark template can be loaded from a local storage space when multiplexing is performed subsequently. In this case, when the user desires to apply a watermark template, it may detect the local storage condition, determine whether the corresponding watermark resource packet has been stored in the local storage space, and if so, call the corresponding watermark resource packet from the local, otherwise, download the corresponding watermark resource packet from the server.
In one embodiment, the watermark resource package may be related to the upgrade mechanism of the rendering virtual machine by referring to its version number, and then the version number is submitted to the server to query whether there is an updated version, and when the updated version is stored, the watermark resource package of the latest version is still downloaded to the server for replacement even if the watermark resource package of the old version is stored locally.
Finally, analyzing the watermark resource package stored locally, and extracting executable script, data configuration information and layout configuration information written in a script language:
the watermark resource package downloaded from the server is stored locally, and meanwhile, the pre-packaged watermark resource package can be reversely unpacked, for example, the watermark resource package formed by compression is unpacked correspondingly; and correspondingly decrypting and decompressing the watermark resource package formed by encryption and compression. Thus, the watermark resource package is reversely analyzed, and the files such as the executable script, the data configuration information, the layout configuration information and the like which are extracted from the watermark resource package are released.
According to the above process, the watermark resource package realizes the encapsulation of the watermark template, so that the watermark template forms an independent object, can be displayed, called, upgraded and the like, and forms a cross-platform watermark rendering execution system when being matched with the rendering virtual machine, based on the system, the method can provide abundant watermark template application selection for the watermark rendering service in the multi-terminal equipment more flexibly and efficiently, and realizes the updating maintenance of massive watermark templates in the background.
Step S2220, analyzing the watermark resource package, extracting executable script, data configuration information and layout configuration information which can be executed across platforms;
as described above, the watermark template compiles the description of the target watermark into an executable script, defines each data item in the watermark information of the target watermark as data configuration information, defines the display style of the target watermark as layout configuration information, encapsulates the watermark resource package corresponding to the watermark template, and when the watermark resource package reaches the local terminal device, analyzes and decompresses the watermark resource package as required, the executable script, the data configuration information and the layout configuration information can be extracted and stored in the local terminal device, and when the rendering virtual machine needs to apply a corresponding watermark template, the corresponding executable script, the data configuration information and the layout configuration information can be directly invoked according to the unique identifier of the watermark template.
Step S2230, running the executable script in the rendering virtual machine to generate a watermark description tree encapsulating the watermark information according to the data configuration information, and generating a watermark layout for formatting a display style of the watermark information according to the layout configuration information, where the watermark information includes shooting site information determined by shooting attribute information of the camera unit;
The executable script in the watermark template is written in a script language and can be analyzed and executed, so that the rendering virtual machine can correspondingly execute each instruction by analyzing each instruction of the executable script, thereby realizing the operation of the executable script.
Business logic executed by the executable script after running in the rendering virtual machine is responsible for analyzing the corresponding data configuration information and layout configuration information of the application to apply, for example, corresponding data items in the data configuration information acquire corresponding data sources so as to construct watermark information; and acquiring corresponding resources or drawing corresponding patterns and the like according to the layout configuration information so as to construct a watermark layout, thereby describing the display style of the target watermark, constructing the watermark layout and the like.
The executable script can describe watermark information in the form of a tree structure in service logic represented by the execution process of the executable script, so that a corresponding watermark description tree is formed, the watermark information is described based on the tree structure, and the method has higher efficient information index and calling efficiency.
The watermark information generated according to the watermark template may generally include field information corresponding to the field environment in which the camera unit is located, and in one embodiment, shooting attribute information of the camera unit is used to determine shooting field information, where the shooting field information includes, but is not limited to, any one or more of shooting location information, shooting time information, decibels of ambient sound when shooting, unique identification of a terminal device, and the like. The watermark information comprises the current shooting site information, so that consistency check is conveniently carried out on the site image attached to the watermark image.
Step S2240, generating watermark textures according to the watermark description tree and the watermark layout in the first texture space, superposing the watermark textures on the first image textures, and correspondingly rendering the first image textures into a graphical user interface to display the watermark-containing image.
Under the action of the executable script, the rendering virtual machine transmits the generated watermark description tree and watermark layout to one or more rendering interfaces of an open graphic library at the bottom layer of the system, so that the rendering interfaces generate watermark textures of target watermarks in a first texture space used for generating preview data by the image capturing unit, specifically, each rendering interface is responsible for drawing corresponding watermark textures in a first image texture of field image data of the image capturing unit according to each data item in the watermark description tree and various information in the watermark layout, and the watermark textures are overlaid on the image textures so as to be rendered into the graphic user interface to display a watermark-containing image which becomes a preview image due to being displayed in the graphic user interface.
According to the embodiment, the application of the watermark template can be realized through the analysis execution of various files in the watermark resource package, the watermark texture is generated by calling the open graphic interface of the bottom layer of the system by utilizing the data configuration information and the layout configuration information in the watermark template, wherein the watermark texture is realized by calling the rendering interface of the open graphic library, so that the drawing process of the watermark image is transferred from the CPU to the GPU for execution, the view layer control of the development language of image application software is not needed, the cross-platform application of the watermark template is effective, and the target watermark described by the watermark template is obtained as the target watermark is directly drawn into the preview image of the camera unit, the imaging quality is good, the synthesis is more accurate, and the information change of the data source of the watermark information can be rapidly reflected.
On the basis of any embodiment of the present application, referring to fig. 9, generating watermark textures according to the watermark description tree and the watermark layout in a first texture space, overlaying the watermark textures on a first image texture, and rendering the first image texture into a graphical user interface correspondingly, so as to display a watermark-containing image, including:
step S2241, a rendering interface provided by OpenGL is called, and the watermark description tree and the watermark layout are transmitted to the rendering interface;
since the intrinsic business logic of the camera unit is implemented by using an open graphics library, namely OpenGL, in order to directly generate watermark textures in the first texture image of the camera unit, a rendering interface provided by OpenGL needs to be called, and a watermark description tree and a watermark layout generated after applying watermark resource packages are transmitted to the rendering interface.
Step S2242, the rendering interface is executed in the GPU to draw watermark textures in a first texture space according to the watermark layout and the watermark description tree;
the rendering interface is operated in the GPU, so that when the rendering interface is called, the rendering interface is executed in the GPU, and therefore, according to the scheduling of the rendering virtual machine, corresponding drawing can be carried out on watermark textures of the target watermark in the first texture space according to the watermark layout and the watermark description tree.
Step S2243, superimposing, by the rendering interface, the watermark texture into the first image texture in accordance with a given position provided in the watermark layout to generate the watermark image;
in rendering the watermark texture by the rendering interface, location information of the occurrence of the watermark texture in the first image texture is typically already provided in the watermark layout, and based on a given location provided by this location information, the rendering interface may superimpose the watermark texture onto the corresponding location of the first image texture, thereby generating a watermark-containing image at the corresponding location.
Step S2244, the watermark-containing image is displayed in a graphical user interface.
After the watermark texture and the first image texture are drawn, the watermark texture and the first image texture are displayed in a graphical user interface of the terminal equipment, so that the watermark image can be displayed, wherein the corresponding watermark image is also displayed, and watermark information in the watermark image is displayed.
According to the embodiment, the process of rendering the watermark image is realized in the GPU by using the rendering interface, the rendering and rendering efficiency is higher, the watermark image can be directly generated in the preview image of the camera unit, and the watermark image is not dependent on related view controls provided by the native language adopted by the image application software, so that the redesigned technical architecture of the watermark image is realized.
On the basis of any embodiment of the present application, referring to fig. 10, the rendering interface is executed in the GPU to draw watermark textures in a first texture space according to the watermark layout and the watermark description tree, including:
step S4210, generating layout textures in watermark textures of the target watermark according to the pattern specified by the watermark layout by a first rendering interface in the rendering interfaces;
one of the rendering interfaces called by the rendering virtual machine, which may be called a first rendering interface, may be called a user drawing a layout texture of the watermark textures. After obtaining the watermark layout, the first rendering interface constructs a corresponding view layer according to drawing information about the display style in the watermark layout, and then generates a corresponding layout texture in the view layer. The layout textures are generated based on a View architecture describing the watermark layout of the present application, where the View architecture is not a native View architecture in the development language of the image application software, but is implemented at the bottom layer of the present application. In an exemplary implementation scenario, a nano-vg may be used as a rendering engine, a FreeType may be used as a font engine, a Yoga library may be used as a layout engine, and based on these several engines, functions such as Canvas drawing API, view Tree, image loading and displaying, font management, font measurement, and font capability enhancement are implemented at an upper layer, and basically, a View system similar to the native one used by the image application software is implemented.
Step S4220, generating information texture in the watermark texture in the layout texture by a second rendering interface in the rendering interfaces according to the watermark description tree to represent watermark information encapsulated by the watermark description tree;
when the rendering virtual machine needs to render the watermark information in the watermark description tree, since the watermark information is mainly presented in the form of characters, a rendering interface provided by a font engine can be adopted as a second rendering interface, and the second rendering interface further generates information textures in the watermark textures in the layout textures according to the watermark description tree provided by the rendering virtual machine, and the information textures are usually displayed as characters to provide corresponding watermark information, so that the imaging rendering processing of the watermark information encapsulated by the watermark description tree is realized.
Step S4230, generating, by a third one of the rendering interfaces, a pattern texture of the watermark textures according to the pattern specified in the watermark layout.
When the display pattern of the watermark layout contains a pattern, a third rendering interface is also pre-packaged and is responsible for calling the pattern, and the pattern is overlaid and rendered on the layout texture according to the designated position in the watermark layout so as to form the pattern texture in the watermark texture.
According to the embodiment, the rendering process of the watermark textures corresponding to the target watermark can refine each other through a plurality of specific rendering interfaces, the specific rendering interfaces render the watermark textures of the target watermark in the texture space of the camera unit according to the watermark layout and the watermark description tree in a classified manner so as to be displayed in the graphic user interface, and due to the fact that the different rendering interfaces have different labor division, when the target watermark needs to be finely tuned, the corresponding call is minimized, and the editing efficiency of the target watermark can be improved.
Referring to fig. 11, after rendering a first image texture into a graphical user interface to render a watermark-containing image, according to any embodiment of the present application, the method includes:
step S3100, responding to a watermark information editing instruction, popping up a watermark information editing interface, and displaying the watermark information encapsulated by the watermark description tree in the watermark information editing interface for editing by a user;
as described above, after the terminal device renders and displays the first image texture including the watermark texture on the gui, a watermark-containing image may be presented in the gui, where the watermark-containing image is obtained by superimposing the watermark image corresponding to the target watermark on the basis of the preview image captured by the image capturing unit, and watermark information of the target watermark is displayed in the watermark image, where the watermark information generally includes field information describing attribute information of the capturing environment.
The requirement of higher frequency is that the user needs to modify watermark information in the watermark-containing image, in theory, the user can technically edit each specific watermark information in the watermark-containing image, but the technical complexity of the realization is higher, so the embodiment forms another path, and provides a watermark information editing interface for the user to intensively edit the watermark information.
Specifically, the watermark image area in the watermark-containing image may be set as an entry of the watermark information editing interface, or the entry may be set at another position of the graphical user interface, so that when the user touches the entry, a watermark information editing instruction is triggered, and in response to the watermark information editing instruction, the watermark information editing interface is popped up.
Fig. 12 is an exemplary watermark information editing interface, in which data items corresponding to respective specific watermark information defined by a watermark template of a target watermark are displayed, and the specific watermark information is described in data configuration information in a watermark resource package of the watermark template and has been converted into a watermark description tree, so that each data item can be directly read from the watermark description tree, and loaded and displayed in the watermark information editing interface, for example, "time", "position" in fig. 12 respectively correspond to two field information, i.e., shooting time information and shooting position information.
The user can input the data expected by himself in the watermark information editing interface corresponding to each data item, and then save the submitted data so as to apply the new data. Of course, the individual data items are allowed to be preset as non-editable items to limit the user to modifying the key information at will, for example, the user may be restricted to edit two data items of "time", "position" in the graphical user interface shown in fig. 12, and only be allowed to edit two custom data items of "author", "remark".
Step S3200, responding to a submitting instruction acting on the watermark information editing interface, and updating corresponding data in the watermark description tree by corresponding data determined by user editing;
when the user stores the recorded data in the watermark information editing interface, the user triggers a submitting instruction, and the corresponding background process/thread, such as the watermark access engine or the rendering virtual machine, can edit the determined corresponding data by the user and update the corresponding data in the watermark description tree, thereby realizing the function of modifying the watermark information by the user.
And step S3300, refreshing watermark information in the watermark-containing image by using the watermark description tree.
When the data in the watermark description tree is updated by a user, the watermark description tree can be retransmitted to the corresponding rendering interface through the rendering virtual machine, and the corresponding rendering interface is driven to redraw textures with the data in the new watermark description tree, so that the data which are just recorded by the user are displayed in the watermark information in the generated watermark-containing image.
According to the embodiment, the method and the device are suitable for the mode of directly drawing the watermark texture based on the system bottom layer, and can enable the user to edit the watermark information of the target watermark more intensively by providing an independent watermark information editing interface for the user, so that the editing process is more efficient and quick, and the efficiency of editing the watermark information by the user can be ensured.
On the basis of any embodiment of the present application, referring to fig. 13, after rendering a first image texture into a graphical user interface to present a watermark-containing image, the method includes:
step S5100, responding to a dragging event acting on a watermark information area on the watermark image, and entering a watermark repositioning mode;
the watermark image in the watermark-containing image has a visual effect, but it is usually positioned at a default given position reflected in the watermark layout at the time of initialization application, in which case if the user wishes to modify the display position of the watermark image in the entire watermark image by directly acting on the watermark image, a corresponding technical support needs to be provided.
For this purpose, it is allowed to respond to the user operating the watermark information area on the watermark-containing image, that is, the dragging event corresponding to the watermark image, when the user starts to drag the watermark image in the watermark-containing image, the dragging event is triggered, and the watermark access engine or the rendering virtual machine may be responsible for responding to the dragging event to switch to the watermark relocation mode.
Step S5200, responding to a release event corresponding to the dragging event, and acquiring release position information corresponding to the release event;
in the repositioning mode, a release event corresponding to the drag event is continuously monitored, and when a user drags the watermark information area to a certain position of the watermark-containing image and releases the drag, the release event is triggered. In response to the release event, release location information corresponding to the location may be obtained. The position information may be represented as coordinate information of a view layer of a watermark texture corresponding to the watermark information, depending on a preset format for the position information in a watermark layout for carrying the release position information.
And step S5300, using the release position information as a given position, updating the watermark layout, and refreshing the display position of the watermark texture in the watermark-containing image according to the watermark layout.
In order to adjust the display position of the watermark image in the watermark-containing image, the position of the watermark texture relative to the first image texture needs to be readjusted, therefore, the release position information can be used as a given position, corresponding position data in the watermark layout is updated, namely, the given position in the watermark layout is updated, when the rendering virtual machine receives the updated watermark layout, the watermark texture is drawn according to the new watermark layout, and the drawn watermark texture appears at the release position appointed by a user according to the new given position set in the watermark layout, so that the repositioning of the watermark image in the watermark-containing image is completed.
According to the above process, although the watermark image in the watermark image is generated through the open graphic library, through the technical support of the bottom layer, the watermark layout is correspondingly updated through identifying and responding to the dragging event and the releasing event of the user, and the rendering virtual machine is controlled again to generate new watermark textures according to the new watermark layout, so that the repositioning of the watermark information area in the watermark image by the user can be realized, and the user can realize the instant adjustment of the appearance position of the watermark image on the watermark image.
On the basis of any embodiment of the present application, referring to fig. 14, in response to an image export instruction, synthesizing, in a second texture space, a watermark texture of the target watermark into a second image texture of the live image data, and exporting the watermark texture as a live image file, including:
step S2310, responding to an image export instruction, and generating a second image texture of the live image data in a second texture space;
the image export instructions may be triggered by providing corresponding operational controls in the graphical user interface, or in any other feasible manner. When a user triggers an image export instruction, a rendering virtual machine calls a corresponding interface provided by an open graphic library to create a second texture space, and then second image textures of the field image data are generated in the second texture space according to preset scale information according to field image data obtained by real-time shooting of the shooting unit. It will be appreciated that the second image texture is consistent with the first image texture in image content, but the second image texture may be greater in resolution than the first image texture.
Step S2320, corresponding watermark textures are generated in a second texture space according to the watermark description tree and the watermark layout of the target watermark;
in order to generate the same image as the watermark image being displayed on the second image texture, it is necessary to superimpose the watermark texture on which the target watermark is drawn on the basis of the second image texture corresponding to the live image data. The method of drawing the watermark texture of the target watermark on the second image texture can be completely the same as the method of drawing the watermark texture of the target watermark on the first image texture, and the rendering virtual machine can use the watermark description tree and the watermark layout of the target watermark to call the corresponding rendering interface provided by the open graphic library to realize the drawing, so that the description is omitted.
It should be noted that, since the watermark texture generated in the second texture space and the watermark texture generated in the first texture space are both based on the same watermark description tree and watermark layout that are the same as the same target watermark, the live image file finally derived in the second texture space and the watermark image rendered and displayed in the first texture space are identical in image content, that is, when the user derives the live image from the watermark image, the live image is identical in image content to the watermark image, but the derived live image has higher image quality than the watermark image.
Step S2330, generating anti-counterfeiting codes of watermark information packaged by the watermark description tree by applying a preset abstract algorithm, and converting the anti-counterfeiting codes into anti-counterfeiting textures in a second texture space;
an anti-counterfeiting texture can be added into the image data of the field image file, the anti-counterfeiting texture can be generated into corresponding anti-counterfeiting codes by applying a preset abstract algorithm according to the watermark information, particularly the field information, and then the anti-counterfeiting codes are imaged and synthesized into the image data, so that the image data in the field image file obtained by the method comprises watermark images and anti-counterfeiting signatures.
The summary algorithm, i.e. the information summary algorithm, belongs to a cryptographic hash function, and can acquire corresponding data according to the entry condition, wherein the data are usually field information which is already packaged by a watermark description tree, such as shooting time information, shooting position information and the like, and then generate a hash value with a specific word length, and the hash value is uniquely corresponding to the data of the entry condition, so that when one data of the entry condition is changed, different hash values are necessarily output, and accordingly, whether the corresponding data are consistent can be identified through the hash value. It will be appreciated that this hash value may be used as anti-counterfeit code. The bit number of the hash value may be 128-bit, 256-bit, 512-bit binary data, or may be converted into hexadecimal data when formatted into the anti-pseudo code, thereby compressing the character length of the anti-pseudo code.
In one embodiment, the anti-counterfeiting code may be generated as follows, including:
firstly, extracting shooting time information and shooting position information belonging to field information and resolution information of a second image texture in a second texture space from the watermark description tree according to the parameter entering condition of the summarization algorithm: the digest algorithm constrains the entry condition to obtain corresponding entry data, and then applies a hash function to the entry data to calculate a hash value having uniqueness as an anti-counterfeiting code. In one embodiment, the entry condition may be constrained to include scene information in the watermark information and resolution information of the corresponding second image texture, such as shooting time information and shooting position information therein, and resolution information of the abscissa and ordinate of the second image texture.
Then, the abstract algorithm is applied, and anti-fake codes are generated according to the shooting time information, the shooting position information and the resolution information: when the interface corresponding to the abstract algorithm is called, the information is converted into characters and spliced into abstract text according to a preset sequence, and then a hash function is applied to calculate anti-counterfeiting codes corresponding to the abstract text.
Finally, converting the second anti-counterfeiting code into a specific character length: to improve the readability of the anti-counterfeit code, the anti-counterfeit code may be converted from a binary hash value to a hexadecimal value, thereby enabling compression to a shorter character length.
According to the above process, it can be understood that the anti-counterfeiting code is generated by using the shooting time information and the shooting position information in the field information and the resolution information of the second image texture, so that the real space-time environment when the image data are generated is considered through the field information, and the correspondence between the image data and the environmental condition when the image is shot is considered through the association of the resolution information and the field information, and the generated anti-counterfeiting code plays a role in effectively providing a schema for the field image file and can be used for comprehensively and effectively verifying the association and the integrity between the internal data of the field image file finally generated.
Step S2340, the watermark texture and the anti-counterfeiting texture of the target watermark are synthesized into the second image texture in the second texture space, the synthesized image data is generated, and the synthesized image data is output as a live image file.
In the second texture space, the watermark texture, the anti-counterfeiting texture and the second image texture of the target watermark are synthesized to generate synthesized image data, so that the synthesized image data can be one or more frames of synthesized image data respectively according to different requirements of a user derived picture or video, and then the synthesized image data are correspondingly derived into a live picture file or a live video file, so that a live image file is obtained.
When a user derives a field picture file, corresponding metadata information can be generated for image data of the field picture file according to Exif format requirements, and various field information and resolution information for generating anti-counterfeiting codes can be recorded in the metadata information as required. Similarly, when the multi-frame composite image data is encoded into a live image file, the above live information and resolution information may also be stored as supplemental enhancement information (SEI, supplemental Enhancement Information) therein. By attaching metadata information or supplemental enhancement information to the live image file, it is possible to append the pieces of information plaintext required for generating the anti-counterfeit code for verification.
In one embodiment, a step may be added to submit the generated field image file to a server for verification, the server analyzes the field image file, extracts each item of field information and resolution information required for generating an anti-counterfeiting code from metadata information, supplementary enhancement information and watermark images, calculates an anti-counterfeiting code according to the same abstract algorithm, and compares the anti-counterfeiting code with the anti-counterfeiting code in the anti-counterfeiting signature in the field image, when the two are consistent, the watermark information in the field image is confirmed to be consistent, so that the authenticity of each item of field information recorded in the watermark information is confirmed, the authenticity verification of the field image file is realized, and further a true verification report can be output as required, or a preset downstream business process is started.
According to the embodiment, the watermark textures are synthesized in the second texture space to be derived into the field image file, and the anti-counterfeiting signature containing the anti-counterfeiting code is generated in the corresponding image data to finish the anti-counterfeiting processing of the field image file, so that not only can the high-definition and high-quality image be obtained, but also the real effectiveness of the image data can be ensured, and particularly, because the watermark information contains the field information, whether the field image file is shot in a specific space-time environment can be verified, so that the field image file can be used for storing and checking the attendance, the effect of the field image file is enriched, and the application scene of the field image file is expanded.
Referring to fig. 15, an image watermark synthesis apparatus provided according to an aspect of the present application includes a camera conversion module 2100, a watermark rendering module 2200, and a watermark synthesis module 2300, where the camera conversion module 2100 is configured to call a camera unit to obtain live image data, and convert the live image data into a first image texture in a first texture space; the watermark rendering module 2200 is configured to render the first image texture into the graphical user interface to present a watermark-containing image after converting the target watermark into the watermark texture in the first image texture in the first texture space, where watermark information of the target watermark is presented in the watermark-containing image; the watermark synthesis module 2300 is configured to synthesize, in response to an image export instruction, a watermark texture of the target watermark into a second image texture of the live image data in a second texture space, and export the watermark texture as a live image file.
On the basis of any embodiment of the present application, the watermark rendering module 2200 includes: the resource acquisition sub-module is used for acquiring a watermark resource packet of the target watermark; the resource analysis sub-module is used for analyzing the watermark resource package and extracting executable scripts, data configuration information and layout configuration information which can be executed in a cross-platform mode; a script running sub-module configured to run the executable script in a rendering virtual machine, to generate a watermark description tree that encapsulates the watermark information according to the data configuration information, and to generate a watermark layout that formats a display style of the watermark information according to the layout configuration information, the watermark information including shooting scene information determined by shooting attribute information of the camera unit; and the rendering and displaying sub-module is arranged to generate watermark textures according to the watermark description tree and the watermark layout in a first texture space, superimpose the watermark textures on the first image textures, correspondingly render the first image textures into a graphical user interface, and display a watermark-containing image.
On the basis of any embodiment of the present application, the rendering display sub-module includes: an interface calling unit, configured to call a rendering interface provided by OpenGL, and transmit the watermark description tree and the watermark layout to the rendering interface; a texture drawing unit configured to be executed in the GPU by the rendering interface to draw a watermark texture in a first texture space according to the watermark layout and the watermark description tree; a texture superimposing unit arranged to superimpose the watermark texture into the first image texture by the rendering interface in accordance with a given position provided in the watermark layout to generate the watermark image; and an image display unit configured to display the watermark-containing image into a graphical user interface.
On the basis of any embodiment of the present application, the texture drawing unit includes: a layout drawing subunit configured to generate, by a first one of the rendering interfaces, a layout texture of the watermark textures of the target watermark according to a style specified by the watermark layout; a text drawing subunit, configured to generate, by a second rendering interface of the rendering interfaces, an information texture in the watermark texture in the layout texture according to the watermark description tree to represent watermark information encapsulated by the watermark description tree; and a pattern drawing subunit configured to generate, by a third one of the rendering interfaces, a pattern texture in the watermark texture according to the pattern specified in the watermark layout.
On the basis of any embodiment of the present application, the image watermark synthesis setting of the present application includes: the editing response module is used for responding to a watermark information editing instruction, popping up a watermark information editing interface, and displaying the watermark information encapsulated by the watermark description tree in the watermark information editing interface for editing by a user; the submitting response module is used for responding to a submitting instruction acting on the watermark information editing interface and updating the corresponding data in the watermark description tree by the corresponding data determined by user editing; and the watermark refreshing module is used for refreshing watermark information in the watermark-containing image by using the watermark description tree.
On the basis of any embodiment of the present application, the image watermark synthesis setting of the present application includes: the dragging response module is used for responding to a dragging event acting on the watermark information area on the watermark image and entering a watermark repositioning mode; the positioning determining module is used for responding to a release event corresponding to the dragging event and acquiring release position information corresponding to the release event; and the positioning adjustment module is used for taking the release position information as a given position, updating the watermark layout and refreshing the display position of the watermark texture in the watermark-containing image according to the watermark layout.
On the basis of any embodiment of the present application, the watermark synthesis module 2300 includes: a export response module configured to generate a second image texture of the live image data in a second texture space in response to an image export instruction; the texture drawing module is arranged to generate corresponding watermark textures in a second texture space according to the watermark description tree and the watermark layout of the target watermark; the anti-counterfeiting processing module is used for generating anti-counterfeiting codes of watermark information packaged by the watermark description tree by applying a preset abstract algorithm, and converting the anti-counterfeiting codes into anti-counterfeiting textures in a second texture space; and the export generation module is used for synthesizing the watermark texture and the anti-counterfeiting texture of the target watermark into a second image texture in a second texture space, generating synthesized image data and outputting the synthesized image data into a live image file.
Another embodiment of the present application further provides an image watermark synthesis apparatus. As shown in fig. 16, the internal structure of the image watermark composing apparatus is schematically shown. The image watermark composition apparatus comprises a processor, a computer readable storage medium, a memory and a network interface connected by a system bus. The computer readable non-volatile storage medium of the image watermark synthesis device stores an operating system, a database and computer readable instructions, the database can store an information sequence, and the computer readable instructions when executed by a processor can enable the processor to realize an image watermark synthesis method.
The processor of the image watermark compositing apparatus is operable to provide computing and control capabilities that support the operation of the entire image watermark compositing apparatus. The memory of the image watermark composition device may store computer readable instructions that, when executed by the processor, cause the processor to perform the image watermark composition method of the present application. The network interface of the image watermark synthesis apparatus is used for communication with a terminal connection.
It will be appreciated by persons skilled in the art that the structure shown in fig. 16 is merely a block diagram of a portion of the structure associated with the present application and does not constitute a limitation of the image watermark composition apparatus to which the present application is applied, and that a particular image watermark composition apparatus may include more or fewer components than shown in the drawings, or may combine certain components, or may have a different arrangement of components.
The processor in this embodiment is configured to perform specific functions of each module in fig. 15, and the memory stores program codes and various types of data required for executing the above-described modules or sub-modules. The network interface is used for realizing data transmission between the user terminals or the servers. The nonvolatile readable storage medium in this embodiment stores therein program codes and data necessary for executing all modules in the image watermark composing apparatus of the present application, and the server can call the program codes and data of the server to execute the functions of all modules.
The present application also provides a non-transitory readable storage medium storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the image watermark compositing method of any of the embodiments of the present application.
The present application also provides a computer program product comprising computer programs/instructions which when executed by one or more processors implement the steps of the method described in any of the embodiments of the present application.
It will be appreciated by those skilled in the art that implementing all or part of the above-described methods according to the embodiments of the present application may be accomplished by way of a computer program stored in a non-transitory readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a computer readable storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
In summary, according to the method and the device, corresponding watermark textures are generated in different texture spaces for field image data shot by the camera unit, and different requirements of watermark preview and export are matched, so that the generation of the watermark textures is performed deep into the texture space of the camera unit, watermark preview is realized, a more efficient synthesis effect is obtained, and a cross-platform watermark generation architecture based on the same watermark template is conveniently realized to improve the development efficiency of watermark generation service.

Claims (9)

1. An image watermark synthesis method, comprising:
invoking a camera unit to acquire live image data, and converting the live image data into first image textures in a first texture space;
converting the target watermark into watermark textures in a first image texture in a first texture space, and then rendering the first image texture into a graphical user interface to present a watermark-containing image, wherein watermark information of the target watermark is presented in the watermark-containing image;
synthesizing watermark textures of the target watermark into second image textures of the live image data in a second texture space in response to an image export instruction, and exporting the watermark textures into a live image file;
after the target watermark is converted into the watermark texture in the first image texture in the first texture space, rendering the first image texture into a graphical user interface to present a watermark-containing image, comprising:
Obtaining a watermark resource packet of a target watermark;
analyzing the watermark resource package, and extracting executable scripts, data configuration information and layout configuration information which can be executed in a cross-platform manner;
running the executable script in a rendering virtual machine to generate a watermark description tree encapsulating the watermark information according to the data configuration information, and generating a watermark layout formatting a display style of the watermark information according to the layout configuration information, wherein the watermark information comprises shooting site information determined by shooting attribute information of the shooting unit;
generating watermark textures according to the watermark description tree and the watermark layout in a first texture space, superposing the watermark textures on first image textures, and correspondingly rendering the first image textures into a graphical user interface to display a watermark-containing image.
2. The image watermark synthesis method according to claim 1, wherein generating watermark textures according to the watermark description tree and the watermark layout in a first texture space is superimposed on a first image texture, rendering the first image texture into a graphical user interface correspondingly, and displaying a watermark-containing image, comprising:
invoking a rendering interface provided by OpenGL, and transmitting the watermark description tree and the watermark layout to the rendering interface;
Drawing, by the rendering interface in a GPU, watermark textures in a first texture space according to the watermark layout and watermark description tree;
superimposing, by the rendering interface, the watermark texture into the first image texture in accordance with a given location provided in the watermark layout to generate the watermark-containing image;
the watermark-containing image is displayed in a graphical user interface.
3. The image watermarking method according to claim 2, wherein drawing watermark textures in a first texture space from the watermark layout and watermark description tree by execution of the rendering interface in a GPU comprises:
generating, by a first one of the rendering interfaces, a layout texture in a watermark texture of the target watermark according to a pattern specified by the watermark layout;
generating, by a second one of the rendering interfaces, an information texture in the watermark texture in the layout texture according to the watermark description tree to represent watermark information encapsulated by the watermark description tree;
and generating pattern textures in the watermark textures according to the patterns specified in the watermark layout by a third rendering interface in the rendering interfaces.
4. A method of image watermark synthesis according to any one of claims 1 to 3, wherein, after rendering the first image texture into a graphical user interface to render a watermarked image, comprising:
in response to a watermark information editing instruction, popping up a watermark information editing interface, and displaying the watermark information encapsulated by the watermark description tree in the watermark information editing interface for editing by a user;
responding to a submitting instruction acting on the watermark information editing interface, and updating corresponding data in the watermark description tree by corresponding data determined by user editing;
refreshing watermark information in the watermark-containing image by using the watermark description tree.
5. A method of image watermark synthesis according to any one of claims 1 to 3, wherein, after rendering the first image texture into a graphical user interface to render a watermarked image, comprising:
responding to a dragging event acting on a watermark information area on the watermark image, and entering a watermark repositioning mode;
responding to a release event corresponding to the dragging event, and acquiring release position information corresponding to the release event;
and updating the watermark layout by taking the release position information as a given position, and refreshing the display position of the watermark texture in the watermark-containing image according to the watermark layout.
6. A method of image watermark synthesis according to any one of claims 1 to 3, wherein synthesizing watermark textures of the target watermark into second image textures of the live image data in a second texture space in response to an image export instruction, exporting as a live image file, comprises:
generating a second image texture of the live image data in a second texture space in response to an image export instruction;
generating corresponding watermark textures in a second texture space according to the watermark description tree and the watermark layout of the target watermark;
generating anti-counterfeiting codes of watermark information packaged by the watermark description tree by applying a preset abstract algorithm, and converting the anti-counterfeiting codes into anti-counterfeiting textures in a second texture space;
and synthesizing the watermark texture and the anti-counterfeiting texture of the target watermark into a second image texture in a second texture space, generating synthesized image data, and outputting the synthesized image data into a live image file.
7. An image watermark synthesis apparatus, comprising:
the camera shooting conversion module is used for calling the camera shooting unit to acquire field image data and converting the field image data into first image textures in a first texture space;
The watermark rendering module is arranged to render the first image texture into a graphical user interface to present a watermark-containing image after converting the target watermark into the watermark texture in the first image texture in the first texture space, wherein watermark information of the target watermark is presented in the watermark-containing image;
the watermark synthesis module is used for responding to an image export instruction, synthesizing watermark textures of the target watermark into second image textures of the live image data in a second texture space, and exporting the watermark textures into a live image file;
the watermark rendering module comprises:
the resource acquisition sub-module is used for acquiring a watermark resource packet of the target watermark;
the resource analysis sub-module is used for analyzing the watermark resource package and extracting executable scripts, data configuration information and layout configuration information which can be executed in a cross-platform mode;
a script running sub-module configured to run the executable script in a rendering virtual machine, to generate a watermark description tree that encapsulates the watermark information according to the data configuration information, and to generate a watermark layout that formats a display style of the watermark information according to the layout configuration information, the watermark information including shooting scene information determined by shooting attribute information of the camera unit;
And the rendering and displaying sub-module is arranged to generate watermark textures according to the watermark description tree and the watermark layout in a first texture space, superimpose the watermark textures on the first image textures, correspondingly render the first image textures into a graphical user interface, and display a watermark-containing image.
8. An image watermark composition apparatus comprising a central processor and a memory, wherein the central processor is arranged to invoke execution of a computer program stored in the memory to perform the steps of the method according to any of claims 1 to 6.
9. A non-transitory readable storage medium, characterized in that it stores in form of computer readable instructions a computer program implemented according to the method of any one of claims 1 to 6, which when invoked by a computer, performs the steps comprised by the corresponding method.
CN202310620186.XA 2023-05-29 2023-05-29 Image watermark synthesis method and device, equipment, medium and product thereof Active CN116883223B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310620186.XA CN116883223B (en) 2023-05-29 2023-05-29 Image watermark synthesis method and device, equipment, medium and product thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310620186.XA CN116883223B (en) 2023-05-29 2023-05-29 Image watermark synthesis method and device, equipment, medium and product thereof

Publications (2)

Publication Number Publication Date
CN116883223A CN116883223A (en) 2023-10-13
CN116883223B true CN116883223B (en) 2024-04-16

Family

ID=88262748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310620186.XA Active CN116883223B (en) 2023-05-29 2023-05-29 Image watermark synthesis method and device, equipment, medium and product thereof

Country Status (1)

Country Link
CN (1) CN116883223B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959392A (en) * 2018-05-31 2018-12-07 阿里巴巴集团控股有限公司 The method, device and equipment of rich text is shown on 3D model
CN111107264A (en) * 2019-11-11 2020-05-05 宇龙计算机通信科技(深圳)有限公司 Image processing method, image processing device, storage medium and terminal
CN114245053A (en) * 2021-12-10 2022-03-25 天津洪恩完美未来教育科技有限公司 Video watermark generation method and device
CN114612279A (en) * 2020-12-03 2022-06-10 腾讯科技(深圳)有限公司 Watermark adding method and device
CN115730622A (en) * 2021-08-24 2023-03-03 华为技术有限公司 Anti-counterfeit label generation method and related equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7095418B2 (en) * 2003-10-30 2006-08-22 Sensable Technologies, Inc. Apparatus and methods for texture mapping

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959392A (en) * 2018-05-31 2018-12-07 阿里巴巴集团控股有限公司 The method, device and equipment of rich text is shown on 3D model
CN111107264A (en) * 2019-11-11 2020-05-05 宇龙计算机通信科技(深圳)有限公司 Image processing method, image processing device, storage medium and terminal
CN114612279A (en) * 2020-12-03 2022-06-10 腾讯科技(深圳)有限公司 Watermark adding method and device
CN115730622A (en) * 2021-08-24 2023-03-03 华为技术有限公司 Anti-counterfeit label generation method and related equipment
CN114245053A (en) * 2021-12-10 2022-03-25 天津洪恩完美未来教育科技有限公司 Video watermark generation method and device

Also Published As

Publication number Publication date
CN116883223A (en) 2023-10-13

Similar Documents

Publication Publication Date Title
CN105765990B (en) Method, system and computer medium for distributing video content over a distributed network
CN113891113B (en) Video clip synthesis method and electronic equipment
US20220007083A1 (en) Method and stream-pushing client for processing live stream in webrtc
US20080209311A1 (en) On-line digital image editing with wysiwyg transparency
US8402168B1 (en) File processing to accelerate image viewer initialization
MXPA05009939A (en) Apparatus and method for manipulating images.
CN113282360A (en) Rendering method and device for 2D canvas webpage elements and electronic equipment
CN112804459A (en) Image display method and device based on virtual camera, storage medium and electronic equipment
JP2005108230A (en) Printing system with embedded audio/video content recognition and processing function
CN111507352B (en) Image processing method and device, computer equipment and storage medium
KR20150037493A (en) Software development kit for capturing graphical image data
WO2020030958A1 (en) Method for adding watermark, device, apparatus/terminal/server, and storage medium
CN114979753A (en) Screen recording method, device, equipment and medium
CN116883223B (en) Image watermark synthesis method and device, equipment, medium and product thereof
CN112804460A (en) Image processing method and device based on virtual camera, storage medium and electronic equipment
KR101155564B1 (en) System for cooperative digital image production
CN116630128A (en) Image watermark rendering method and device, equipment, medium and product thereof
CN109862295A (en) GIF generation method, device, computer equipment and storage medium
CN113315982B (en) Live broadcast method, computer storage medium and equipment
KR20230016266A (en) Method and System of Making and Showing Video Name Card Using Web AR Technique
CN113438549A (en) Processing method and device for adding watermark to video
CN112256381A (en) Language resource processing method and device, computer equipment and storage medium
KR101837963B1 (en) System, method and program for protecting copying webtoon
CN116843547A (en) Jigsaw construction method and device, equipment, medium and product thereof
CN116684747A (en) Image filter application method and device, equipment, medium and product thereof

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
GR01 Patent grant