org.openimaj.video.Video.hasNextFrame()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(104)

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

Video.hasNextFrame介绍

[英]Returns whether this video has another frame to provide.
[中]返回此视频是否要提供其他帧。

代码示例

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

@Override
public boolean hasNext() {
  return video.hasNextFrame();
}

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

@Override
public boolean hasNextFrame()
{
  return video.hasNextFrame();
}

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

@Override
public boolean hasNextFrame()
{
  return video.hasNextFrame();
}

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

@Override
public boolean hasNext() {
  return frameCount >= 0 && video.hasNextFrame();
}

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

@Override
public boolean hasNext() {
  return video.hasNextFrame();
}

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

/**
 * {@inheritDoc}
 *
 * @see org.openimaj.video.Video#hasNextFrame()
 */
@Override
public boolean hasNextFrame()
{
  if (this.video == null)
    throw new UnsupportedOperationException("Chain method called on non-chainable processor");
  return this.video.hasNextFrame();
}

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

/**
 * {@inheritDoc}
 *
 * @see org.openimaj.video.Video#hasNextFrame()
 */
@Override
public boolean hasNextFrame()
{
  if (this.video == null)
    throw new UnsupportedOperationException("Chain method called on non-chainable processor");
  return this.video.hasNextFrame();
}

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

/**
 *     Cache the whole of the given video.
 *  @param <I> Type of {@link Image} 
 * 
 *    @param video The video to cache
 *    @return A {@link VideoCache}
 */
public static <I extends Image<?,I>> VideoCache<I> cacheVideo( Video<I> video )
{
  VideoCache<I> vc = new VideoCache<I>( video.getWidth(), 
      video.getHeight(), video.getFPS() );
  video.reset();
  while( video.hasNextFrame() )
    vc.addFrame( video.getNextFrame().clone() );
  return vc;
}

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

/**
 *     Cache the whole of the given video.
 *  @param <I> Type of {@link Image} 
 * 
 *    @param video The video to cache
 *    @return A {@link VideoCache}
 */
public static <I extends Image<?,I>> VideoCache<I> cacheVideo( Video<I> video )
{
  VideoCache<I> vc = new VideoCache<I>( video.getWidth(), 
      video.getHeight(), video.getFPS() );
  video.reset();
  while( video.hasNextFrame() )
    vc.addFrame( video.getNextFrame().clone() );
  return vc;
}

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

/**
   *     Cache the given time range from the given video.
   * 
   *    @param <I> The type of the video frames
   *    @param video The video to cache
   *    @param start The start of the video to cache
   *    @param end The end of the video to cache
   *    @return A {@link VideoCache}
   */
  public static <I extends Image<?,I>> VideoCache<I> cacheVideo( Video<I> video,
      VideoTimecode start, VideoTimecode end )
  {
    VideoCache<I> vc = new VideoCache<I>( video.getWidth(), 
        video.getHeight(), video.getFPS() );
    video.setCurrentFrameIndex( start.getFrameNumber() );
    while( video.hasNextFrame() && 
        video.getCurrentFrameIndex() < end.getFrameNumber() )
      vc.addFrame( video.getNextFrame().clone() );
    return vc;
  }
}

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

/**
   *     Cache the given time range from the given video.
   * 
   *    @param <I> The type of the video frames
   *    @param video The video to cache
   *    @param start The start of the video to cache
   *    @param end The end of the video to cache
   *    @return A {@link VideoCache}
   */
  public static <I extends Image<?,I>> VideoCache<I> cacheVideo( Video<I> video,
      VideoTimecode start, VideoTimecode end )
  {
    VideoCache<I> vc = new VideoCache<I>( video.getWidth(), 
        video.getHeight(), video.getFPS() );
    video.setCurrentFrameIndex( start.getFrameNumber() );
    while( video.hasNextFrame() && 
        video.getCurrentFrameIndex() < end.getFrameNumber() )
      vc.addFrame( video.getNextFrame().clone() );
    return vc;
  }
}

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

FeatureTable trackFeatures(Video<FImage> video, int nFeatures, boolean replace) {
  final TrackingContext tc = new TrackingContext();
  final FeatureList fl = new FeatureList(nFeatures);
  final FeatureTable ft = new FeatureTable(nFeatures);
  final KLTTracker tracker = new KLTTracker(tc, fl);
  tc.setSequentialMode(true);
  tc.setWriteInternalImages(false);
  tc.setAffineConsistencyCheck(-1);
  FImage prev = video.getCurrentFrame();
  tracker.selectGoodFeatures(prev);
  ft.storeFeatureList(fl, 0);
  while (video.hasNextFrame()) {
    final FImage next = video.getNextFrame();
    tracker.trackFeatures(prev, next);
    if (replace)
      tracker.replaceLostFeatures(next);
    prev = next;
    ft.storeFeatureList(fl, video.getCurrentFrameIndex());
  }
  return ft;
}

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

FeatureTable trackFeatures(Video<FImage> video, int nFeatures, boolean replace) {
  final TrackingContext tc = new TrackingContext();
  final FeatureList fl = new FeatureList(nFeatures);
  final FeatureTable ft = new FeatureTable(nFeatures);
  final KLTTracker tracker = new KLTTracker(tc, fl);
  tc.setSequentialMode(true);
  tc.setWriteInternalImages(false);
  tc.setAffineConsistencyCheck(-1);
  FImage prev = video.getCurrentFrame();
  tracker.selectGoodFeatures(prev);
  ft.storeFeatureList(fl, 0);
  while (video.hasNextFrame()) {
    final FImage next = video.getNextFrame();
    tracker.trackFeatures(prev, next);
    if (replace)
      tracker.replaceLostFeatures(next);
    prev = next;
    ft.storeFeatureList(fl, video.getCurrentFrameIndex());
  }
  return ft;
}

相关文章