gpt4 book ai didi

org.openimaj.video.xuggle.XuggleVideo.getNextFrame()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 12:53:05 24 4
gpt4 key购买 nike

本文整理了Java中org.openimaj.video.xuggle.XuggleVideo.getNextFrame()方法的一些代码示例,展示了XuggleVideo.getNextFrame()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XuggleVideo.getNextFrame()方法的具体详情如下:
包路径:org.openimaj.video.xuggle.XuggleVideo
类名称:XuggleVideo
方法名:getNextFrame

XuggleVideo.getNextFrame介绍

暂无

代码示例

代码示例来源:origin: openimaj/openimaj

@Override
public MBFImage getNextFrame() {
  return vid.getNextFrame();
}

代码示例来源:origin: org.openimaj/xuggle-video

/**
 * {@inheritDoc}
 *
 * @see org.openimaj.video.Video#getCurrentFrame()
 */
@Override
public MBFImage getCurrentFrame() {
  if (this.currentMBFImage == null)
    this.currentMBFImage = this.getNextFrame();
  return this.currentMBFImage;
}

代码示例来源:origin: openimaj/openimaj

/**
 * {@inheritDoc}
 *
 * @see org.openimaj.video.Video#getCurrentFrame()
 */
@Override
public MBFImage getCurrentFrame() {
  if (this.currentMBFImage == null)
    this.currentMBFImage = this.getNextFrame();
  return this.currentMBFImage;
}

代码示例来源:origin: org.openimaj/data-scraping

@Override
public MBFImage getNextFrame() {
  return vid.getNextFrame();
}

代码示例来源:origin: openimaj/openimaj

/**
 * Implements a precise seeking mechanism based on the Xuggle seek method
 * and the naive seek method which simply reads frames.
 * <p>
 * Note: if you created the video from a {@link DataInput} or
 * {@link InputStream}, you can only seek forwards.
 *
 * @param timestamp
 *            The timestamp to get, in seconds.
 */
public void seekPrecise(double timestamp) {
  // Use the Xuggle seek method first to get near the frame
  this.seek(timestamp);
  // The timestamp field is in milliseconds, so we need to * 1000 to
  // compare
  timestamp *= 1000;
  // Work out the number of milliseconds per frame
  final double timePerFrame = 1000d / this.fps;
  // If we're not in the right place, keep reading until we are.
  // Note the right place is the frame before the timestamp we're given:
  // |---frame 1---|---frame2---|---frame3---|
  // ^- given timestamp
  // ... so we should show frame2 not frame3.
  while (this.timestamp <= timestamp - timePerFrame && this.getNextFrame() != null)
    ;
}

代码示例来源:origin: org.openimaj/xuggle-video

/**
 * Implements a precise seeking mechanism based on the Xuggle seek method
 * and the naive seek method which simply reads frames.
 * <p>
 * Note: if you created the video from a {@link DataInput} or
 * {@link InputStream}, you can only seek forwards.
 *
 * @param timestamp
 *            The timestamp to get, in seconds.
 */
public void seekPrecise(double timestamp) {
  // Use the Xuggle seek method first to get near the frame
  this.seek(timestamp);
  // The timestamp field is in milliseconds, so we need to * 1000 to
  // compare
  timestamp *= 1000;
  // Work out the number of milliseconds per frame
  final double timePerFrame = 1000d / this.fps;
  // If we're not in the right place, keep reading until we are.
  // Note the right place is the frame before the timestamp we're given:
  // |---frame 1---|---frame2---|---frame3---|
  // ^- given timestamp
  // ... so we should show frame2 not frame3.
  while (this.timestamp <= timestamp - timePerFrame && this.getNextFrame() != null)
    ;
}

代码示例来源:origin: org.openimaj/xuggle-video

this.getNextFrame();
else
  logger.error("Seek returned an error value: " + ret + ": "

代码示例来源:origin: openimaj/openimaj

this.getNextFrame();
else
  logger.error("Seek returned an error value: " + ret + ": "

代码示例来源:origin: openimaj/openimaj

@Override
  public void render(final MBFImageRenderer renderer, final Matrix transform, final Rectangle rectangle) {
    if (this.toRender == null) {
      this.toRender = new XuggleVideo(
          VideoColourSIFT.class.getResource("/org/openimaj/demos/video/keyboardcat.flv"), true);
      this.renderToBounds = TransformUtilities.makeTransform(new Rectangle(0, 0, this.toRender.getWidth(),
          this.toRender.getHeight()), rectangle);
    }
    final MBFProjectionProcessor mbfPP = new MBFProjectionProcessor();
    mbfPP.setMatrix(transform.times(this.renderToBounds));
    mbfPP.accumulate(this.toRender.getNextFrame());
    mbfPP.performProjection(0, 0, renderer.getImage());
  }
};

代码示例来源:origin: org.openimaj/demos

@Override
  public void render(final MBFImageRenderer renderer, final Matrix transform, final Rectangle rectangle) {
    if (this.toRender == null) {
      this.toRender = new XuggleVideo(
          VideoSIFT.class.getResource("/org/openimaj/demos/video/keyboardcat.flv"), true);
      this.renderToBounds = TransformUtilities.makeTransform(new Rectangle(0, 0, this.toRender.getWidth(),
          this.toRender.getHeight()), rectangle);
    }
    final MBFProjectionProcessor mbfPP = new MBFProjectionProcessor();
    mbfPP.setMatrix(transform.times(this.renderToBounds));
    mbfPP.accumulate(this.toRender.getNextFrame());
    mbfPP.performProjection(0, 0, renderer.getImage());
  }
};

代码示例来源:origin: openimaj/openimaj

@Override
  public void render(final MBFImageRenderer renderer, final Matrix transform, final Rectangle rectangle) {
    if (this.toRender == null) {
      this.toRender = new XuggleVideo(
          VideoSIFT.class.getResource("/org/openimaj/demos/video/keyboardcat.flv"), true);
      this.renderToBounds = TransformUtilities.makeTransform(new Rectangle(0, 0, this.toRender.getWidth(),
          this.toRender.getHeight()), rectangle);
    }
    final MBFProjectionProcessor mbfPP = new MBFProjectionProcessor();
    mbfPP.setMatrix(transform.times(this.renderToBounds));
    mbfPP.accumulate(this.toRender.getNextFrame());
    mbfPP.performProjection(0, 0, renderer.getImage());
  }
};

代码示例来源:origin: org.openimaj/demos

@Override
  public void render(final MBFImageRenderer renderer, final Matrix transform, final Rectangle rectangle) {
    if (this.toRender == null) {
      this.toRender = new XuggleVideo(
          VideoColourSIFT.class.getResource("/org/openimaj/demos/video/keyboardcat.flv"), true);
      this.renderToBounds = TransformUtilities.makeTransform(new Rectangle(0, 0, this.toRender.getWidth(),
          this.toRender.getHeight()), rectangle);
    }
    final MBFProjectionProcessor mbfPP = new MBFProjectionProcessor();
    mbfPP.setMatrix(transform.times(this.renderToBounds));
    mbfPP.accumulate(this.toRender.getNextFrame());
    mbfPP.performProjection(0, 0, renderer.getImage());
  }
};

代码示例来源:origin: openimaj/openimaj

this.create(url);
this.getNextFrame();

代码示例来源:origin: org.openimaj/xuggle-video

this.create(url);
this.getNextFrame();

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com