CameraServer

class wpilib._impl.USBCamera(name=None)[source]

Bases: builtins.object

class WhiteBalance[source]

Bases: builtins.object

kFixedFlourescent2 = 5200
kFixedFluorescent1 = 5100
kFixedIndoor = 3000
kFixedOutdoor1 = 4000
kFixedOutdoor2 = 5000
USBCamera.closeCamera()[source]
USBCamera.getBrightness()[source]

Get the brightness, as a percentage (0-100).

USBCamera.getImage(image)[source]
USBCamera.getImageData(data, maxsize)[source]
USBCamera.kDefaultCameraName = b'cam0'
USBCamera.openCamera()[source]
USBCamera.setBrightness(brightness)[source]

Set the brightness, as a percentage (0-100).

USBCamera.setExposureAuto()[source]

Set the exposure to auto aperature.

USBCamera.setExposureHoldCurrent()[source]

Set the exposure to hold current.

USBCamera.setExposureManual(value)[source]

Set the exposure to manual, as a percentage (0-100).

USBCamera.setFPS(fps)[source]
USBCamera.setSize(width, height)[source]
USBCamera.setWhiteBalanceAuto()[source]

Set the white balance to auto.

USBCamera.setWhiteBalanceHoldCurrent()[source]

Set the white balance to hold current.

USBCamera.setWhiteBalanceManual(value)[source]

Set the white balance to manual, with specified color temperature.

USBCamera.startCapture()[source]
USBCamera.stopCapture()[source]
USBCamera.updateSettings()[source]
class wpilib._impl.CameraServer[source]

Bases: builtins.object

static getInstance()[source]
getQuality()[source]

Get the quality of the compressed image sent to the dashboard

Returns:The quality, from 0 to 100
isAutoCaptureStarted()[source]

check if auto capture is started

kPort = 1180
kSize160x120 = 2
kSize320x240 = 1
kSize640x480 = 0
server = None
setImage(image)[source]
setQuality(quality)[source]

Set the quality of the compressed image sent to the dashboard

Parameters:quality – The quality of the JPEG image, from 0 to 100
setSize(size)[source]
startAutomaticCapture(camera)[source]

Start automatically capturing images to send to the dashboard.

You should call this method to just see a camera feed on the dashboard without doing any vision processing on the roboRIO. {@link #setImage} shouldn’t be called after this is called.

Parameters:camera – The camera interface (e.g. a USBCamera instance)