-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get the current camera image #62
Comments
👋 Hello @git-gnan, thank you for submitting an
Make sure you've searched existing issues to avoid duplicates. If you need to add more information, please comment on this issue. This is an automated response, but an Ultralytics engineer will assist you soon. Thank you for improving our project! 😊 |
@git-gnan to capture the current camera image for object detection, you can use OpenCV's import cv2
from ultralytics import YOLO
model = YOLO("yolo11n.pt")
cap = cv2.VideoCapture(0) # Use 0 for the default camera
while cap.isOpened():
success, frame = cap.read()
if not success:
break
results = model.predict(frame)
# Process results to extract the region for OCR
# Example: crop using detected bounding box coordinates
# Perform OCR on the cropped region
cv2.imshow('Camera', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows() This captures frames from the camera, runs YOLO detection, and allows you to isolate regions for OCR based on detected labels. |
That is for Python and not for Flutter |
@git-gnan were you able to extract a frame? I am having the same issues |
how to get the current image (under the camera) or the image that is used for objectdetection. I am trying to peform OCR only on the rect region for a specifc label.
The text was updated successfully, but these errors were encountered: