Example usage for org.opencv.videoio VideoCapture VideoCapture

List of usage examples for org.opencv.videoio VideoCapture VideoCapture

Introduction

In this page you can find the example usage for org.opencv.videoio VideoCapture VideoCapture.

Prototype

public VideoCapture() 

Source Link

Usage

From source file:opencvdemos.BallGame.java

License:Apache License

/**
 * Creates new form BallGame//from   w w w .j a va2  s  .c  o  m
 */
public BallGame() {
    initComponents();
    // Center
    this.setLocationRelativeTo(null);
    // load the native OpenCV library
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    // Init components
    this.capture = new VideoCapture();
    this.cameraActive = false;
    this.hsvCurrentValues.setText("");
    this.b = new Ball(currentFrame.getWidth(), currentFrame.getHeight());
}

From source file:org.technowolves.vision.TowerTracker.java

License:Open Source License

/**
 * //from w w w.jav  a 2  s  . c  o  m
 * @param args command line arguments
 * just the main loop for the program and the entry points
 */
public static void main(String[] args) {
    matOriginal = new Mat();
    matHSV = new Mat();
    matThresh = new Mat();
    clusters = new Mat();
    matHeirarchy = new Mat();
    //NetworkTable table = NetworkTable.getTable("SmartDashboard");
    // main loop of the program
    while (shouldRun) {
        try {
            // opens up the camera stream and tries to load it
            videoCapture = new VideoCapture();
            videoCapture.open("http://10.55.18.102:8080/?action=stream");
            // wait until it is opened
            while (!videoCapture.isOpened()) {
            }
            // time to actually process the acquired images
            processImage();
        } catch (Exception e) {
            e.printStackTrace();
            break;
        }
    }
    // make sure the java process quits when the loop finishes
    videoCapture.release();
    System.exit(0);
}

From source file:sanntidvideo.VideoCap.java

public VideoCap(BlockingQueue queue) {
    bq = queue;/*from   w  w w  . j  ava2  s. com*/
    cap = new VideoCapture();
    System.out.println(cap.get(CV_CAP_PROP_FRAME_WIDTH) + " " + cap.get(CV_CAP_PROP_FRAME_HEIGHT));
    System.out.println("Camera status: " + cap.isOpened());
}

From source file:spring2017ip.CameraViewController.java

@Override
public void initialize(URL url, ResourceBundle rb) {
    executorService = Executors.newSingleThreadScheduledExecutor();

    videoCapture = new VideoCapture();
    videoCapture.open(0);//from   w  w  w .ja  v a  2 s.c  o m
    showFrame();
    statusLabel.setText("Started camera");
    CameraDemo.getMainStage().setOnCloseRequest(e -> {
        videoCapture.release();
        executorService.shutdownNow();
        Platform.exit();
    });
}

From source file:video.VideoCap.java

VideoCap() {
    cap = new VideoCapture();
    cap.open(0);
}