当前位置: 首页>>代码示例>>Java>>正文


Java NIVision.imaqSizeFilter方法代码示例

本文整理汇总了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;
}
 
开发者ID:FIRST-Team-339,项目名称:2017,代码行数:22,代码来源:RemoveLargeObjectsOperator.java

示例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;
    }
 
开发者ID:FIRST-Team-339,项目名称:2016,代码行数:18,代码来源:RemoveLargeObjectsOperator.java

示例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;
}
 
开发者ID:FIRST-Team-339,项目名称:2017,代码行数:40,代码来源:RemoveSmallObjectsOperator.java

示例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;
}
 
开发者ID:FIRST-Team-339,项目名称:2016,代码行数:41,代码来源:RemoveSmallObjectsOperator.java

示例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;
}
 
开发者ID:trc492,项目名称:Frc2016FirstStronghold,代码行数:21,代码来源:BinaryImage.java

示例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;
}
 
开发者ID:trc492,项目名称:Frc2016FirstStronghold,代码行数:20,代码来源:BinaryImage.java


注:本文中的com.ni.vision.NIVision.imaqSizeFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。