bikecalibration.OpenCvUtils.java Source code

Java tutorial

Introduction

Here is the source code for bikecalibration.OpenCvUtils.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bikecalibration;

import org.opencv.core.Mat;
import org.opencv.videoio.VideoCapture;
import org.opencv.videoio.Videoio;

/**
 *
 * @author vasja
 */
public class OpenCvUtils {
    public static Mat getImageFromVideo(int position, VideoCapture cap) {
        Mat frame = new Mat();
        cap.set(Videoio.CAP_PROP_POS_FRAMES, position);
        cap.read(frame);
        return frame;
    }
}