本文整理汇总了Java中com.ni.vision.NIVision.imaqSizeFilter方法的典型用法代码示例。如果您正苦于以下问题:Java NIVision.imaqSizeFilter方法的具体用法?Java NIVision.imaqSizeFilter怎么用?Java NIVision.imaqSizeFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ni.vision.NIVision
的用法示例。
在下文中一共展示了NIVision.imaqSizeFilter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: operate
import com.ni.vision.NIVision; //导入方法依赖的package包/类
@Override
public Image operate (Image source)
{
Image alteredImage = null;
if (this.connectivity8 == true)
{
NIVision.imaqSizeFilter(alteredImage, source, 0, this.erosions,
NIVision.SizeType.KEEP_SMALL,
new NIVision.StructuringElement(
3, 3, 0));
}
else
{
NIVision.imaqSizeFilter(alteredImage, source, 1, this.erosions,
NIVision.SizeType.KEEP_SMALL,
new NIVision.StructuringElement(
3, 3, 0));
}
source.free();
return alteredImage;
}
示例2: operate
import com.ni.vision.NIVision; //导入方法依赖的package包/类
@Override
public Image operate (Image Source)
{
if (this.connectivity8 == true)
{
NIVision.imaqSizeFilter(Source, Source, 0, this.erosions,
NIVision.SizeType.KEEP_SMALL, new NIVision.StructuringElement(
3, 3, 0));
}
else
{
NIVision.imaqSizeFilter(Source, Source, 1, this.erosions,
NIVision.SizeType.KEEP_SMALL, new NIVision.StructuringElement(
3, 3, 0));
}
return Source;
}
示例3: operate
import com.ni.vision.NIVision; //导入方法依赖的package包/类
@Override
public Image operate (Image Source)
{
final Image largeObjectsImage = NIVision
.imaqCreateImage(ImageType.IMAGE_U8, 0);
try
{
if (this.connectivity8 == true)
{
// final Image newImage =
// NIVision.imaqCreateImage(ImageType.IMAGE_U8, 1);
// NIVision.imaqDuplicate(newImage, Source);
NIVision.imaqSetBorderSize(Source, 1);
NIVision.imaqSizeFilter(largeObjectsImage, Source, 1,
this.erosions,
NIVision.SizeType.KEEP_LARGE, null);// @AHK F**K it
// adjustment
// new NIVision.StructuringElement(3, 3, 0));
// Source.free();
// return newImage;
}
else
{
NIVision.imaqSizeFilter(largeObjectsImage, Source, 0,
this.erosions,
NIVision.SizeType.KEEP_LARGE, null
/* new NIVision.StructuringElement(3, 3, 0) */);
System.out.println("Other. Working???");
}
}
catch (final Exception ex)
{
ex.printStackTrace();
}
Source.free();
return largeObjectsImage;
}
示例4: operate
import com.ni.vision.NIVision; //导入方法依赖的package包/类
@Override
public Image operate (Image Source)
{
final Image largeObjectsImage = NIVision
.imaqCreateImage(ImageType.IMAGE_U8, 0);
try
{
if (this.connectivity8 == true)
{
// final Image newImage =
// NIVision.imaqCreateImage(ImageType.IMAGE_U8, 1);
// NIVision.imaqDuplicate(newImage, Source);
NIVision.imaqSetBorderSize(Source, 1);
NIVision.imaqSizeFilter(largeObjectsImage, Source, 1,
this.erosions,
NIVision.SizeType.KEEP_LARGE, null);// @AHK F**K it
// adjustment
// new NIVision.StructuringElement(3, 3, 0));
// Source.free();
System.out.println("Good. Working???");
// return newImage;
}
else
{
NIVision.imaqSizeFilter(largeObjectsImage, Source, 0,
this.erosions,
NIVision.SizeType.KEEP_LARGE, null
/* new NIVision.StructuringElement(3, 3, 0) */);
System.out.println("Other. Working???");
}
}
catch (final Exception ex)
{
ex.printStackTrace();
}
Source.free();
return largeObjectsImage;
}
示例5: removeSmallObjects
import com.ni.vision.NIVision; //导入方法依赖的package包/类
/**
* removeSmallObjects filters particles based on their size. The algorithm
* erodes the image a specified number of times and keeps the particles from
* the original image that remain in the eroded image.
*
* @param connectivity8 true to use connectivity-8 or false for connectivity-4
* to determine whether particles are touching. For more information
* about connectivity, see Chapter 9, Binary Morphology, in the NI
* Vision Concepts manual.
* @param erosions the number of erosions to perform
* @return a BinaryImage after applying the filter
*/
public BinaryImage removeSmallObjects(boolean connectivity8, int erosions)
throws NIVisionException {
BinaryImage result = new BinaryImage();
NIVision.imaqSizeFilter(result.image, image, connectivity8 ? 1 : 0, erosions,
NIVision.SizeType.KEEP_LARGE, null);
result.free();
return result;
}
示例6: removeLargeObjects
import com.ni.vision.NIVision; //导入方法依赖的package包/类
/**
* removeLargeObjects filters particles based on their size. The algorithm
* erodes the image a specified number of times and discards the particles
* from the original image that remain in the eroded image.
*
* @param connectivity8 true to use connectivity-8 or false for connectivity-4
* to determine whether particles are touching. For more information
* about connectivity, see Chapter 9, Binary Morphology, in the NI
* Vision Concepts manual.
* @param erosions the number of erosions to perform
* @return a BinaryImage after applying the filter
*/
public BinaryImage removeLargeObjects(boolean connectivity8, int erosions)
throws NIVisionException {
BinaryImage result = new BinaryImage();
NIVision.imaqSizeFilter(result.image, image, connectivity8 ? 1 : 0, erosions,
NIVision.SizeType.KEEP_SMALL, null);
return result;
}