Picture watermark removing method, system and equipment for tourism scene and storage medium
With the assistance of the deep learning model, fully automated detection, classification, removal and post-processing of watermarks in tourism scene pictures is achieved, solving the problem of poor watermark removal efficiency and effect in the existing technology, and achieving efficient and accurate watermark removal effect.
Patent Information
- Application Number
- CN202411960930.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art is difficult to effectively remove multiple watermarks and watermarks of unknown styles or locations, and the existing algorithms are prone to tampering with non-watermark areas during the removal process, and the efficiency and effect are not good.
The deep learning model is adopted to achieve accurate identification and removal of watermarks through a fully automated process of watermark detection, classification, removal and post-processing. The specific steps include collecting and filtering image data, generating a watermark image collection, training a generative deep learning model, performing watermark detection and classification, defining the area to be redrawn, generating a watermark mask, and inputting the model for redrawing and removal.
It significantly improves the efficiency and effect of watermark removal, reduces labor costs, and realizes efficient processing of multiple watermarks and unknown styles or location watermarks.
Smart Images

Figure CN119887826A_ABST
Abstract
Description
Background Art
[0002] Online travel (OTA) is a professional term in the tourism e-commerce industry. It refers to "tourism consumers booking travel products or services from travel service providers through the Internet and paying online or offline, that is, various tourism entities can conduct product marketing or product sales through the Internet."
[0003] Images can ensure the intuitive representation and communication of information. Therefore, in the large-scale dissemination and application of the Internet environment, the appropriate display of images can greatly improve the user experience. Since images usually come from complex sources, large quantities of images pushed from different sources often contain some watermarked images. Direct display affects users' browsing of images and may even cause legal issues of infringement.
[0004] On OTA websites, we often encounter a large number of travel pictures with watermarks. Therefore, removing watermarks is a common requirement. Currently, there are two common methods for watermark removal. The first method is to use image processing tools to interactively smear the pixels in the watermark area to manually remove the watermark. This method requires processing the watermarked pictures one by one, which is slow and inefficient. The second method of removing watermarks is used when there are a large number of pictures containing watermarks. This method can be uniformly removed through algorithms. However, the current use of algorithms for watermark removal usually directly inputs the watermark image into the algorithm model to output a watermark-free picture, while the watermark usually only occupies a small local area of the image. Direct input into the model will cause the image in the non-watermark area to be tampered with. In addition, the existing watermark removal algorithm uses a large number of pictures with the same watermark to estimate the position and transparency of the watermark, which can only handle a single known watermark, but cannot handle multiple watermarks and watermarks of unknown style or position.
[0005] Therefore, the present invention provides a method, system, device and storage medium for removing watermarks from pictures of tourist scenes. Summary of the invention
[0006] In response to the problems in the prior art, the purpose of the present invention is to provide a method, system, device and storage medium for removing watermarks from pictures of tourist scenes, which overcomes the difficulties of the prior art and can achieve full automation of watermark detection, classification, removal and post-processing with the assistance of a deep learning model, thereby significantly improving the efficiency and effect of watermark removal and reducing labor costs.
[0007] The embodiment of the present invention provides a method for removing watermarks from pictures of tourist scenes, comprising the following steps:
[0008] S110, collecting hotel and tourism related images and watermark information, randomly adding the watermark information to the filtered images to generate a watermark image set, and training a generative deep learning model according to the watermark image set;
[0009] S120, performing watermark detection and image classification on the target image to be watermarked, defining the area to be redrawn, and then performing saliency segmentation to obtain the watermark part in the image to generate a watermark mask, inputting the area to be redrawn and the watermark mask into a trained generative deep learning model to obtain a redrawn image, and overlaying the redrawn image on the redrawn area of the target image.
[0010] Preferably, the step S110 includes:
[0011] S111, collecting hotel and tourism related images to establish an image collection, and using a model to score the quality of the images to filter out images with lower quality;
[0012] S112, collecting watermark information and adding a category label to each of the watermark information, the watermark information includes a watermark pattern, and the category label includes at least an oblique version watermark and a pattern watermark;
[0013] S113, randomly superimposing the watermark pattern onto the filtered image to generate a first watermark image set;
[0014] S114. Training a generative deep learning model based on the first watermark image set.
[0015] Preferably, in step S112, the watermark information includes a watermark pattern and a watermark mask;
[0016] The step S113 is replaced by randomly superimposing the watermark pattern on the filtered image to generate a first watermark image set, and randomly applying the watermark mask to the filtered image to generate a second watermark image set;
[0017] The step S114 is replaced by training a generative deep learning model based on the first watermark image set and the second watermark image set.
[0018] Preferably, the step S120 includes:
[0019] S121, performing watermark detection and image classification on the target image to be watermarked;
[0020] S122, detecting the type of watermark and defining the area to be redrawn;
[0021] S123, performing region expansion based on the to-be-redrawn region, and then performing saliency segmentation to obtain a watermark portion in the image to generate a watermark mask;
[0022] S124, inputting the area to be redrawn and the watermark mask into a trained generative deep learning model to obtain a redrawn image;
[0023] S125, performing post-check on the redrawn image;
[0024] S126. Input the redrawn image and the result of the post-verification into the generative deep learning model to obtain the target image after the watermark is removed.
[0025] Preferably, in step S121, watermark detection and image classification are performed on the target image to be watermarked, and the coordinates of the area where the watermark is located are determined.
[0026] Preferably, the step S122 includes:
[0027] S1221, detecting the type of watermark;
[0028] S1222. Define the area to be redrawn, and exclude the area to be redrawn where the area occupied by the watermark in the picture is greater than a preset threshold.
[0029] Preferably, the step S124 includes:
[0030] S1241, inputting the to-be-redrawn area and the watermark mask into a trained generative deep learning model;
[0031] S1242, to obtain the redrawn image.
[0032] The embodiment of the present invention further provides a system for removing watermarks from pictures of tourist scenes, which is used to implement the above-mentioned method for removing watermarks from pictures of tourist scenes. The system for removing watermarks from pictures of tourist scenes comprises:
[0033] A training data module collects hotel and tourism related images and watermark information, randomly adds the watermark information to the filtered images to generate a watermark image set, and trains a generative deep learning model based on the watermark image set;
[0034] The watermark removal module performs watermark detection and image classification on the target image to be watermarked, defines the area to be redrawn, and then performs saliency segmentation to obtain the watermark part in the image to generate a watermark mask. The area to be redrawn and the watermark mask are input into the trained generative deep learning model to obtain the redrawn image, and the redrawn image is overlaid on the redrawn area of the target image.
[0035] The embodiment of the present invention also provides a device for removing watermarks from pictures of tourist scenes, including:
[0036] processor;
[0037] a memory storing executable instructions of the processor;
[0038] Wherein, the processor is configured to execute the steps of the above-mentioned method for removing watermarks from pictures of tourist scenes by executing the executable instructions.
[0039] An embodiment of the present invention further provides a computer-readable storage medium for storing a program, which, when executed, implements the steps of the above-mentioned method for removing watermarks from pictures of tourist scenes.
[0040] The purpose of the present invention is to provide a method, system, device and storage medium for removing watermarks from pictures of tourist scenes, which can realize full automation of watermark detection, classification, removal and post-processing with the assistance of a deep learning model, significantly improve the efficiency and effect of watermark removal, and reduce labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Other features, objectives and advantages of the present invention will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following accompanying drawings.
[0042] Figure 1 It is a flow chart of the method for removing watermarks from pictures of tourist scenes of the present invention.
[0043] Figure 2 It is a schematic diagram of the implementation process of the method for removing watermarks from pictures of tourist scenes of the present invention.
[0044] Figure 3 It is a structural schematic diagram of the tourist scene picture watermark removal system of the present invention.
[0045] Figure 4 It is a structural schematic diagram of a device for removing watermarks from pictures of tourism scenes according to the present invention.
[0046] Figure 5 It is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following describes the implementation methods of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in the present application. The present application can also be implemented or applied through other different specific implementation methods, and the details in the present application can also be modified or changed in various ways according to different viewpoints and application systems without departing from the spirit of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0048] The following is a detailed description of the embodiments of the present application with reference to the accompanying drawings so that those skilled in the art can easily implement the present application. The present application can be embodied in a variety of different forms and is not limited to the embodiments described herein.
[0049] In the representations of the present application, the representations with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" etc. mean that the specific features, structures, materials or characteristics represented in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the represented specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples represented in the present application and the features of the different embodiments or examples, unless they contradict each other.
[0050] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the representation of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0051] In order to clearly describe the present application, components irrelevant to the description are omitted, and the same reference symbols are given to the same or similar components throughout the specification.
[0052] Throughout the specification, when a device is said to be "connected" to another device, this includes not only the case of "direct connection" but also the case of "indirect connection" by placing other elements therebetween. In addition, when a device is said to "include" a certain component, unless otherwise stated, it does not exclude other components, but means that other components may be included.
[0053] When a device is said to be "on" another device, it may be directly on the other device, but there may also be other devices between it. In contrast, when a device is said to be "directly" on another device, there are no other devices between it.
[0054] Although the terms first, second, etc. are used to represent various elements in some examples, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, the first interface and the second interface, etc. are represented. Moreover, as used in this article, the singular forms "one", "one" and "the" are intended to also include plural forms, unless there is an opposite indication in the context. It should be further understood that the terms "comprising" and "including" indicate the existence of features, steps, operations, elements, components, projects, kinds, and / or groups, but do not exclude the existence, occurrence or addition of one or more other features, steps, operations, elements, components, projects, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Therefore, "A, B or C" or "A, B and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B and C". Only when the combination of elements, functions, steps or operations is inherently mutually exclusive in some way, will there be an exception to this definition.
[0055] The technical terms used herein are only used to refer to specific embodiments and are not intended to limit the present application. The singular form used herein also includes the plural form unless the sentence clearly indicates the contrary meaning. The meaning of "including" used in the specification is to specify specific characteristics, regions, integers, steps, operations, elements and / or components, and does not exclude the existence or addition of other characteristics, regions, integers, steps, operations, elements and / or components.
[0056] Although not defined differently, all terms, including technical and scientific terms used herein, have the same meaning as those generally understood by those skilled in the art to which this application belongs. Terms defined in commonly used dictionaries are additionally interpreted as having meanings consistent with the relevant technical literature and the contents of the current disclosure, and unless defined, shall not be overly interpreted as ideal or very formal meanings.
[0057] Figure 1 Flowchart of the method for removing watermarks from pictures of tourist scenes of the present invention. Figure 1 As shown, the method for removing watermarks from pictures of tourist scenes of the present invention comprises:
[0058] S110, collecting hotel and tourism related images and watermark information, randomly adding the watermark information to the filtered images to generate a watermark image set, and training a generative deep learning model based on the watermark image set;
[0059] S120, perform watermark detection and image classification on the target image to be watermarked, define the area to be redrawn, perform saliency segmentation to obtain the watermark part in the image and generate a watermark mask, input the area to be redrawn and the watermark mask into the trained generative deep learning model, obtain the redrawn image, and cover the redrawn image on the redrawn area of the target image.
[0060] The technical problems to be solved by the present invention include:
[0061] (1) Realize accurate watermark mask extraction to ensure accurate identification of the watermark area.
[0062] (2) Build a stable redrawing process to ensure the reliability and consistency of the watermark removal process.
[0063] In the present invention, a Transformer-based model structure is used to optimize the watermark extraction scheme to improve the accuracy and efficiency of mask generation. The saliency segmentation model is selected as the basic model, and SwinTransformer is innovatively used to replace the original feature encoder part. This improvement significantly improves the accuracy of watermark detection and effectively alleviates the accuracy degradation caused by downsampling. Through this advanced model structure, the watermark area can be more accurately identified and extracted, laying a solid foundation for the subsequent watermark removal process. The present invention constructs a watermark training data set of a certain scale for in-depth training of the model, and designs and implements a stable watermark removal process to ensure the high efficiency and high stability of the watermark removal operation. Through these technical solutions, the present invention not only improves the performance of watermark removal technology, but also provides an innovative solution for the fields of image processing and content management, which has important practical application value and broad market prospects.
[0064] This paper provides an innovative visual watermark region identification and removal technology based on the Transformer architecture. This advanced method first identifies and segments the image area where the watermark is located through a precise mask generation step. Then, using a powerful generative model, these masked watermark areas are intelligently redrawn to effectively remove the watermark and restore the original state of the image. This method not only improves the accuracy of watermark removal, but also ensures the visual quality of the processed image, providing users with an efficient and reliable solution.
[0065] In a preferred embodiment, step S110 includes:
[0066] S111, collect hotel and tourism related images to establish an image collection, and use the model to score the quality of the images to filter out low-quality images;
[0067] S112, collecting watermark information and adding a category label to each watermark information, the watermark information includes a watermark pattern, and the category label includes at least an oblique version watermark and a pattern watermark;
[0068] S113, randomly superimposing the watermark pattern onto the filtered image to generate a first watermark image set;
[0069] S114: Training a generative deep learning model based on the first watermark image set, but not limited to this.
[0070] In a preferred embodiment, in step S112, the watermark information includes a watermark pattern and a watermark mask;
[0071] Step S113 is replaced by randomly superimposing the watermark pattern on the filtered image to generate a first watermark image set, and randomly applying the watermark mask to the filtered image to generate a second watermark image set;
[0072] Step S114 is replaced by training a generative deep learning model based on the first watermark image set and the second watermark image set, but is not limited thereto. In image processing, a watermark mask refers to a special image used to specify the area where the original image is operated. The mask is usually a binary image, that is, each pixel on the image has only two possible values, usually 0 and 255, representing black and white, respectively. Although binary masks are the most common, masks can also be grayscale images or multi-channel images 1. In the application of removing PDF watermarks, masking technology is used to create a mask and remove pixels within a specified color range. The specific steps include: converting a PIL image to OpenCV format. Using the cv2.inRange function to find pixels within a specified color range and create a mask. Dilation and erosion operations are performed on the mask to optimize the mask. Pixels within the mask range are set to white to remove the watermark 2. In addition, watermark masks can also be used for data protection in databases to prevent the leakage of sensitive information by covering or modifying part of the data. Masking technology can be applied to a variety of data types, including text, numbers, and dates. Static masking masks data before or after it is stored, while dynamic masking masks data when it is queried or displayed.
[0073] In a preferred embodiment, step S120 includes:
[0074] S121, performing watermark detection and image classification on the target image to be watermarked;
[0075] S122, detecting the type of watermark and defining the area to be redrawn;
[0076] S123, expanding the area based on the area to be redrawn, and then performing saliency segmentation to obtain the watermark part in the image to generate a watermark mask;
[0077] S124, inputting the area to be redrawn and the watermark mask into the trained generative deep learning model to obtain a redrawn image;
[0078] S125, performing post-check on the redrawn image;
[0079] S126. Input the redrawn image and the result of the post-verification into a generative deep learning model to obtain a target image after removing the watermark, but not limited to this.
[0080] In a preferred embodiment, in step S121, watermark detection and image classification are performed on the target image to be watermarked, and the coordinates of the area where the watermark is located are determined, but the present invention is not limited thereto.
[0081] In a preferred embodiment, step S122 includes:
[0082] S1221, detecting the type of watermark;
[0083] S1222. Define the area to be redrawn, and exclude the area to be redrawn where the area occupied by the watermark in the picture is greater than a preset threshold, but not limited to this.
[0084] In a preferred embodiment, step S124 includes:
[0085] S1241, inputting the area to be redrawn and the watermark mask into the trained generative deep learning model;
[0086] S1242: Obtain a redrawn image, but the present invention is not limited thereto.
[0087] The present invention provides an efficient and accurate watermark removal method, which is subdivided into the following key steps based on the working mechanism of the diffusion model:
[0088] Forward Diffusion: This method first performs the forward diffusion process, also known as the noise addition process. This process starts from the original image and gradually introduces noise until the image is completely converted into noise. In this process, the detailed information of the image gradually blurs, laying the foundation for the subsequent reverse denoising process.
[0089] Reverse Denoising: The reverse process is the core of denoising. The model gradually restores the image by learning to recover the distribution of the original data from the noise. This process is similar to the generator in the Generative Adversarial Network (GAN), but the diffusion model does not involve dimensionality changes in the reverse process.
[0090] Implementation of partial redrawing: In the partial redrawing stage, a mask is first generated for the watermark area to accurately segment the area where the watermark is located. This step can be achieved through image editing tools to create a mask indicating the area of the model to be redrawn.
[0091] Conditional input: During the redrawing process, the model uses the text vector and the noise image as conditional input to calculate the probability distribution of each transformation step. Based on this, the model guides the noise image to converge to the target image while maintaining the clarity and coherence of the image.
[0092] Redrawing and fusion: When redrawing the masked area, the model intelligently redraws the area covered by the mask based on the conditional input and existing image information, and merges it with the area not covered by the mask to ensure the consistency and natural transition of the overall image.
[0093] Parameter adjustment: During the partial redrawing process, users can control the redrawing effect by adjusting parameters such as the redrawing amplitude and mask blur, and finely control the degree of integration between the redrawn area and the original image, as well as the intensity and range of the redrawing.
[0094] Iterative optimization: Local redrawing is an iterative optimization process. The model continuously adjusts the redrawing results until the preset conditions are met or the expected visual effect is achieved.
[0095] Through the above steps, it is possible to accurately redraw and improve the quality of specific areas while maintaining the overall consistency of the image, thereby achieving efficient and targeted image editing. However, in practical applications, in order to generate a picture that meets the conditions at one time and avoid multiple generation and parameter adjustment, the present invention relies on two key aspects:
[0096] 1. Accurate watermark mask extraction scheme: ensures accurate identification and segmentation of watermark areas, providing accurate area guidance for subsequent redrawing.
[0097] 2. Stable redrawing effect: Ensure the stability of the diffusion generation process and ensure the consistency and reliability of the redrawing effect.
[0098] The specific implementation process of the present invention is as follows:
[0099] (1) First, watermark detection training data is constructed.
[0100] In this study, the data collection process was carefully designed to meet the needs of specific application scenarios. Among them, the data collection work strictly screened the image data in the real world, and deliberately excluded content that was not related to the target application, such as animation scenes. The collection focused on hotel and tourism-related images, covering a rich variety of data types such as hotel introduction pictures, tourist attraction pictures, and tourists' travel notes pictures. In order to further improve the model's adaptability and generalization performance to diverse scenarios, a large amount of copyright-free open source data was adopted, including solid color background images. The introduction of these data not only ensures the extensiveness of the training data, but also ensures its legality, providing a solid foundation for the training and verification of the model. Through such a data collection strategy, it is ensured that the model can perform well in a variety of practical applications while complying with the legal and ethical standards for data use.
[0101] In the data filtering stage, multi-dimensional filtering criteria were implemented. For example, in terms of size, only image data with a resolution of no less than 1024*1024 was retained. In addition, the model was used to score the quality of images from the perspectives of aesthetics and clarity, and a threshold was set to filter out low-quality images. Given that the scene text in the dataset is small, no text ratio filtering is performed for the time being. In future application scenarios, if there are a large number of poster texts or screenshots, it is recommended to introduce text ratio filtering to reduce data interference in scenes with too much text.
[0102] In the data generation phase, a set of processes was designed to create high-quality training data. First, a series of common watermark data and potential watermark patterns were collected. Using image processing techniques, the initial watermark masks were extracted from these patterns. Subsequently, these watermark data were accurately superimposed on the previously collected image data to generate watermarked images and their corresponding masks. In order to enhance the adaptability and generalization ability of the model to different watermark situations, a variety of random factors were introduced in the data generation process. This includes the location of the watermark in the image, transparency, and size ratio. These random changes ensure that the model can be exposed to a variety of watermark scenarios during training, making it more robust and effective in practical applications. In this way, a rich and challenging dataset was successfully constructed, providing a solid foundation for the training of the model.
[0103] Then, the watermark removal training data is constructed.
[0104] In the process of screening watermark detection data, high-quality data is specially selected for training in the watermark removal stage. Since the watermark does not need to actually exist on the image during the watermark removal process, an efficient strategy is adopted: the previously generated watermark mask is randomly applied to the original image as the input image for model training. Correspondingly, the original image itself is used as supervision data to guide the accuracy of the watermark removal result.
[0105] To further improve the generalization of the model, additional randomness was introduced into the training data. Specifically, some box-shaped patterns were randomly generated and used as virtual watermark masks combined with the existing watermark masks. This increased the diversity of the training data, allowing the model to learn a wider range of watermark patterns, thereby maintaining efficient removal performance in the face of various watermark situations. This approach ensured the robustness and adaptability of the model in practical applications.
[0106] (2) Watermark removal process
[0107] Figure 2 Schematic diagram of the implementation process of the method for removing watermarks from pictures of tourist scenes of the present invention. Figure 2 As shown, the present invention proposes a set of precise watermark removal processes, which starts from the original picture containing the watermark and achieves efficient watermark removal through a series of automated steps. The specific steps are as follows:
[0108] 1. Watermark detection: The system first performs watermark detection on the original image to identify whether there is a watermark in the image. Once a watermark is detected, the system will determine the coordinates of the area where the watermark is located.
[0109] 2. Image type classification: After confirming the presence of a watermark, the system will classify the image to identify the type of image. During this process, the system will exclude certain types of images such as map screenshots, which will not be processed in the internal data.
[0110] 3. Watermark type detection: The system further analyzes the type of watermark to provide a basis for subsequent removal operations. Watermark types are pre-set into multiple categories, and this step will determine which category the watermark belongs to.
[0111] 4. Watermark type determination: Based on the detection results, the system will determine the specific type of watermark, such as oblique watermark, pattern watermark, etc.
[0112] 5. Determine the redraw area: The system will determine the area that needs to be redrawn, that is, the area where the watermark is located. In this step, the system will exclude watermarks that account for too large an area, because it is difficult to remove such watermarks in accordance with the real scene.
[0113] 6. Area expansion: In order to ensure a natural transition of the image after watermark removal, the system will expand the redrawing area. This step provides sufficient semantic information for the diffusion model to ensure the stability of the redrawing performance.
[0114] 7. Saliency Segmentation: For some types of watermarks, the system will perform saliency segmentation to distinguish the watermarked parts in the image to generate a watermark mask.
[0115] 8. Box filling: For certain types of watermarks, the system will adopt box filling processing and directly use the box as the watermark mask instead of generating a traditional watermark mask.
[0116] 9. Input mask generation: Based on the above steps, the system will generate a mask to guide the subsequent redrawing process.
[0117] 10. Post-verification logic: After the redrawing is completed, the system will perform a post-verification to ensure the quality and accuracy of the redrawing results.
[0118] 11. Input image when redrawing: The redrawn area and the result of post-check will be used as input for the next step of processing.
[0119] 12. Redraw result: The system generates a redrawn image, and the watermark has been successfully removed.
[0120] 13. Post-processing logic: Finally, the system post-processes the redraw results to further optimize the removal effect.
[0121] 14. Removal result: The final output of the process is a picture with the watermark removed.
[0122] With the assistance of deep learning models, the entire process has achieved full automation of watermark detection, classification, removal and post-processing, significantly improving the efficiency and effectiveness of watermark removal.
[0123] The tourist scene picture watermark removal method of the present invention can realize full automation of watermark detection, classification, removal and post-processing with the assistance of a deep learning model, significantly improve the efficiency and effect of watermark removal, and reduce labor costs.
[0124] Figure 3 Schematic diagram of the structure of the tourist scene picture watermark removal system of the present invention. Figure 3 As shown, the embodiment of the present invention further provides a system for removing watermarks from pictures of tourist scenes, which is used to implement the above-mentioned method for removing watermarks from pictures of tourist scenes. The system 5 for removing watermarks from pictures of tourist scenes includes:
[0125] A training data module 51 collects hotel and tourism related images and watermark information, randomly adds the watermark information to the filtered images to generate a watermark image set, and trains a generative deep learning model based on the watermark image set;
[0126] The watermark removal module 52 performs watermark detection and image classification on the target image to be watermarked, defines the area to be redrawn, and then performs saliency segmentation to obtain the watermark part in the image to generate a watermark mask. The area to be redrawn and the watermark mask are input into the trained generative deep learning model together to obtain the redrawn image, and the redrawn image is overlaid on the redrawn area of the target image.
[0127] In a preferred embodiment, the training data module 51 is configured as follows:
[0128] Collect hotel and tourism related images to establish an image set, use the model to score the quality of the images to filter out low-quality images; collect watermark information and add a category label to each watermark information, the watermark information includes a watermark pattern, and the category label includes at least a diagonal watermark and a pattern watermark; randomly superimpose the watermark pattern on the filtered image to generate a first watermark image set; train a generative deep learning model based on the first watermark image set, but not limited to this.
[0129] In a preferred embodiment, the training data module 51 is also configured such that the watermark information includes a watermark pattern and a watermark mask; the watermark pattern is randomly superimposed on the filtered image to generate a first watermark image set, and the watermark mask is randomly applied to the filtered image to generate a second watermark image set; and a generative deep learning model is trained based on the first watermark image set and the second watermark image set, but is not limited to this.
[0130] In a preferred embodiment, the watermark removal module 52 is configured to perform watermark detection and image classification on the target image to be watermarked; detect the type of watermark and define the area to be redrawn; expand the area based on the area to be redrawn, and then perform saliency segmentation to obtain the watermark part in the image to generate a watermark mask; input the area to be redrawn and the watermark mask into a trained generative deep learning model to obtain a redrawn image; perform post-verification on the redrawn image; input the redrawn image and the result of the post-verification into the generative deep learning model to obtain the target image after the watermark is removed, but not limited to this.
[0131] In a preferred embodiment, the watermark removal module 52 is further configured to perform watermark detection and image classification on the target image to be watermarked, and determine the coordinates of the area where the watermark is located, but the present invention is not limited thereto.
[0132] In a preferred embodiment, the watermark removal module 52 is further configured to detect the type of watermark; define the area to be redrawn, and exclude the area to be redrawn where the area occupied by the watermark in the picture is greater than a preset threshold.
[0133] In a preferred embodiment, the watermark removal module 52 is further configured to input the area to be redrawn and the watermark mask into a trained generative deep learning model to obtain a redrawn image.
[0134] The tourism scene picture watermark removal system of the present invention can realize full automation of watermark detection, classification, removal and post-processing with the assistance of the deep learning model, which significantly improves the efficiency and effect of watermark removal and reduces labor costs.
[0135] The embodiment of the present invention also provides a device for removing watermarks from pictures of tourist scenes, comprising a processor and a memory, wherein executable instructions of the processor are stored, wherein the processor is configured to execute the steps of the method for removing watermarks from pictures of tourist scenes by executing the executable instructions.
[0136] As shown above, the image watermark removal device for tourism scenes of this embodiment of the present invention can achieve full automation of watermark detection, classification, removal and post-processing with the assistance of a deep learning model, significantly improving the efficiency and effect of watermark removal and reducing labor costs.
[0137] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "platforms".
[0138] Figure 4 This is a schematic diagram of the structure of the tourist scene picture watermark removal device of the present invention. Figure 4 The electronic device 600 according to this embodiment of the present invention is described. Figure 4 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0139] like Figure 4 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0140] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above method section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1 Follow the steps shown in .
[0141] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0142] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0143] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0144] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.
[0145] The embodiment of the present invention also provides a computer-readable storage medium for storing a program, and the steps of the method for removing watermarks from pictures of tourist scenes are implemented when the program is executed. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the above method section of this specification.
[0146] As shown above, the picture watermark removal system for tourism scenes of this embodiment of the present invention can achieve full automation of watermark detection, classification, removal and post-processing with the assistance of a deep learning model, significantly improving the efficiency and effect of watermark removal and reducing labor costs.
[0147] Figure 5 Schematic diagram of the structure of the computer-readable storage medium of the present invention. Figure 5 As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0148] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0149] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0150] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0151] In summary, the purpose of the present invention is to provide a method, system, device and storage medium for removing watermarks from pictures of tourist scenes, which can realize full automation of watermark detection, classification, removal and post-processing with the assistance of a deep learning model, significantly improve the efficiency and effect of watermark removal, and reduce labor costs.
[0152] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A method for removing watermarks from pictures of tourist scenes, characterized in that: The following steps are involved: S110, collecting hotel and tourism related images and watermark information, randomly adding the watermark information to the filtered images to generate a watermark image set, and training a generative deep learning model according to the watermark image set; S120, performing watermark detection and image classification on the target image to be watermarked, defining the area to be redrawn, and then performing saliency segmentation to obtain the watermark part in the image to generate a watermark mask, inputting the area to be redrawn and the watermark mask into a trained generative deep learning model to obtain a redrawn image, and overlaying the redrawn image on the redrawn area of the target image.
2. The method for removing watermarks from pictures of tourist scenes as claimed in claim 1, characterized in that: The step S110 includes: S111, collecting hotel and tourism related images to establish an image collection, and using a model to score the quality of the images to filter out images with lower quality; S112, collecting watermark information and adding a category label to each of the watermark information, the watermark information includes a watermark pattern, and the category label includes at least an oblique version watermark and a pattern watermark; S113, randomly superimposing the watermark pattern onto the filtered image to generate a first watermark image set; S114. Training a generative deep learning model based on the first watermark image set.
3. The method for removing watermarks from pictures of tourist scenes as claimed in claim 1, characterized in that: In the step S112, the watermark information includes a watermark pattern and a watermark mask; The step S113 is replaced by randomly superimposing the watermark pattern on the filtered image to generate a first watermark image set, and randomly applying the watermark mask to the filtered image to generate a second watermark image set; The step S114 is replaced by training a generative deep learning model based on the first watermark image set and the second watermark image set.
4. The method for removing watermarks from pictures of tourist scenes as claimed in claim 2, characterized in that: The step S120 includes: S121, performing watermark detection and image classification on the target image to be watermarked; S122, detecting the type of watermark and defining the area to be redrawn; S123, performing region expansion based on the to-be-redrawn region, and then performing saliency segmentation to obtain a watermark portion in the image to generate a watermark mask; S124, inputting the area to be redrawn and the watermark mask into a trained generative deep learning model to obtain a redrawn image; S125, performing post-check on the redrawn image; S126. Input the redrawn image and the result of the post-verification into the generative deep learning model to obtain the target image after the watermark is removed.
5. The method for removing watermarks from pictures of tourist scenes as claimed in claim 1, characterized in that: In the step S121, watermark detection and image classification are performed on the target image to be watermarked, and the coordinates of the area where the watermark is located are determined.
6. The method for removing watermarks from pictures of tourist scenes as claimed in claim 1, characterized in that: The step S122 includes: S1221, detecting the type of watermark; S1222. Define the area to be redrawn, and exclude the area to be redrawn where the area occupied by the watermark in the picture is greater than a preset threshold.
7. The method for removing watermarks from pictures of tourist scenes as claimed in claim 1, characterized in that: The step S124 comprises: S1241, inputting the to-be-redrawn area and the watermark mask into a trained generative deep learning model; S1242, to obtain the redrawn image.
8. A system for removing watermarks from pictures of tourist scenes, used to implement the method for removing watermarks from pictures of tourist scenes as claimed in claim 1, characterized in that: include: A training data module collects hotel and tourism related images and watermark information, randomly adds the watermark information to the filtered images to generate a watermark image set, and trains a generative deep learning model based on the watermark image set; The watermark removal module performs watermark detection and image classification on the target image to be watermarked, defines the area to be redrawn, and then performs saliency segmentation to obtain the watermark part in the image to generate a watermark mask. The area to be redrawn and the watermark mask are input into the trained generative deep learning model to obtain the redrawn image, and the redrawn image is overlaid on the redrawn area of the target image.
9. A device for removing watermarks from pictures of tourist scenes, characterized in that: include: processor; a memory storing executable instructions of the processor; Wherein, the processor is configured to execute the steps of the method for removing watermarks from pictures of tourist scenes as described in any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps of the method for removing watermarks from pictures of tourist scenes as described in any one of claims 1 to 7 are implemented.