本文整理汇总了Java中edu.wpi.first.wpilibj.vision.USBCamera.openCamera方法的典型用法代码示例。如果您正苦于以下问题:Java USBCamera.openCamera方法的具体用法?Java USBCamera.openCamera怎么用?Java USBCamera.openCamera使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.vision.USBCamera
的用法示例。
在下文中一共展示了USBCamera.openCamera方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startAutomaticCapture
import edu.wpi.first.wpilibj.vision.USBCamera; //导入方法依赖的package包/类
/**
* 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.
*
* @param cameraName The name of the camera interface (e.g. "cam1")
*/
public void startAutomaticCapture(String cameraName) {
try {
USBCamera camera = new USBCamera(cameraName);
camera.openCamera();
startAutomaticCapture(camera);
} catch (VisionException ex) {
//DriverStation.reportError(
// "Error when starting the camera: " + cameraName + " " + ex.getMessage(), true);
}
}
示例2: startCamera
import edu.wpi.first.wpilibj.vision.USBCamera; //导入方法依赖的package包/类
/**
* 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.
*
* @param cameraName The name of the camera interface (e.g. "cam1")
*/
private USBCamera startCamera(String cameraName) {
try {
USBCamera camera = new USBCamera(cameraName);
camera.openCamera();
//startAutomaticCapture(camera);
return camera;
} catch (VisionException ex) {
DriverStation.reportError(
"Error when starting the camera: " + cameraName + " " + ex.getMessage(), true);
}
return null;
}
示例3: startAutomaticCapture
import edu.wpi.first.wpilibj.vision.USBCamera; //导入方法依赖的package包/类
/**
* 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.
*
* @param cameraName The name of the camera interface (e.g. "cam1")
*/
public void startAutomaticCapture(String cameraName) {
try {
USBCamera camera = new USBCamera(cameraName);
camera.openCamera();
startAutomaticCapture(camera);
} catch (VisionException ex) {
DriverStation.reportError(
"Error when starting the camera: " + cameraName + " " + ex.getMessage(), true);
}
}