本文整理汇总了Java中edu.wpi.first.wpilibj.image.NIVisionException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java NIVisionException.printStackTrace方法的具体用法?Java NIVisionException.printStackTrace怎么用?Java NIVisionException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.image.NIVisionException
的用法示例。
在下文中一共展示了NIVisionException.printStackTrace方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateImage
import edu.wpi.first.wpilibj.image.NIVisionException; //导入方法依赖的package包/类
/**
* Captures an image from the camera given to the class.
*/
public void updateImage ()
{
try
{
if (this.camera.freshImage() == true)
{
this.currentImage = this.camera.getImage().image;
this.newImageIsFresh = true;
}
else
{
this.newImageIsFresh = false;
}
}
catch (final NIVisionException e)
{
// Auto-generated catch block
e.printStackTrace();
}
}
示例2: updateImage
import edu.wpi.first.wpilibj.image.NIVisionException; //导入方法依赖的package包/类
/**
* Captures an image from the camera given to the class.
*/
public void updateImage ()
{
try
{
if (this.camera.freshImage() == true)
{
this.currentImage = this.camera.getImage().image;
this.newImageIsFresh = true;
}
else
{
this.newImageIsFresh = false;
}
}// TODO @AHK only process new images
catch (final NIVisionException e)
{
// Auto-generated catch block
e.printStackTrace();
}
}
示例3: getTargetType
import edu.wpi.first.wpilibj.image.NIVisionException; //导入方法依赖的package包/类
/**
* @param particle the blob found in image processing
* @return target type( Top, Middle)
* calculates type of target based on width to height ratios
*/
String getTargetType(int particle) {
String target = "not set";
try {
ParticleAnalysisReport report = newFilteredImage.getParticleAnalysisReport(particle);
int blobWidth = report.boundingRectWidth;
int blobHeight = report.boundingRectHeight;
if (blobWidth / blobHeight > (topWidth / topHeight - 1) && blobWidth / blobHeight < (topWidth / topHeight + 1)) {
target = "Top target";
} else if (blobWidth / blobHeight > (middleWidth / middleHeight - 1) && blobWidth / blobHeight < (middleWidth / middleHeight + 1)) {
target = "Middle Target";
} else {
target = "Not Top/Middle";
}
} catch (NIVisionException ex) {
ex.printStackTrace();
}
return target;
}
示例4: getHSVimage
import edu.wpi.first.wpilibj.image.NIVisionException; //导入方法依赖的package包/类
public BinaryImage getHSVimage(ColorImage image){
try{
this.HSVimage = image.thresholdHSV(92, 196, 19, 100, 30, 100);
} catch (NIVisionException ex) {
ex.printStackTrace();
}
System.out.println("Processed HSV image");
return this.HSVimage;
}
示例5: getRGBimage
import edu.wpi.first.wpilibj.image.NIVisionException; //导入方法依赖的package包/类
public BinaryImage getRGBimage(ColorImage image) {
try{
this.RGBimage = image.thresholdRGB(0, 150, 145, 230, 120, 225);
} catch (NIVisionException ex) {
ex.printStackTrace();
}
System.out.println("Processing RGB image");
return this.RGBimage;
}