本文整理汇总了Java中com.ni.vision.NIVision.MeasurementType类的典型用法代码示例。如果您正苦于以下问题:Java MeasurementType类的具体用法?Java MeasurementType怎么用?Java MeasurementType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MeasurementType类属于com.ni.vision.NIVision包,在下文中一共展示了MeasurementType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addCriteria
import com.ni.vision.NIVision.MeasurementType; //导入依赖的package包/类
/**
* Adds a filter to the current list. You can chain criteria by
* using the form: new
* ParticleFilter().addCriteria(a,b,x,y,z).addCriteria(a,b,x,y,z)
* to set multiple filters on the image.
*
* @param type
* the information that is referenced when filtering out blobs.
* @param lower
* The lower range of this measurement type
* @param upper
* The upper range of this measurement type
* @param calibrated
* Set to 1 for calibrated measurements, 0 for pixel measurements
* @param exclude
* Set to 1 to indicate a positive if outside the range, 0 for inside
* the range.
* @return the object you are referencing: so that you can chain criteria
* when adding to the vision script.
*/
public ParticleFilter addCriteria (MeasurementType type, int lower,
int upper, int calibrated, int exclude)
{
// Create a new array that can contain 1 more item than the current,
// and copy all of the current object references into the new array.
// Then, add the new reference to the new array.
ParticleFilterCriteria2[] newCriteriaArray = new ParticleFilterCriteria2[allCriteria.length
+ 1];
System.arraycopy(allCriteria, 0, newCriteriaArray, 0,
allCriteria.length);
newCriteriaArray[newCriteriaArray.length
- 1] = new ParticleFilterCriteria2(type, lower, upper,
calibrated, exclude);
// Set the current array to the new array.
allCriteria = newCriteriaArray;
return this;
}
示例2: addCriteria
import com.ni.vision.NIVision.MeasurementType; //导入依赖的package包/类
public void addCriteria (NIVision.MeasurementType type, float lower,
float upper, boolean calibrated, boolean exclude)
{
int calibratedAsInteger;
if (calibrated == true)
{
calibratedAsInteger = 1;
}
else
{
calibratedAsInteger = 0;
}
int excludeAsInteger;
if (exclude == true)
{
excludeAsInteger = 1;
}
else
{
excludeAsInteger = 0;
}
// Create a new criteria object from our arguments
final ParticleFilterCriteria2 criteria = new ParticleFilterCriteria2(
type, lower, upper,
calibratedAsInteger, excludeAsInteger);
// Create a new criteria array, the size of our old array + 1 to
// accomodate the new one
final ParticleFilterCriteria2[] tempCriteria = new ParticleFilterCriteria2[this.criteriaArray.length
+ 1];
// Copy the old criteria array into our new one
System.arraycopy(this.criteriaArray, 0, tempCriteria, 0,
this.criteriaArray.length);
// set the last value of this new array to the new criteria
tempCriteria[tempCriteria.length - 1] = criteria;
// set the class criteria array to our temporary one that has the new
// entry
this.criteriaArray = tempCriteria;
// this.criteriaCollection.addCriteria(type, lower, upper,
// outsideRange);
}
示例3: addCriteria
import com.ni.vision.NIVision.MeasurementType; //导入依赖的package包/类
public void addCriteria (NIVision.MeasurementType type, float lower,
float upper, boolean calibrated, boolean exclude)
{
int calibratedAsInteger;
if (calibrated == true)
{
calibratedAsInteger = 1;
}
else
{
calibratedAsInteger = 0;
}
int excludeAsInteger;
if (exclude == true)
{
excludeAsInteger = 1;
}
else
{
excludeAsInteger = 0;
}
// Create a new criteria object from our arguments
final ParticleFilterCriteria2 criteria =
new ParticleFilterCriteria2(type, lower, upper,
calibratedAsInteger, excludeAsInteger);
// Create a new criteria array, the size of our old array + 1 to
// accomodate the new one
final ParticleFilterCriteria2[] tempCriteria =
new ParticleFilterCriteria2[this.criteriaArray.length + 1];
// Copy the old criteria array into our new one
System.arraycopy(this.criteriaArray, 0, tempCriteria, 0,
this.criteriaArray.length);
// set the last value of this new array to the new criteria
tempCriteria[tempCriteria.length - 1] = criteria;
// set the class criteria array to our temporary one that has the new
// entry
this.criteriaArray = tempCriteria;
// this.criteriaCollection.addCriteria(type, lower, upper,
// outsideRange);
}