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 1111
1212
1313class 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-
2014 def robotInit (self ):
2115 # Your image processing code will be launched via a stub that will set up logging and initialize NetworkTables
2216 # to talk to your robot code.
Original file line number Diff line number Diff line change 44# the WPILib BSD license file in the root directory of this project.
55#
66
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+ """
712
813import ntcore
914import numpy
15+ import cscore
1016from cscore import CameraServer
1117import cv2
1218
1925
2026
2127def 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 )
2533 # Set the resolution
2634 camera .setResolution (640 , 480 )
2735
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ BASE_TESTS="
1111 ArmBot
1212 ArmBotOffboard
1313 ArmSimulation
14- AxisCamera
1514 CANPDP
1615 DifferentialDriveBot
1716 DigitalCommunication
@@ -32,6 +31,7 @@ BASE_TESTS="
3231 HatchbotInlined
3332 HatchbotTraditional
3433 HidRumble
34+ HttpCamera
3535 I2CCommunication
3636 IntermediateVision
3737 MagicbotSimple
You can’t perform that action at this time.
0 commit comments