Skip to content
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

Open
git-gnan opened this issue Oct 7, 2024 · 4 comments
Open

get the current camera image #62

git-gnan opened this issue Oct 7, 2024 · 4 comments
Labels
question Further information is requested

Comments

@git-gnan
Copy link

git-gnan commented Oct 7, 2024

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.

@UltralyticsAssistant UltralyticsAssistant added the question Further information is requested label Oct 7, 2024
@UltralyticsAssistant
Copy link
Member

👋 Hello @git-gnan, thank you for submitting an ultralytics/yolo-flutter-app 🚀 issue. To help us address your concern efficiently, please provide the following details:

  1. For bug reports:

    • A clear and concise description of the bug
    • A minimum reproducible example (MRE) that demonstrates the issue
    • Your environment details (device, OS version, Flutter version)
    • Expected behavior vs. actual behavior
    • Any error messages or logs related to the issue
  2. For feature requests:

    • A clear and concise description of the proposed feature
    • The problem this feature would solve
    • Any alternative solutions you've considered
  3. For questions:

    • Provide as much context as possible about your question
    • Include any research you've already done on the topic
    • Specify which parts of the documentation you've already consulted

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! 😊

@pderrenger
Copy link
Member

@git-gnan to capture the current camera image for object detection, you can use OpenCV's VideoCapture to grab frames and then apply YOLO for detection. Here's a basic example:

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.

@aabdulat1998
Copy link

That is for Python and not for Flutter

@aabdulat1998
Copy link

@git-gnan were you able to extract a frame? I am having the same issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants