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

Example code for python cameraserver does not work and contains mistakes #2754

Open
DanPeled opened this issue Sep 19, 2024 · 0 comments
Open

Comments

@DanPeled
Copy link

DanPeled commented Sep 19, 2024

the example code provided :

from cscore import CameraServer
import cv2
import numpy as np

CameraServer.enableLogging()

camera = CameraServer.startAutomaticCapture()
camera.setResolution(width, height)

sink = cs.getVideo()

while True:
   time, input_img = cvSink.grabFrame(input_img)

   if time == 0: # There is an error
      continue

does not work for several reasons:

  • cs does not exist (referenced when doing cs.getVideo()), should be CameraServer.getVideo() probably
  • input_img is passed to grabFrame before being declared
  • cvSink does not exist (probably should be sink)
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

1 participant