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

采用deltelopy这个库连接tello上传在电脑上的视频呈现蓝色,应该如何解决 #97

Open
1411734304 opened this issue Apr 7, 2024 · 2 comments

Comments

@1411734304
Copy link

视频传输的问题如何解决,并且我已经安装了ffmpeg了,另外有人知道如何将yolo与tello结合么

@nobu835
Copy link

nobu835 commented Oct 7, 2024

Hi

If you're having trouble getting video, try this:
#98

if you want to use YOLOv8, here is a sample:
(It's a bit simplified and not practical.)

from ultralytics import YOLO
import cv2
cap=cv2.VideoCapture(0) # use webcam 
model=YOLO("yolov8n.pt") # you can also use yolov8s.pt, yolov8s-seg.pt, yolov8s-pose.pt, etc...
while True:
    frame=cap.read()[1]
    results=model(frame)
    for i in range(len(results[0].boxes.xyxy)):
        xyxy=results[0].boxes.xyxy[i].tolist()
        cv2.rectangle(frame,(  int(xyxy[0]),int(xyxy[1])  ),(  int(xyxy[2]),int(xyxy[3])  ),(0,0,255),2)
    cv2.imshow("window",frame)
    cv2.waitKey(1)

@nobu835
Copy link

nobu835 commented Oct 8, 2024

For problems that turn blue, try this:

frame = drone.read()
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

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

No branches or pull requests

2 participants