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

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

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

Video.getHeight介绍

[英]Get the height of the video frame.
[中]获取视频帧的高度。

代码示例

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

@Override
public int getHeight()
{
  return video.getHeight();
}

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

/**
 *
 *    @param video
 */
protected VideoObjectVisualisation( final Video<MBFImage> video )
{
  super( video );
  this.frameHeight = video.getHeight();
}

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

@Override
public int getHeight()
{
  return video.getHeight();
}

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

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

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

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

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

public TLDMain(Video<MBFImage> imageSource){
  source = imageSource;
  tld = new TLD(imageSource.getWidth(),imageSource.getHeight());
}
void doWork() throws FileNotFoundException {

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

ic.setSize(video.getWidth(), video.getHeight());
ic.setPreferredSize(new Dimension(video.getWidth(), video.getHeight()));
ic.setAllowZoom(false);
ic.setAllowPanning(false);

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

ic.setSize(video.getWidth(), video.getHeight());
ic.setPreferredSize(new Dimension(video.getWidth(), video.getHeight()));
ic.setAllowZoom(false);
ic.setAllowPanning(false);

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

/**
 * Convenience function to create a VideoDisplay from a video in an existing
 * component.
 *
 * @param <T>
 *            the image type of the video frames
 * @param video
 *            The video
 * @param comp
 *            The {@link JComponent} to draw into
 * @return a VideoDisplay
 */
public static <T extends Image<?, T>> VideoDisplay<T> createVideoDisplay(final Video<T> video,
    final JComponent comp)
{
  final ImageComponent ic = new ImageComponent();
  ic.setSize(video.getWidth(), video.getHeight());
  ic.setPreferredSize(new Dimension(video.getWidth(), video.getHeight()));
  ic.setAllowZoom(false);
  ic.setAllowPanning(false);
  ic.setTransparencyGrid(false);
  ic.setShowPixelColours(false);
  ic.setShowXYPosition(false);
  comp.add(ic);
  final VideoDisplay<T> dv = new VideoDisplay<T>(video, ic);
  new Thread(dv).start();
  return dv;
}

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

/**
 * Convenience function to create a VideoDisplay from a video in an existing
 * component.
 *
 * @param <T>
 *            the image type of the video frames
 * @param video
 *            The video
 * @param comp
 *            The {@link JComponent} to draw into
 * @return a VideoDisplay
 */
public static <T extends Image<?, T>> VideoDisplay<T> createVideoDisplay(final Video<T> video,
    final JComponent comp)
{
  final ImageComponent ic = new ImageComponent();
  ic.setSize(video.getWidth(), video.getHeight());
  ic.setPreferredSize(new Dimension(video.getWidth(), video.getHeight()));
  ic.setAllowZoom(false);
  ic.setAllowPanning(false);
  ic.setTransparencyGrid(false);
  ic.setShowPixelColours(false);
  ic.setShowXYPosition(false);
  comp.add(ic);
  final VideoDisplay<T> dv = new VideoDisplay<T>(video, ic);
  new Thread(dv).start();
  return dv;
}

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

if (video.getWidth() > comp.getPreferredSize().width || video.getHeight() > comp.getPreferredSize().height) {
  ic = new DisplayUtilities.ScalingImageComponent();
  ic.setSize(comp.getSize());
} else {
  ic = new ImageComponent();
  ic.setSize(video.getWidth(), video.getHeight());
  ic.setPreferredSize(new Dimension(video.getWidth(), video.getHeight()));

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

if (video.getWidth() > comp.getPreferredSize().width || video.getHeight() > comp.getPreferredSize().height) {
  ic = new DisplayUtilities.ScalingImageComponent();
  ic.setSize(comp.getSize());
} else {
  ic = new ImageComponent();
  ic.setSize(video.getWidth(), video.getHeight());
  ic.setPreferredSize(new Dimension(video.getWidth(), video.getHeight()));

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

/**
 * Created the video player for the given video on the given image
 * component.
 *
 * @param v
 *            The video
 * @param audio
 *            The audio
 * @param screen
 *            The screen to draw the video to.
 */
protected VideoPlayer(final Video<T> v, final AudioStream audio, final ImageComponent screen) {
  super(v, audio, screen);
  screen.setSize(v.getWidth(), v.getHeight());
  screen.setPreferredSize(new Dimension(v.getWidth(), v.getHeight()));
  screen.setAllowZoom(false);
  screen.setAllowPanning(false);
  screen.setTransparencyGrid(false);
  screen.setShowPixelColours(false);
  screen.setShowXYPosition(false);
  this.component = new VideoPlayerComponent(screen);
  this.component.setShowButtons(false);
  this.addVideoDisplayStateListener(this);
}

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

/**
 * Created the video player for the given video on the given image
 * component.
 *
 * @param v
 *            The video
 * @param audio
 *            The audio
 * @param screen
 *            The screen to draw the video to.
 */
protected VideoPlayer(final Video<T> v, final AudioStream audio, final ImageComponent screen) {
  super(v, audio, screen);
  screen.setSize(v.getWidth(), v.getHeight());
  screen.setPreferredSize(new Dimension(v.getWidth(), v.getHeight()));
  screen.setAllowZoom(false);
  screen.setAllowPanning(false);
  screen.setTransparencyGrid(false);
  screen.setShowPixelColours(false);
  screen.setShowXYPosition(false);
  this.component = new VideoPlayerComponent(screen);
  this.component.setShowButtons(false);
  this.addVideoDisplayStateListener(this);
}

代码示例来源: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: 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: openimaj/openimaj

/**
 * Default constructor
 * 
 * @throws IOException
 */
public VideoRecordingExample() throws IOException {
  // open webcam
  video = new VideoCapture(320, 240);
  // open display
  display = VideoDisplay.createVideoDisplay(video);
  // open a writer
  writer = new XuggleVideoWriter("video.flv", video.getWidth(), video.getHeight(), 30);
  // set this class to listen to video display events
  display.addVideoListener(this);
  // set this class to listen to keyboard events
  SwingUtilities.getRoot(display.getScreen()).addKeyListener(this);
}

代码示例来源: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/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;
  }
}

相关文章