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; }
/** Enable debug drawing. Use this on testing apps only, not the robot controller. */ public void enableDebug() { beacon.enableDebug(); }
/** Disable debug drawing (default). Use this on the robot controller. */ public void disableDebug() { beacon.disableDebug(); }
/** * Set analysis bounds Areas of the image outside of the bounded area will not be processed * * @param bounds A rectangle containing the boundary */ public void setAnalysisBounds(Rectangle bounds) { beacon.setAnalysisBounds(bounds); }
/** * Set color tolerance for blue beacon detector * * @param tolerance A color tolerance value from -1 to 1, where 0 is unmodified, 1 is maximum * tolerance (more colors detect as blue), -1 is minimum (fery vew colors detect as blue) */ public void setColorToleranceBlue(double tolerance) { beacon.setColorToleranceBlue(tolerance); }
/** * Set color tolerance for red beacon detector * * @param tolerance A color tolerance value from -1 to 1, where 0 is unmodified, 1 is maximum * tolerance (more colors detect as red), -1 is minimum (fery vew colors detect as red) */ public void setColorToleranceRed(double tolerance) { beacon.setColorToleranceRed(tolerance); }
/** * Set the analysis method to use for beacon analysis * * @param method Analysis method to use */ public void setAnalysisMethod(Beacon.AnalysisMethod method) { beacon.setAnalysisMethod(method); }
/** * Get the currently used analysis method * * @return Analysis method */ public Beacon.AnalysisMethod getAnalysisMethod() { return beacon.getAnalysisMethod(); }