• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java USBCamera类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中edu.wpi.first.wpilibj.vision.USBCamera的典型用法代码示例。如果您正苦于以下问题:Java USBCamera类的具体用法?Java USBCamera怎么用?Java USBCamera使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



USBCamera类属于edu.wpi.first.wpilibj.vision包,在下文中一共展示了USBCamera类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: CameraServers

import edu.wpi.first.wpilibj.vision.USBCamera; //导入依赖的package包/类
public CameraServers(String... camNamesInput) {
 cams=new USBCamera[camNamesInput.length];
 camNames=camNamesInput;
  m_quality = 50;
  m_camera = null;
  m_imageData = null;
  m_imageDataPool = new ArrayDeque<>(3);
  for (int i = 0; i < 3; i++) {
    m_imageDataPool.addLast(ByteBuffer.allocateDirect(kMaxImageSize));
  }
  serverThread = new Thread(new Runnable() {
    public void run() {
      try {
        serve();
      } catch (IOException e) {
        // do stuff here
      } catch (InterruptedException e) {
        // do stuff here
      }
    }
  });
  serverThread.setName("CameraServer Send Thread");
  serverThread.start();
}
 
开发者ID:MontclairRobotics,项目名称:Sprocket,代码行数:25,代码来源:CameraServers.java


示例2: startBroadcast

import edu.wpi.first.wpilibj.vision.USBCamera; //导入依赖的package包/类
private synchronized void startBroadcast(USBCamera camera) {
  if (m_autoCaptureStarted)
    return;
  m_autoCaptureStarted = true;
  m_camera = camera;

  m_camera.startCapture();

  Thread captureThread = new Thread(new Runnable() {
    @Override
    public void run() {
      capture();
    }
  });
  captureThread.setName("Camera Capture Thread");
  captureThread.start();
}
 
开发者ID:MontclairRobotics,项目名称:Sprocket,代码行数:18,代码来源:CameraServers.java


示例3: startAutomaticCapture

import edu.wpi.first.wpilibj.vision.USBCamera; //导入依赖的package包/类
public synchronized void startAutomaticCapture(USBCamera camera) {
  if (m_autoCaptureStarted)
    return;
  m_autoCaptureStarted = true;
  m_camera = camera;

  m_camera.startCapture();

  Thread captureThread = new Thread(new Runnable() {
    @Override
    public void run() {
      capture();
    }
  });
  captureThread.setName("Camera Capture Thread");
  captureThread.start();
}
 
开发者ID:trc492,项目名称:Frc2016FirstStronghold,代码行数:18,代码来源:CameraServer.java


示例4: 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);
  }
}
 
开发者ID:FRC2832,项目名称:Robot_2016,代码行数:20,代码来源:CameraServer2832.java


示例5: robotInit

import edu.wpi.first.wpilibj.vision.USBCamera; //导入依赖的package包/类
public void robotInit() {

	// Create subsystems
	drive = new Drive();
	intake = new Intake();
	arm = new Arm();
	shooter = new Shooter();
	hanger = new Hanger();

	oi = new OI();

	// Create motion profiles
	crossLowBar = new Profile(AutoMap.crossLowBar);
	reach = new Profile(AutoMap.reach);
	toShoot = new Profile(AutoMap.toShoot);
	toLowGoal = new Profile(AutoMap.toLowGoal);

	// Pick an auto
	chooser = new SendableChooser();
	chooser.addDefault("Do Nothing", new DoNothing());
	chooser.addObject("Low Bar", new LowBarRawtonomous());
	chooser.addObject("Low Bar (profile)", new CrossLowBar(crossLowBar));
	chooser.addObject("Reach", new Reach(reach));
	chooser.addObject("Forward Rawto", new ForwardRawtonomous());
	chooser.addObject("Backward Rawto", new BackwardRawtonomous());
	chooser.addObject("Shoot", new AutoShoot());
	SmartDashboard.putData("Auto mode", chooser);

	// Start camera stream
	camera = new USBCamera();
	server = CameraServer.getInstance();
	server.setQuality(40);
	server.startAutomaticCapture(camera);

	// Start compressor
	compressor = new Compressor();
	compressor.start();

	navx = new AHRS(SPI.Port.kMXP);
    }
 
开发者ID:Team236,项目名称:2016-Robot-Final,代码行数:41,代码来源:Robot.java


示例6: 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;
}
 
开发者ID:MontclairRobotics,项目名称:Sprocket,代码行数:22,代码来源:CameraServers.java


示例7: initCameras

import edu.wpi.first.wpilibj.vision.USBCamera; //导入依赖的package包/类
public static void initCameras() {
  if (init) 
  	return;

  bowCam = new USBCamera("cam0");
  sternCam = new USBCamera("cam1");
  //targetCam = new USBCamera("cam2");
  
  init = true;
}
 
开发者ID:FRC-Team-3140,项目名称:FRC-2016,代码行数:11,代码来源:CameraController.java


示例8: TurtwigDoubleVision

import edu.wpi.first.wpilibj.vision.USBCamera; //导入依赖的package包/类
private TurtwigDoubleVision() {
	try {
		sendImage = NIVision.imaqCreateImage(ImageType.IMAGE_RGB, 0);
		cameras.add(new USBCamera("cam0"));
	} catch (Exception e) {
		TurtleLogger.critical("Camera Not found");
		e.printStackTrace();
	}
}
 
开发者ID:FRC1458,项目名称:turtleshell,代码行数:10,代码来源:TurtwigDoubleVision.java



注:本文中的edu.wpi.first.wpilibj.vision.USBCamera类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StatisticsFile类代码示例发布时间:2022-05-22
下一篇:
Java IWXDebugProxy类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap