• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java VisionOpMode类的典型用法和代码示例

java 4次浏览

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

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

示例1: stop

点赞 3

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@SuppressWarnings("AccessStaticViaInstance")
@Override
public void stop(VisionOpMode opmode) {
    if (opmode.openCVCamera == null)
        return;

    Camera.Parameters p = opmode.openCVCamera.getCamera().getParameters();

    if (p.isAutoWhiteBalanceLockSupported())
        p.setAutoWhiteBalanceLock(false);
    if (p.isAutoExposureLockSupported())
        p.setAutoExposureLock(false);

    //Update camera parameters
    try {
        opmode.openCVCamera.getCamera().setParameters(p);
    } catch (RuntimeException e) {
        //Sometimes, we fail to set the parameters
        e.printStackTrace();
    }
}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:22,
代码来源:CameraControlExtension.java

示例2: frame

点赞 3

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@Override
public Mat frame(VisionOpMode opmode, Mat rgba, Mat gray) {
    try {
        //Get screen orientation data
        ScreenOrientation orientation = ScreenOrientation.getFromAngle(
                VisionOpMode.rotation.getRotationCompensationAngle());

        //Get color analysis
        this.analysis = beacon.analyzeFrame(rgba, gray, orientation);

    } catch (Exception e) {
        e.printStackTrace();
    }

    return rgba;
}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:17,
代码来源:BeaconExtension.java

示例3: init

点赞 2

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@Override
public void init(VisionOpMode opmode) {
    paramsSet = false;
    colorTemp = ColorTemperature.AUTO;
    expoComp = 0;
    autoExpoComp = true;
}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:8,
代码来源:CameraControlExtension.java

示例4: frame

点赞 2

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@Override
public Mat frame(VisionOpMode opmode, Mat rgba, Mat gray) {
    if (isInverted)
        Transform.flip(rgba, Transform.FlipType.FLIP_ACROSS_X);
    if (zeroOrientation != ScreenOrientation.LANDSCAPE)
        Transform.rotate(rgba, zeroOrientation.getAngle());
    return rgba;
}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:9,
代码来源:ImageRotationExtension.java

示例5: frame

点赞 2

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@Override
@SuppressWarnings("AccessStaticViaInstance")
public Mat frame(VisionOpMode opmode, Mat rgba, Mat gray) {
    if (opmode.openCVCamera == null)
        paramsSet = false;
    if (paramsSet || opmode.openCVCamera == null) return rgba;

    Camera.Parameters p = opmode.openCVCamera.getCamera().getParameters();

    //Get camera info
    this.minExpo = p.getMinExposureCompensation();
    this.maxExpo = p.getMaxExposureCompensation();
    expoComp = (int) MathUtil.coerce(minExpo, maxExpo, expoComp);

    //Set white balance
    p.setWhiteBalance(colorTemp.s);
    if (p.isAutoWhiteBalanceLockSupported())
        p.setAutoWhiteBalanceLock(colorTemp.lock);
    else
        Log.w("Vision", "Manual white balance not supported.");

    //Set exposure compensation
    if (!autoExpoComp)
        p.setExposureCompensation(expoComp);
    if (p.isAutoExposureLockSupported())
        p.setAutoExposureLock(!autoExpoComp);
    else
        Log.w("Vision", "Manual exposure compensation not supported.");

    //Update camera parameters
    try {
        opmode.openCVCamera.getCamera().setParameters(p);
    } catch (RuntimeException e) {
        //Sometimes, we fail to set the parameters
        e.printStackTrace();
        paramsSet = false;
        return rgba;
    }
    paramsSet = true;

    return rgba;
}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:43,
代码来源:CameraControlExtension.java

示例6: init

点赞 2

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@Override
public void init(VisionOpMode opmode) {
    sensors.resume();
}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:5,
代码来源:ImageRotationExtension.java

示例7: stop

点赞 2

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@Override
public void stop(VisionOpMode opmode) {
    sensors.stop();
}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:5,
代码来源:ImageRotationExtension.java

示例8: init

点赞 2

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@Override
public void init(VisionOpMode opmode) {
    //Initialize all detectors here
    beacon = new Beacon();
}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:6,
代码来源:BeaconExtension.java

示例9: loop

点赞 1

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@Override
public void loop(VisionOpMode opmode) {

}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:5,
代码来源:CameraControlExtension.java

示例10: stop

点赞 1

import org.lasarobotics.vision.opmode.VisionOpMode; //导入依赖的package包/类
@Override
public void stop(VisionOpMode opmode) {

}
 

开发者ID:ykarim,
项目名称:FTC2016,
代码行数:5,
代码来源:BeaconExtension.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)