当前位置: 首页>>代码示例>>Java>>正文


Java VuforiaLocalizer类代码示例

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


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

示例1: FtcVuforia

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
/**
 * Constructor: Create an instance of this object. It initializes Vuforia with the specified target images and
 * other parameters.
 *
 * @param licenseKey specifies the Vuforia license key.
 * @param cameraViewId specifies the camera view ID on the activity, -1 if none given.
 * @param cameraDir specifies which camera to use (front or back).
 * @param trackablesFile specifies the XML file that contains the target info, can be null.
 * @param numTargets specifies the number of simultaneous trackable targets.
 * @param cameraMonitorFeedback specifies the feedback image showing the orientation of the target.
 */
public FtcVuforia(
        String licenseKey, int cameraViewId, VuforiaLocalizer.CameraDirection cameraDir,
        String trackablesFile, int numTargets,
        VuforiaLocalizer.Parameters.CameraMonitorFeedback cameraMonitorFeedback)
{
    this.cameraDir = cameraDir;
    //
    // If no camera view ID, do not activate camera monitor view to save power.
    //
    VuforiaLocalizer.Parameters params =
            cameraViewId == -1? new VuforiaLocalizer.Parameters(): new VuforiaLocalizer.Parameters(cameraViewId);
    params.vuforiaLicenseKey = licenseKey;
    params.cameraDirection = cameraDir;
    params.cameraMonitorFeedback = cameraMonitorFeedback;
    localizer = ClassFactory.createVuforiaLocalizer(params);
    Vuforia.setHint(HINT.HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS, numTargets);
    if (trackablesFile != null)
    {
        targetList = localizer.loadTrackablesFromAsset(trackablesFile);
    }
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:33,代码来源:FtcVuforia.java

示例2: setupVuforia

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
public void setupVuforia()
{

	parameters = new VuforiaLocalizer.Parameters(R.id.cameraMonitorViewId); //remove parameters to hide phone tracking
	parameters.vuforiaLicenseKey = VUFORIA_KEY;
	parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;
	parameters.useExtendedTracking = false; //extended tracking is quite inaccurate
	vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);
	
	visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");

	relicVuMark = visionTargets.get(0);
	relicVuMark.setName("RelicVuMark");
	relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));
	
	phoneLocation = createMatrix(0,0,0,0,0,0);
	
	listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();
	listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);
	
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:22,代码来源:Vuforia.java

示例3: setupVuforia

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
public void setupVuforia()
{
    parameters = new VuforiaLocalizer.Parameters(); //remove parameters to hide phone tracking
    parameters.vuforiaLicenseKey = VUFORIA_KEY;
    parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;
    parameters.useExtendedTracking = true; //extended tracking is quite inaccurate
    vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);

    visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");

    relicVuMark = visionTargets.get(0);
    relicVuMark.setName("RelicVuMark");
    //relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));

    //phoneLocation = createMatrix(0,0,0,0,0,0);

    listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();
    //listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:20,代码来源:Navi.java

示例4: setupVuforia

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
public void setupVuforia()
{
    parameters = new VuforiaLocalizer.Parameters(R.id.cameraMonitorViewId); //remove parameters to hide phone tracking
    parameters.vuforiaLicenseKey = VUFORIA_KEY;
    parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;
    parameters.useExtendedTracking = true; //extended tracking can be inaccurate

    vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);
    visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");

    relicVuMark = visionTargets.get(0);
    relicVuMark.setName("RelicRecovery");
    relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));

    phoneLocation = createMatrix(0,0,0,0,0,0);

    listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();
    listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:20,代码来源:MecanumDebug.java

示例5: setupVuforia

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
public void setupVuforia()
{

    parameters = new VuforiaLocalizer.Parameters(R.id.cameraMonitorViewId); //remove parameters to hide phone tracking
    parameters.vuforiaLicenseKey = VUFORIA_KEY;
    parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;
    parameters.useExtendedTracking = false; //extended tracking is quite inaccurate
    vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);

    visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");

    relicVuMark = visionTargets.get(0);
    relicVuMark.setName("RelicVuMark");
    relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));

    phoneLocation = createMatrix(0,0,0,0,0,0);

    listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();
    listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);

}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:22,代码来源:BasicVuforia.java

示例6: getImageFromFrame

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
@Nullable
public static Image getImageFromFrame(VuforiaLocalizer.CloseableFrame frame, int format) {

    long numImgs = frame.getNumImages();
    for (int i = 0; i < numImgs; i++) {
        if (frame.getImage(i).getFormat() == format) {
            return frame.getImage(i);
        }
    }

    return null;
}
 
开发者ID:ykarim,项目名称:FTC2016,代码行数:13,代码来源:BeaconUtils.java

示例7: initVuforia

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
private VuforiaLocalizer.Parameters initVuforia () {
    VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters();
    parameters.cameraDirection = VuforiaLocalizer.CameraDirection.FRONT;
    parameters.vuforiaLicenseKey = licenseKey;
    parameters.cameraMonitorFeedback = VuforiaLocalizer.Parameters.CameraMonitorFeedback.AXES;
    return parameters;
}
 
开发者ID:ykarim,项目名称:FTC2016,代码行数:8,代码来源:AutoVuforiaNav.java

示例8: getFrame

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
/**
 * This method gets a frame from the frame queue and returns the image that matches the format specified by the
 * configVideoSource method.
 *
 * @param frame specifies the frame object to hold image.
 * @return true if success, false otherwise.
 */
@Override
public boolean getFrame(Mat frame)
{
    boolean success = false;

    try
    {
        VuforiaLocalizer.CloseableFrame closeableFrame = localizer.getFrameQueue().take();

        for (int i = 0; i < closeableFrame.getNumImages(); i++)
        {
            Image image = closeableFrame.getImage(i);
            if (image.getWidth() == imageWidth && image.getHeight() == imageHeight &&
                    image.getFormat() == PIXEL_FORMAT.RGB565)
            {
                Bitmap bm = Bitmap.createBitmap(image.getWidth(), image.getHeight(), Bitmap.Config.RGB_565);
                bm.copyPixelsFromBuffer(image.getPixels());
                Utils.bitmapToMat(bm, frame);
                break;
            }
        }

        closeableFrame.close();
        success = true;
    }
    catch (InterruptedException e)
    {
        e.printStackTrace();
    }

    return success;
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:40,代码来源:FtcVuforia.java

示例9: VuforiaVision

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
public VuforiaVision(Robot robot, int cameraViewId)
{
    final String VUFORIA_LICENSE_KEY =
            "AdCwzDH/////AAAAGeDkDS3ukU9+lIXc19LMh+cKk29caNhOl8UqmZOymRGwVwT1ZN8uaPdE3Q+zceDu9AKNsqL9qLblSFV" +
            "/x8Y3jfOZdjMFs0CQSQOEyWv3xfJsdSmevXDQDQr+4KI31HY2YSf/KB/kyxfuRMk4Pi+vWS+oLl65o7sWPiyFgzoM74ENyb" +
            "j4FgteD/2b6B+UFuwkHWKBNpp18wrpkaiFfr/FCbRFcdWP5mrjlEZM6eOj171dybw97HPeZbGihnnxOeeUv075O7P167AVq" +
            "aiPy2eRK7OCubR32KXOqQKoyF6AXp+qu2cOTApXS5dqOOseEm+HE4eMF0S2Pld3i5AWBIR+JlPXDuc9LwoH2Q8iDwUK1+4g";
    final VuforiaLocalizer.CameraDirection CAMERA_DIR = VuforiaLocalizer.CameraDirection.BACK;
    final String TRACKABLES_FILE = "RelicVuMark";

    this.robot = robot;
    vuforia = new FtcVuforia(VUFORIA_LICENSE_KEY, cameraViewId, CAMERA_DIR, TRACKABLES_FILE, 1);
    vuforia.setTargetInfo(0, "relicVuMarkTemplate");
    vuforia.configVideoSource(IMAGE_WIDTH, IMAGE_HEIGHT, FRAME_QUEUE_CAPACITY);
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:16,代码来源:VuforiaVision.java

示例10: build

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
@NonNull
public static VuforiaLocalizer build(@NotNull String apiKey, @NotNull VuforiaLocalizer.CameraDirection direction, @IdRes int viewId, boolean extendingTracking) {
    final VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters(viewId);
    parameters.cameraDirection = direction;
    parameters.vuforiaLicenseKey = apiKey;
    parameters.useExtendedTracking = extendingTracking;
    return ClassFactory.createVuforiaLocalizer(parameters);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:9,代码来源:Vuforia.java

示例11: VuforiaLocalizerBuilder

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
public VuforiaLocalizerBuilder(@NotNull String apiKey) {
    this.apiKey = apiKey;
    parameters = new VuforiaLocalizer.Parameters();
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:5,代码来源:Vuforia.java

示例12: setCameraDirection

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
public VuforiaLocalizerBuilder setCameraDirection(VuforiaLocalizer.CameraDirection cameraDirection) {
    parameters.cameraDirection = cameraDirection;
    return this;
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:5,代码来源:Vuforia.java

示例13: setupVuforia

import org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer; //导入依赖的package包/类
public void setupVuforia()

    {



        parameters = new VuforiaLocalizer.Parameters(R.id.cameraMonitorViewId); //remove parameters to hide phone tracking

        parameters.vuforiaLicenseKey = VUFORIA_KEY;

        parameters.cameraDirection = VuforiaLocalizer.CameraDirection.BACK;

        parameters.useExtendedTracking = true; //extended tracking can be inaccurate

        vuforiaLocalizer = ClassFactory.createVuforiaLocalizer(parameters);



        visionTargets = vuforiaLocalizer.loadTrackablesFromAsset("RelicVuMark");



        relicVuMark = visionTargets.get(0);

        relicVuMark.setName("RelicRecovery");

        relicVuMark.setLocation(createMatrix(0,0,0,0,0,0));



        phoneLocation = createMatrix(0,0,0,0,0,0);



        listener = (VuforiaTrackableDefaultListener) relicVuMark.getListener();

        listener.setPhoneInformation(phoneLocation, parameters.cameraDirection);



    }
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:42,代码来源:FollowVuMark.java


注:本文中的org.firstinspires.ftc.robotcore.external.navigation.VuforiaLocalizer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。