File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 11
11
12
12
13
13
class MyRobot (wpilib .TimedRobot ):
14
- """
15
- This is a demo program showing the use of OpenCV to do vision processing. The image is acquired
16
- from the Axis camera, then a rectangle is put on the image and sent to the dashboard. OpenCV has
17
- many methods for different types of processing.
18
- """
19
-
20
14
def robotInit (self ):
21
15
# Your image processing code will be launched via a stub that will set up logging and initialize NetworkTables
22
16
# to talk to your robot code.
Original file line number Diff line number Diff line change 4
4
# the WPILib BSD license file in the root directory of this project.
5
5
#
6
6
7
+ """
8
+ This is a demo program showing the use of OpenCV to do vision processing. The image is acquired
9
+ from an HTTP camera, then a rectangle is put on the image and sent to the dashboard. OpenCV has
10
+ many methods for different types of processing.
11
+ """
7
12
8
13
import ntcore
9
14
import numpy
15
+ import cscore
10
16
from cscore import CameraServer
11
17
import cv2
12
18
19
25
20
26
21
27
def main ():
22
- # Get the Axis camera from CameraServer
23
- camera = CameraServer .addAxisCamera ("axis-camera.local" )
24
-
28
+ # Create an HTTP camera. The address will need to be modified to have the
29
+ # correct team number. The exact path will depend on the source.
30
+ camera = cscore .HttpCamera ("HTTP Camera" , "http://10.x.y.11/video/stream.mjpg" )
31
+ # Start capturing images
32
+ CameraServer .startAutomaticCapture (camera )
25
33
# Set the resolution
26
34
camera .setResolution (640 , 480 )
27
35
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ BASE_TESTS="
11
11
ArmBot
12
12
ArmBotOffboard
13
13
ArmSimulation
14
- AxisCamera
15
14
CANPDP
16
15
DifferentialDriveBot
17
16
DigitalCommunication
@@ -32,6 +31,7 @@ BASE_TESTS="
32
31
HatchbotInlined
33
32
HatchbotTraditional
34
33
HidRumble
34
+ HttpCamera
35
35
I2CCommunication
36
36
IntermediateVision
37
37
MagicbotSimple
You can’t perform that action at this time.
0 commit comments