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


Java ByteProcessor.invert方法代码示例

本文整理汇总了Java中ij.process.ByteProcessor.invert方法的典型用法代码示例。如果您正苦于以下问题:Java ByteProcessor.invert方法的具体用法?Java ByteProcessor.invert怎么用?Java ByteProcessor.invert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ij.process.ByteProcessor的用法示例。


在下文中一共展示了ByteProcessor.invert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFeatures

import ij.process.ByteProcessor; //导入方法依赖的package包/类
@Override
public double[] getFeatures (Glyph glyph,
                             int interline)
{
    final ByteProcessor buffer = ScaledBuffer.getBuffer(glyph, interline);
    buffer.invert(); // 0 for background, 255 for foreground

    // Layout: row by row
    final double[] doubles = new double[length()];
    int i = 0;

    for (int y = 0; y < ScaledBuffer.HEIGHT; y++) {
        for (int x = 0; x < ScaledBuffer.WIDTH; x++) {
            doubles[i++] = buffer.get(x, y);
        }
    }

    return doubles;
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:20,代码来源:ImgGlyphDescriptor.java

示例2: testInclude

import ij.process.ByteProcessor; //导入方法依赖的package包/类
/**
 * Test of include method, of class RunTable.
 */
@Test
public void testInclude ()
{
    System.out.println("\n+++ include");

    RunTable instance = createHorizontalInstance();
    System.out.println("initial:\n" + instance.dumpOf());

    ByteProcessor buffer = instance.getBuffer();
    buffer.invert();

    GlobalFilter filter = new GlobalFilter(buffer, 127);
    RunTableFactory factory = new RunTableFactory(HORIZONTAL);
    RunTable that = factory.createTable(filter.filteredImage());
    System.out.println("inverted:\n" + that.dumpOf());
    that.dumpSequences();

    instance.include(that);
    System.out.println("full:\n" + instance.dumpOf());
    instance.dumpSequences();
    assertEquals(5, instance.getTotalRunCount());
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:26,代码来源:RunTableTest.java

示例3: clearBoundary

import ij.process.ByteProcessor; //导入方法依赖的package包/类
/**
	 * Starting from all white pixels (value = 255) on a ROI's boundary,
	 * fill the pixels with black
	 * 
	 * @param bp
	 * @param roi
	 * @param clearValue
	 */
	public static void clearBoundary(ByteProcessor bp, Roi roi, double clearValue) {
		ByteProcessor bpEdgeMask = new ByteProcessor(bp.getWidth(), bp.getHeight());
		bpEdgeMask.setValue(255);
		if (roi == null)
			bpEdgeMask.fill();
		else {
			bpEdgeMask.fill(roi);
		}
		bpEdgeMask.filter(ByteProcessor.MIN);
		bpEdgeMask.invert();
		bpEdgeMask.copyBits(bp, 0, 0, Blitter.AND);
		bpEdgeMask = MorphologicalReconstruction.binaryReconstruction(bpEdgeMask, bp, false);
		bp.copyBits(bpEdgeMask, 0, 0, Blitter.SUBTRACT);
//
//		ImagePlus imp = new ImagePlus("Edge", bp.duplicate());
//		imp.setRoi(roi);
//		imp.show();

//		ByteProcessor bpEdgeMask = new ByteProcessor(bp.getWidth(), bp.getHeight());
//		bpEdgeMask.setValue(255);
//		bpEdgeMask.setLineWidth(2);
//		if (roi == null)
//			bpEdgeMask.draw(new Roi(0, 0, bp.getWidth(), bp.getHeight()));
//		else
//			bpEdgeMask.draw(roi);
//		bpEdgeMask.copyBits(bp, 0, 0, Blitter.AND);
//		bpEdgeMask = MorphologicalReconstruction.binaryReconstruction(bpEdgeMask, bp, false);
//		bp.copyBits(bpEdgeMask, 0, 0, Blitter.SUBTRACT);
//		new ImagePlus("Edge", bp.duplicate()).show();
	}
 
开发者ID:qupath,项目名称:qupath,代码行数:39,代码来源:ROILabeling.java

示例4: erode

import ij.process.ByteProcessor; //导入方法依赖的package包/类
private void erode(ByteProcessor ip, int[][] H) {
	// dilates the background
	ip.invert();
	dilate(ip, reflect(H));
	ip.invert();
}
 
开发者ID:imagingbook,项目名称:imagingbook-common,代码行数:7,代码来源:BinaryMorphologyFilter.java


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