Untitled

 avatar
unknown
plain_text
a year ago
579 B
23
Indexable
from PIL import Image, ImageDraw

# Load the image
image = Image.open("1000020591.jpg")  # Make sure this image is in your working directory

# Create a drawing context
draw = ImageDraw.Draw(image)

# Define the bounding box for the "12V" text (approximate coordinates)
highlight_box = (135, 310, 200, 340)  # (left, top, right, bottom)

# Draw a red rectangle around the area
draw.rectangle(highlight_box, outline="red", width=4)

# Save or show the annotated image
image.save("annotated_battery.jpg")  # Saves the result
image.show()  # Opens the image in your default viewer

Editor is loading...
Leave a Comment