本文整理汇总了Java中com.ni.vision.NIVision.imaqGetImageSize方法的典型用法代码示例。如果您正苦于以下问题:Java NIVision.imaqGetImageSize方法的具体用法?Java NIVision.imaqGetImageSize怎么用?Java NIVision.imaqGetImageSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ni.vision.NIVision
的用法示例。
在下文中一共展示了NIVision.imaqGetImageSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateParticalAnalysisReports
import com.ni.vision.NIVision; //导入方法依赖的package包/类
/**
* Takes the processed image and writes information on each particle (blob) into
* the global <reports> array, in order of overall particle area.
*/
public void updateParticalAnalysisReports ()
{
if (this.camera.gethaveCamera() == true
&& this.currentImage != null)
{
final int numParticles = NIVision
.imaqCountParticles(this.currentImage, 0);
// Measure particles and sort by particle size
final Vector<ParticleReport> particles = new Vector<ParticleReport>();
if (numParticles > 0)
{
for (int particleIndex = 0; particleIndex < numParticles; particleIndex++)
{
final ParticleReport particle = new ParticleReport();
particle.PercentAreaToImageArea = NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA);
particle.area = NIVision.imaqMeasureParticle(
this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_AREA);
particle.ConvexHullArea = NIVision
.imaqMeasureParticle(
this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_CONVEX_HULL_AREA);
particle.boundingRectTop = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_TOP);
particle.boundingRectLeft = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_LEFT);
particle.boundingRectBottom = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_BOTTOM);
particle.boundingRectRight = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_RIGHT);
particle.boundingRectWidth = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_WIDTH);// par.boundingRectRight
// -
// par.boundingRectLeft;
particle.center_mass_x = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_CENTER_OF_MASS_X);
particle.center_mass_y = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_CENTER_OF_MASS_Y);
particle.imageWidth = NIVision
.imaqGetImageSize(this.currentImage).width;
particles.add(particle);
}
particles.sort(null);
}
this.reports = new ParticleReport[particles.size()];
particles.copyInto(this.reports);
particles.clear();
}
}
示例2: updateParticalAnalysisReports
import com.ni.vision.NIVision; //导入方法依赖的package包/类
/**
* Takes the processed image and writes information on each particle (blob) into
* the global <reports> array, in order of overall particle area.
*/
public void updateParticalAnalysisReports ()
{
if (this.camera.gethaveCamera() == true
&& this.currentImage != null)
{
final int numParticles = NIVision
.imaqCountParticles(this.currentImage, 0);
System.out.println("Object removal blobs: " +
NIVision.imaqCountParticles(this.currentImage, 0));
// Measure particles and sort by particle size
final Vector<ParticleReport> particles = new Vector<ParticleReport>();
if (numParticles > 0)
{
for (int particleIndex = 0; particleIndex < numParticles; particleIndex++)
{
final ParticleReport particle = new ParticleReport();
particle.PercentAreaToImageArea = NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_AREA_BY_IMAGE_AREA);
particle.area = NIVision.imaqMeasureParticle(
this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_AREA);
particle.ConvexHullArea = NIVision
.imaqMeasureParticle(
this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_CONVEX_HULL_AREA);
particle.boundingRectTop = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_TOP);
particle.boundingRectLeft = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_LEFT);
particle.boundingRectBottom = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_BOTTOM);
particle.boundingRectRight = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_RIGHT);
particle.boundingRectWidth = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_BOUNDING_RECT_WIDTH);// par.boundingRectRight
// -
// par.boundingRectLeft;
particle.center_mass_x = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_CENTER_OF_MASS_X);
particle.center_mass_y = (int) NIVision
.imaqMeasureParticle(this.currentImage,
particleIndex, 0,
NIVision.MeasurementType.MT_CENTER_OF_MASS_Y);
particle.imageWidth = NIVision
.imaqGetImageSize(this.currentImage).width;
particles.add(particle);
}
particles.sort(null);
}
this.reports = new ParticleReport[particles.size()];
particles.copyInto(this.reports);
}
}
示例3: getHeight
import com.ni.vision.NIVision; //导入方法依赖的package包/类
/**
* Get the height of the image in pixels.
*$
* @return The height of the image.
*/
public int getHeight() throws NIVisionException {
return NIVision.imaqGetImageSize(image).height;
}
示例4: getWidth
import com.ni.vision.NIVision; //导入方法依赖的package包/类
/**
* Get the width of the image in pixels.
*$
* @return The width of the image.
*/
public int getWidth() throws NIVisionException {
return NIVision.imaqGetImageSize(image).width;
}