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


Java UByteIndexer类代码示例

本文整理汇总了Java中org.bytedeco.javacpp.indexer.UByteIndexer的典型用法代码示例。如果您正苦于以下问题:Java UByteIndexer类的具体用法?Java UByteIndexer怎么用?Java UByteIndexer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getPixel

import org.bytedeco.javacpp.indexer.UByteIndexer; //导入依赖的package包/类
@Override
public Color getPixel(final int x, final int y) {
    LOG.traceEntry("getPixel(x={}, y={})", x, y);

    final UByteIndexer indexer = matrix.createIndexer();

    try {
        final int blue = indexer.get(y, x, 0);
        final int green = indexer.get(y, x, 1);
        final int red = indexer.get(y, x, 2);

        return LOG.traceExit(new Color(red, green, blue));
    } finally {
        indexer.release();
    }
}
 
开发者ID:neocotic,项目名称:brick-pop-solver,代码行数:17,代码来源:OpenCVImage.java

示例2: makeRandomImage

import org.bytedeco.javacpp.indexer.UByteIndexer; //导入依赖的package包/类
public static ImageWritable makeRandomImage(int height, int width, int channels) {
    if (height <= 0) {
        height = rng.nextInt() % 100 + 200;
    }
    if (width <= 0) {
        width = rng.nextInt() % 100 + 200;
    }
    Mat img = new Mat(height, width, CV_8UC(channels));
    UByteIndexer idx = img.createIndexer();
    for (int i = 0; i < height; i++) {
        for (int j = 0; j < width; j++) {
            for (int k = 0; k < channels; k++) {
                idx.put(i, j, k, rng.nextInt());
            }
        }
    }
    Frame frame = converter.convert(img);
    return new ImageWritable(frame);
}
 
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:20,代码来源:TestImageTransform.java

示例3: makeRandomImage

import org.bytedeco.javacpp.indexer.UByteIndexer; //导入依赖的package包/类
Mat makeRandomImage(int height, int width, int channels) {
    if (height <= 0) {
        height = rng.nextInt() % 100 + 100;
    }
    if (width <= 0) {
        width = rng.nextInt() % 100 + 100;
    }

    Mat img = new Mat(height, width, CV_8UC(channels));
    UByteIndexer idx = img.createIndexer();
    for (int i = 0; i < height; i++) {
        for (int j = 0; j < width; j++) {
            for (int k = 0; k < channels; k++) {
                idx.put(i, j, k, rng.nextInt());
            }
        }
    }
    return img;
}
 
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:20,代码来源:TestNativeImageLoader.java

示例4: bytedecoMatToCVMat

import org.bytedeco.javacpp.indexer.UByteIndexer; //导入依赖的package包/类
/**
 * Converts a bytedeco Mat to an OpenCV Mat.
 *
 * @param input the bytedeco Mat to convert
 * @return an OpenCV Mat
 */
public static Mat bytedecoMatToCVMat(org.bytedeco.javacpp.opencv_core.Mat input) {
  UByteIndexer idxer = input.createIndexer();
  Mat out = new Mat(idxer.rows(), idxer.cols(), CvType.CV_8UC(idxer.channels()));
  //Mat out = new Mat(idxer.rows(),idxer.cols(),input.type());
  for (int row = 0; row < idxer.rows(); row++) {
    for (int col = 0; col < idxer.cols(); col++) {
      byte[] data = new byte[3];
      for (int channel = 0; channel < idxer.channels(); channel++) {
        data[channel] = (byte) (idxer.get(row, col, channel) & 0xFF);
      }
      out.put(row, col, data);
    }
  }
  return out;
}
 
开发者ID:WPIRoboticsProjects,项目名称:GRIP,代码行数:22,代码来源:HelperTools.java

示例5: init

import org.bytedeco.javacpp.indexer.UByteIndexer; //导入依赖的package包/类
private void init() {
    validPointsPImage = papplet.createImage(getDepthWidth(), getDepthHeight(), PConstants.RGB);
    nativeArrayToErode = IplImage.create(getDepthWidth(), getDepthHeight(), IPL_DEPTH_8U, 1);
    erosionIndexer = (UByteIndexer) nativeArrayToErode.createIndexer();
    validCopy = Arrays.copyOf(depthData.validPointsMask, depthData.validPointsMask.length);
}
 
开发者ID:poqudrof,项目名称:PapARt,代码行数:7,代码来源:KinectProcessing.java


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