Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
import cv2 import numpy as np import os # Set the directory where images are stored image_dir = 'path_to_images/' output_dir = 'path_to_output/' # Load one image to manually get the logo coordinates sample_image = cv2.imread(os.path.join(image_dir, 'sample_image.jpg')) # Set the coordinates of the logo (x, y, width, height) logo_coords = (x, y, w, h) # Create a mask for the logo mask = np.zeros_like(sample_image[:, :, 0]) # Same size as image, single channel cv2.rectangle(mask, (logo_coords[0], logo_coords[1]), (logo_coords[0] + logo_coords[2], logo_coords[1] + logo_coords[3]), 255, -1) # Function to remove logo using inpainting def remove_logo(image, mask): # Inpaint the area of the logo result = cv2.inpaint(image, mask, 3, cv2.INPAINT_TELEA) return result # Process all images for filename in os.listdir(image_dir): if filename.endswith('.jpg') or filename.endswith('.png'): img = cv2.imread(os.path.join(image_dir, filename)) result = remove_logo(img, mask) cv2.imwrite(os.path.join(output_dir, filename), result) print("Logo removal completed for all images.")
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)