images = new ArrayList();
images.add(gray);
MatOfInt channels= new MatOfInt(0);
MatOfInt hSize = new MatOfInt(128);
MatOfFloat ranges= new MatOfFloat(0,128);
Imgproc.calcHist(images, channels, new Mat(), hist, hSize, ranges);
return hist;
}
double computeASE(Mat a, Mat b)
{
double sumV = 1 - Imgproc.compareHist(a, b, 0);
return sumV;
//Mat dst = new Mat();
//Core.absdiff(a, b, dst);
//
//Scalar sumV = Core.sumElems(dst);
//return sumV.val[0];
}
int ExtractKeyframes(String videoPath, double rate, String outImgPath){
VideoCapture cap = new VideoCapture();
System.out.println(cap.isOpened());
if (!cap.open(videoPath)) {
System.out.println("Open video file error!");
return -1;
}