Pattern matching elimination method and device, equipment and medium
By combining image stitching and large-model visual positioning with mask generation and image inpainting algorithms, the problems of poor generalization ability, low efficiency and weak scene adaptability of pattern deletion in existing technologies are solved, and efficient and accurate automatic pattern deletion is achieved.
Patent Information
- Application Number
- CN202511172195.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-12-30
AI Technical Summary
Existing technologies have poor generalization ability, heavy data dependence, low efficiency and weak adaptability to different scenarios in pattern deletion, and cannot meet the needs of real-time or batch processing.
By combining image stitching technology with large-scale model visual localization, mask generation, and image inpainting algorithms, automatic pattern deletion without pre-training is achieved. The pattern region is located using the Qwen-VL-Max model, and the inpainting is performed using the LaMA model.
It achieves efficient and accurate pattern deletion, shortening the processing time to 3-5 seconds, supports batch processing, has a high positioning success rate, small error, natural repair effect, and adapts to complex backgrounds and resolution changes.
Smart Images

Figure CN121236221A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, device, and medium for pattern matching elimination. Background Technology
[0002] In the field of image editing and content processing, traditional pattern removal methods have significant limitations. Existing technologies primarily rely on training detection models specific to particular patterns; that is, they require collecting a large number of target pattern samples to train a dedicated detector in order to recognize and remove the pattern. However, this approach suffers from the following core problems:
[0003] Extremely poor generalization ability: For each new pattern deletion task (such as different watermarks, logos, and symbols), sample data of the pattern must be collected again and the model must be trained, which is tedious and repetitive.
[0004] Heavy reliance on data: New patterns often lack sufficient samples (such as niche logos and custom patterns), resulting in low accuracy of the training model and high false negative / false positive rates;
[0005] Inefficient: Model training requires a lot of computing resources and time, which cannot meet the needs of real-time or batch processing;
[0006] Poor scene adaptability: When faced with complex backgrounds (such as overlapping patterns, deformation, blurring), the trained model is prone to failure, and the image may have residue or background distortion after deletion. Summary of the Invention
[0007] The technical problem to be solved by this invention is to provide a pattern matching elimination method, apparatus, device, and medium. It provides an automatic pattern deletion method that requires no pre-training, has strong generalization ability, and is highly efficient and accurate. By integrating image stitching technology with the visual positioning capabilities of a large model, and combining mask generation and image restoration algorithms, it achieves rapid positioning and deletion of any target pattern. This method does not require training a model for specific patterns and can directly adapt to diverse patterns (including newly emerging patterns and patterns with scarce samples). It accurately locates and eliminates pattern regions while maintaining a natural and continuous background. This solves the problems of traditional methods relying on training, poor generalization, and low efficiency, providing technical support for scenarios such as image editing, content review, and historical image restoration, and meeting the practical needs of real-time and batch processing.
[0008] In a first aspect, the present invention provides a method for eliminating pattern matching, comprising the following steps:
[0009] Step 1: Preprocess the target reference pattern to obtain a reference processed image of a set size. Stitch the reference processed image to the set position of the image to be retrieved to form a joint input image. The joint input image is scaled to a set pixel scale.
[0010] Step 2: Input the joint input image into the Qwen-VL-Max model to obtain all regions that are identical to the reference processing image pattern, and obtain the detection coordinates of each region;
[0011] Step 3: Read the original width and height of the image to be retrieved, and restore the detected coordinates to the actual coordinates in the image to be retrieved;
[0012] Step 4: Based on the actual coordinates, generate a binarized mask covering the region of the target reference pattern; insulate the image to be retrieved and the mask input image to obtain the pattern-removed image.
[0013] In a second aspect, the present invention provides a pattern matching elimination device, comprising:
[0014] The image preprocessing module preprocesses the target reference pattern to obtain a reference processed image of a set size. The reference processed image is then stitched to a set position in the image to be retrieved to form a joint input image, which is then scaled to a set pixel scale.
[0015] The pattern detection module inputs the joint input image into the Qwen-VL-Max model to obtain all regions that are the same as the pattern in the reference processed image, and obtains the detection coordinates of each region.
[0016] The coordinate transformation module reads the original width and height of the image to be retrieved and restores the detected coordinates to the actual coordinates in the image to be retrieved.
[0017] The pattern removal module generates a binarized mask covering the region of the target reference pattern based on the actual coordinates; the image to be retrieved and the mask input image are then used to repair the model to obtain the pattern-removed image.
[0018] Thirdly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect.
[0019] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0020] One or more technical solutions provided by this invention have at least the following technical effects or advantages:
[0021] 1. High efficiency: Eliminates the steps of sample collection and model training in traditional methods, reducing the processing time of a single image from input to deletion to 3-5 seconds, which is more than 99% more efficient than training methods (hours); Batch processing adaptation: Supports parallel processing of multiple images, and can process ≥1000 images per hour to meet the needs of large-scale scenarios.
[0022] 2. Accuracy: In complex backgrounds and pattern deformation scenarios (scaling ≤ 2x, rotation ≤ 30°), the coordinate restoration error is ≤ 2 pixels, which is 60% higher than traditional detection models (error ≥ 5 pixels). 3. Removal effect: The average structural similarity (SSIM) between the repaired area and the background reaches 0.95, with no obvious residue or blurring, and the edge transition is natural.
[0023] 4. Generalization: It can handle any pattern (including logos, watermarks, hand-drawn patterns, etc.) without adjusting parameters. For newly emerging patterns or patterns with scarce samples, the positioning success rate remains above 92%.
[0024] 5. Scene adaptability: Supports images with different resolutions (300-2000dpi) and background types (solid color, texture, complex scene), with a false deletion rate of ≤1.5%.
[0025] 6. Compatibility: It can be seamlessly embedded into mainstream image editing software (such as Photoshop plugins and online editing tools) and supports API calls; Model compatibility: The positioning module can be replaced with other large visual models (such as GPT-4V), and the elimination module can be adapted to repair models such as EDSR and RCAN, which is highly flexible.
[0026] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0027] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0028] Figure 1 This is a flowchart of the method in Embodiment 1 of the present invention;
[0029] Figure 2 This is a schematic diagram of the device in Embodiment 2 of the present invention. Detailed Implementation
[0030] The overall concept of the technical solution in this application is as follows:
[0031] The automatic pattern deletion method proposed in this invention is based on a joint framework of "image stitching - large model localization - mask repair", and is implemented through the following key modules:
[0032] Image stitching module: preprocesses the target reference pattern (resizes it to 50×50 pixels), and stitches it to the upper left corner of the image to be retrieved, forming a joint input image containing "reference pattern + content to be processed", providing a clear target reference for the large model.
[0033] Pattern localization module: It adopts large visual language models such as Qwen-VL-Max to parse the joint input image and output the coordinates of the pattern region in the image to be retrieved that matches the reference pattern (relative coordinates based on the joint image), so as to achieve cross-pattern localization without training.
[0034] Coordinate restoration module: Based on the size mapping relationship between the joint image and the original image to be retrieved, the predicted coordinates are restored to the actual coordinates in the original image through the scaling formula (y_ori=y_pred×h_ori / 980, x_ori=x_pred×w_ori / 980, where h_ori and w_ori are the width and height of the original image, and 980 is the unified scale of the joint image).
[0035] Mask generation module: Based on the restored coordinates, it generates a binary mask covering the target pattern area (pattern area is 255, background is 0), accurately marking the area to be deleted. Pattern removal module: It inputs the original image and the generated mask into image inpainting models such as LaMA (Large Mask Inpainting) to fill the background and optimize the edges of the mask area, achieving seamless removal of the pattern.
[0036] Preprocessing and image stitching
[0037] Normalize the size of the target reference pattern: resize to 50×50 pixels while preserving pattern details;
[0038] The standardized reference pattern is stitched to the top left corner of the image to be retrieved to generate a joint image (uniformly scaled to 980 pixels for easy processing of large models).
[0039] Pattern positioning and coordinate acquisition
[0040] Input the joint image into Qwen-VL-Max and send the instruction "Locate all regions in the image that are identical to the 50×50 pattern in the upper left corner, and output the coordinates of the upper left and lower right corners of each region (format: [x1,y1,x2,y2])";
[0041] Receive the relative coordinates returned by the model (based on the joint image at a 980 scale).
[0042] Coordinate restoration and mask generation
[0043] Read the original width and height (h_ori, w_ori) of the image to be retrieved;
[0044] The actual coordinates in the original image are calculated using the following proportional formulas: x_ori=x_pred×w_ori / 980, y_ori=y_pred×h_ori / 980;
[0045] A binary mask is generated based on the actual coordinates to ensure that the entire target pattern area is covered.
[0046] Pattern Removal and Post-processing
[0047] The original image and the mask are input into the LaMA model to perform image inpainting and fill the background of the patterned area.
[0048] Gaussian blur is used to optimize the edges of the repaired area, eliminating masking traces and making the repaired result blend naturally with the original background.
[0049] Application scenarios
[0050] Image editing: Quickly remove watermarks, logos, and redundant patterns from images; suitable for social media content enhancement, e-commerce image optimization, and other scenarios.
[0051] In the area of content moderation: automatically locate and delete inappropriate images (such as vulgar symbols and sensitive characters) to improve the efficiency and accuracy of moderation.
[0052] Historical image restoration: removing stains and mold patterns from old photos and scanned copies of ancient books, preserving the relevant content, and assisting in the digitization of cultural relics.
[0053] In the field of advertising design: quickly replace or remove temporary graphics (such as placeholders) in advertising creatives to accelerate the design iteration process.
[0054] Real-time interactive scenarios: Remove specific patterns (such as privacy icons) from the screen in real time during live broadcasts and video conferences to ensure content compliance.
[0055] The specific steps are as follows:
[0056] 1. Preprocess the target reference pattern: resize it to 50×50 pixels; this step is to standardize the size of the target reference pattern, ensuring consistency in subsequent image stitching and model recognition. By adjusting the reference pattern to a fixed size of 50×50 pixels, key details of the pattern can be preserved to a certain extent, while ensuring its stability as a reference standard and avoiding interference from size differences in subsequent matching and positioning.
[0057] 2. The preprocessed reference pattern is fixedly stitched to the upper left corner of the image to be retrieved, forming a joint input image, and uniformly scaled to 980 pixels. Stitching the size-standardized reference pattern to the upper left corner of the image to be retrieved aims to provide a clear target reference for subsequent large-scale model localization, allowing the model to clearly understand the pattern to be searched. Scaled the joint image to 980 pixels to adapt to the processing requirements of large visual language models such as Qwen-VL-Max, reducing localization errors that may be caused by different image scales and improving the accuracy of model resolution.
[0058] 3. Input the joint image into Qwen-VL-Max and send the instruction "Locate all regions in the image that are identical to the 50×50 pattern in the upper left corner, and output the coordinates of the upper left and lower right corners of each region (format: [x1,y1,x2,y2])". Inputting the joint image into the large model and sending specific instructions utilizes the model's powerful image understanding and analysis capabilities to locate the target pattern. The instruction explicitly requires locating regions identical to the upper left reference pattern and outputting coordinates in a specific format, ensuring that the model can accurately understand the task and obtain the required localization results. This process requires no additional training and can achieve cross-pattern localization.
[0059] 4. Receive relative coordinates from the model based on a 980-pixel scale joint image; receive coordinates returned by the model, which are relative coordinates derived from a joint image uniformly scaled to 980 pixels. These coordinates mark the positions of various regions in the joint image that match the reference pattern, and are the basic data for subsequent coordinate restoration and mask generation.
[0060] 5. Read the original width and height (h_ori, w_ori) of the image to be retrieved; these two parameters are crucial for coordinate restoration. Because the coordinates returned by the model are based on a scaled joint image, only by knowing the dimensions of the original image can the relative coordinates be restored to their actual coordinates in the original image through scaling.
[0061] 6. The predicted coordinates are restored to their actual coordinates in the original image using the scaling formulas (y_ori = y_pred × h_ori / 980, x_ori = x_pred × w_ori / 980). The relative coordinates returned by the model are then processed using the scaling formulas to convert them into their actual coordinates in the original image to be retrieved. In the formulas, 980 is the unified scale of the joint image. By using the proportional relationship between the width and height of the original image and this scale, accurate coordinate mapping is achieved, ensuring the correctness of the located region's position in the original image.
[0062] 7. Based on the restored coordinates, generate a binary mask covering the target pattern area (pattern area is 255, background is 0); generate a binary mask based on the actual coordinates of the target pattern area in the restored original image. In the mask, the area where the target pattern is located is marked as 255, and the background area is marked as 0. This allows for precise delineation of the pattern area to be deleted, providing a clear operational range for subsequent image restoration.
[0063] 8. Input the original image and the generated mask into an image inpainting model such as LaMA to fill the masked area with background. Alternatively, input both the original image and the mask into the LaMA model; the model will fill the area marked by the mask using surrounding background information, thus eliminating the target pattern. Models like LaMA perform well in image inpainting with large masked areas, enabling the filled background to initially blend with the surrounding environment.
[0064] 9. Gaussian blur is used to optimize the edges of the repaired area, making the repaired result blend naturally with the original background. Gaussian blurring of the edges of the repaired area eliminates masking traces and any abrupt transitions between the repaired area and the original background. By blurring the edges, the repaired area blends better with the surrounding original background, ultimately achieving seamless removal of the pattern and improving the overall naturalness of the image.
[0065] Example 1
[0066] like Figure 1 As shown, this embodiment provides a method for eliminating pattern matching, including the following steps:
[0067] Step 1: Preprocess the target reference pattern to obtain a reference processed image of a set size. Stitch the reference processed image to the set position of the image to be retrieved to form a joint input image. The joint input image is scaled to a set pixel scale.
[0068] Step 2: Input the joint input image into the Qwen-VL-Max model to obtain all regions that are identical to the reference processing image pattern, and obtain the detection coordinates of each region;
[0069] Step 3: Read the original width and height of the image to be retrieved, and restore the detected coordinates to the actual coordinates in the image to be retrieved;
[0070] Step 4: Based on the actual coordinates, generate a binarized mask covering the region of the target reference pattern; insulate the image to be retrieved and the mask input image to obtain the pattern-removed image.
[0071] In this embodiment, preferably, step 1 specifically involves: preprocessing the target reference pattern to obtain a reference processing image of a set size, wherein the set size is 50×50 pixels; stitching the reference processing image to a set position of the image to be retrieved to form a joint input image; scaling the joint input image to a set pixel scale, wherein the set pixel scale is 980 pixels.
[0072] In this embodiment, preferably, step 3 specifically involves: reading the original width and height (h_ori, w_ori) of the image to be retrieved, and restoring the detection coordinates to the actual coordinates in the image to be retrieved using a scaling conversion formula; the conversion formula is (y_ori = y_pred × h_ori / 980, x_ori = x_pred × w_ori / 980), where x_pred and y_pred are the detection coordinates.
[0073] In this embodiment, preferably, step 4 specifically involves: generating a binary mask covering the region of the target reference pattern based on actual coordinates, with the pattern region being 255 and the background being 0; using the image to be retrieved and the mask input image restoration model to fill the mask region with background; and optimizing the restoration of the region edges through Gaussian blur to obtain an image without the pattern, wherein the image restoration model is a Lama model.
[0074] Based on the same inventive concept, this application also provides an apparatus corresponding to the method in Embodiment 1, as detailed in Embodiment 2.
[0075] Example 2
[0076] like Figure 2 As shown, this embodiment provides a pattern matching elimination device, including:
[0077] The image preprocessing module preprocesses the target reference pattern to obtain a reference processed image of a set size. The reference processed image is then stitched to a set position in the image to be retrieved to form a joint input image, which is then scaled to a set pixel scale.
[0078] The pattern detection module inputs the joint input image into the Qwen-VL-Max model to obtain all regions that are the same as the pattern in the reference processed image, and obtains the detection coordinates of each region.
[0079] The coordinate transformation module reads the original width and height of the image to be retrieved and restores the detected coordinates to the actual coordinates in the image to be retrieved.
[0080] The pattern removal module generates a binarized mask covering the region of the target reference pattern based on the actual coordinates; the image to be retrieved and the mask input image are then used to repair the model to obtain the pattern-removed image.
[0081] In this embodiment, preferably, the image preprocessing module specifically performs the following: preprocessing on the target reference pattern to obtain a reference processing image of a set size, wherein the set size is 50×50 pixels; stitching the reference processing image to a set position of the image to be retrieved to form a joint input image; scaling the joint input image to a set pixel scale, wherein the set pixel scale is 980 pixels.
[0082] In this embodiment, preferably, the coordinate transformation module specifically reads the original width and height (h_ori, w_ori) of the image to be retrieved, and restores the detection coordinates to the actual coordinates in the image to be retrieved through a proportional transformation formula; the transformation formula is (y_ori=y_pred×h_ori / 980, x_ori=x_pred×w_ori / 980), where x_pred and y_pred are the detection coordinates.
[0083] In this embodiment, preferably, the pattern removal module specifically comprises: generating a binary mask covering the region of the target reference pattern based on actual coordinates, wherein the pattern region is 255 and the background is 0; filling the mask region with the background by inputting the image to be retrieved and the mask into the image restoration model; and optimizing the edge of the region by Gaussian blur to obtain the pattern-removed image, wherein the image restoration model is the Lama model.
[0084] Since the apparatus described in Embodiment 2 of the present invention is an apparatus used to implement the method of Embodiment 1 of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the method described in Embodiment 1 of the present invention, and therefore will not be described again here. All apparatuses used in the method of Embodiment 1 of the present invention fall within the scope of protection of the present invention.
[0085] Based on the same inventive concept, this application provides an electronic device embodiment corresponding to Embodiment 1, as detailed in Embodiment 3.
[0086] Example 3
[0087] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it can implement any of the implementation methods in Embodiment 1.
[0088] Since the electronic device described in this embodiment is the device used to implement the method in Embodiment 1 of this application, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the method described in Embodiment 1 of this application. Therefore, how the electronic device implements the method in the embodiment of this application will not be described in detail here. Any device used by those skilled in the art to implement the method in the embodiment of this application falls within the scope of protection of this application.
[0089] Based on the same inventive concept, this application provides a storage medium corresponding to Embodiment 1, as detailed in Embodiment 4.
[0090] Example 4
[0091] This embodiment provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it can implement any of the implementation methods in Embodiment 1.
[0092] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0093] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0094] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0095] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0096] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method of pattern matching cancellation, characterized by: The method comprises the following steps: Step 1: preprocessing a target reference pattern to obtain a reference processing pattern of a set size, splicing the reference processing pattern to a set position of a to-be-retrieved image to form a joint input image, and scaling the joint input image to a set pixel scale; Step 2: inputting the joint input image into a Qwen-VL-Max model to obtain all regions identical to the reference processing pattern, and obtaining detection coordinates of each region; Step 3: reading original width and height of the to-be-retrieved image, and restoring the detection coordinates to actual coordinates in the to-be-retrieved image; Step 4: generating a binary mask covering regions of the target reference pattern based on the actual coordinates; inputting the to-be-retrieved image and the mask into an image inpainting model to obtain a pattern-eliminated image.
2. The pattern matching elimination method of claim 1, wherein: The step 1 specifically comprises: preprocessing a target reference pattern to obtain a reference processing pattern of a set size, the set size being 50*50 pixels, splicing the reference processing pattern to a set position of a to-be-retrieved image to form a joint input image, and scaling the joint input image to a set pixel scale, the set pixel scale being 980 pixel scales.
3. The pattern matching elimination method of claim 1, wherein: The step 3 specifically comprises: reading original width and height (h_ori, w_ori) of the to-be-retrieved image, and restoring the detection coordinates to actual coordinates in the to-be-retrieved image through a proportional conversion formula; the conversion formula being (y_ori=y_pred×h_ori / 980, x_ori=x_pred×w_ori / 980), wherein x_pred and y_pred are detection coordinates.
4. The pattern matching elimination method of claim 1, wherein: The step 4 specifically comprises: generating a binary mask covering regions of the target reference pattern based on the actual coordinates, the pattern regions being 255 and the background being 0; inputting the to-be-retrieved image and the mask into an image inpainting model to fill the background of the mask regions; and optimizing the edges of the inpainting regions through Gaussian blur to obtain a pattern-eliminated image, the image inpainting model being a LAMA model.
5. A pattern matching elimination apparatus characterized by comprising: The method comprises: An image preprocessing module, which pre-processes a target reference pattern to obtain a reference processing pattern of a set size, splices the reference processing pattern to a set position of a to-be-retrieved image to form a joint input image, and scales the joint input image to a set pixel scale; A pattern detection module, which inputs the joint input image into a Qwen-VL-Max model to obtain all regions identical to the reference processing pattern, and obtains detection coordinates of each region; A coordinate conversion module, which reads original width and height of the to-be-retrieved image, and restores the detection coordinates to actual coordinates in the to-be-retrieved image; A pattern elimination module, which generates a binary mask covering regions of the target reference pattern based on the actual coordinates; inputting the to-be-retrieved image and the mask into an image inpainting model to obtain a pattern-eliminated image.
6. A pattern matching cancellation device according to claim 5, wherein: The image preprocessing module specifically comprises: preprocessing a target reference pattern to obtain a reference processing pattern of a set size, the set size being 50*50 pixels, splicing the reference processing pattern to a set position of a to-be-retrieved image to form a joint input image, and scaling the joint input image to a set pixel scale, the set pixel scale being 980 pixel scales.
7. A pattern matching cancellation device according to claim 5, wherein: The conversion coordinate module specifically comprises: reading original width and height (h ori, w ori) of the image to be searched, and restoring the detection coordinates to actual coordinates in the image to be searched through a proportional conversion formula; the conversion formula is (y ori = y pred * h ori / 980, x ori = x pred * w ori / 980), and x pred and y pred are the detection coordinates.
8. A pattern matching cancellation device according to claim 5, wherein: The pattern elimination module specifically comprises: generating a binary mask covering an area of a target reference pattern based on the actual coordinates, wherein the pattern area is 255, and the background is 0; inputting the image to be searched and the mask into an image inpainting model to fill the background of the mask area; and optimizing the edges of the inpainting area through Gaussian blur to obtain a pattern-eliminated image, wherein the image inpainting model is an LAMA model.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the method of any one of claims 1 to 4.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1 to 4.