Skip to content

Commit ed1d2a6

Browse files
committed
Update cscore-intermediate-vision example
1 parent f687a40 commit ed1d2a6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cscore-intermediate-vision/vision.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,21 @@
1414
import cv2
1515
import numpy as np
1616

17-
from cscore import CameraServer
17+
from cscore import CameraServer as CS
1818

1919

2020
def main():
21-
cs = CameraServer.getInstance()
22-
cs.enableLogging()
21+
CS.enableLogging()
2322

24-
camera = cs.startAutomaticCapture()
23+
camera = CS.startAutomaticCapture()
2524

2625
camera.setResolution(320, 240)
2726

2827
# Get a CvSink. This will capture images from the camera
29-
cvSink = cs.getVideo()
28+
cvSink = CS.getVideo()
3029

3130
# (optional) Setup a CvSource. This will send images back to the Dashboard
32-
outputStream = cs.putVideo("Rectangle", 320, 240)
31+
outputStream = CS.putVideo("Rectangle", 320, 240)
3332

3433
# Allocating new images is very expensive, always try to preallocate
3534
img = np.zeros(shape=(240, 320, 3), dtype=np.uint8)

0 commit comments

Comments
 (0)