Git Product home page Git Product logo

fast's Introduction

Introduction

FAST (FAst Shot segmenTation) is a simple and fast video shot segmentation application. Just provide a input video and enjoy!

Requirements

  • A C++11 compiler, like g++
  • A functional OpenCV installation (version 4.x and above, built using 'OPENCV_GENERATE_PKGCONFIG=YES')
  • An appropriate set of CODECs

Arguments

./FAST videoFilePath outputFilePath [ght [hiv [hev [eav [iav]]]]]

The optional parameters are :

  • ght : Gradual heuristic strenght. Merge consecutive transitions found with distance up to the specified value. Zero disables it. [0 ~ N]\ (Default: 3).
  • hiv : The histogram intersection value which identifies a sliding windows transition. Also a shot transtion. [0.01 ~ 0.99] (Default: 0.25).
  • hev : The histogram euclidean distance value which identifies a sliding windows transition. Also a shot transtion. [0.01 ~ 1.99] (Default: 1.5).
  • eav : A multiplier value applied to the average histogram intersection value within each local sliding windows to detect subtle transitions. [0.01 ~ N]\ (Default: 0.5)
  • isv : A multiplier value applied to the average histogram euclidean distance value within each local sliding windows to detect subtle transitions. [0.01 ~ N] (Default: 9.00).

Output

FAST will save it's output into a CSV file (the second provided parameter). In this file, each line corresponds to a detected shot and each number to the corresponding start,end of the shot. The first frame is represented by '1'.

If FAST detects a gradual transition such as swipe, fade in/out or other transition effect, the corresponding frames are discarted of the output CSV. For example, the following snippet...

87213,87311
87339,87390

...represents two shots (87213 to 87311 and 87339 to 87390) and a gradual transition (87312 to 87338).

The last video frame can be ignored in some cases.

Example

$ ./FAST video.avi shots.csv
$ cat shots.csv
	1,240
	241,260
	272,290
	291,313
	320,325
	326,700

Publications

FAST was mentioned, described or used in the following publications/software:

Trojahn, T. H., 2014. Automatic video scene segmentation based on shot coherence. M.S. thesis. Universidade de São Paulo. Avaliable in http://www.teses.usp.br/teses/disponiveis/55/55134/tde-20052014-152446/. (In portuguese).

About

FAST was developed by Tiago H. Trojahn under the coordination of Rudinei Goularte.

fast's People

Contributors

trojahn avatar

Stargazers

 avatar Space avatar Neo Yang avatar Jidé avatar Jhonson de Souza Rodrigues avatar

Watchers

 avatar James Cloos avatar

fast's Issues

Some issuse about the latest code

Sorry,your lateset code has two issuses:
1.

double ShotSegmentation::calcThresholdIntersection(vector<double> distances, pair<int,int> window) {
	double avg = 0.0;
	
	for(int i = window.first; i < window.second; i++) {
		avg = avg + distances[i];
	}
	avg = avg / (double) (window.second - window.first);

	return avg * this->swIntersectThreshold;  ---->this->localSlidingWindowIntersectThreshold;
}

double ShotSegmentation::calcThresholdEuclidean(vector<double> distances, pair<int,int> window) {
	double avg = 0.0;
	
	for(int i = window.first; i < window.second; i++) {
		avg = avg + distances[i];
	}
	avg = avg / (double) (window.second - window.first);
	return avg * this->swEuclideanThreshold;----> this->localSlidingWindowEuclideanThreshold;
}

shouble be corrected like #1

  1. In ShotSegmentation::segmentSlidingWindows()

At end , we should add

	if (shots.size()==0)
	{
		shots.push_back(make_pair(ant, window.second));
	}

An error in ShotSegmentation::segmentSlidingWindows()

hello,I read your code and found an error:

if (j >= 1)
					{
						shots.push_back(make_pair(ant,i - j));
						ant = i-j + 1; 
					}
					j = 0;

It should be :

if (j >= 1)
					{
						shots.push_back(make_pair(ant,i - j));
						ant = i + 1; 
					}
					j = 0;

Because as you said in https://github.com/Trojahn/FAST:
If FAST detects a gradual transition such as swipe, fade in/out or other transition effect, the corresponding frames are discarted of the output CSV.
So, 'ant' shoule be updated in time as 'ant = i + 1; '

The question about localSlidingWindowIntersectThreshold and localSlidingWindowEuclideanThreshold

Hi,Thank your for this very beautiful work! But when I read source code,I find a question that In class ShotSegmentation ,member variable like localSlidingWindowIntersectThreshold and localSlidingWindowEuclideanThreshold has not been used.I guss you are writing wrong in function ShotSegmentation::segment() , distIntersec[i] <= this->swIntersectThreshold should corrected to be distIntersec[i] <= this->localSlidingWindowIntersectThreshold as well as distEuclidean[i] >= this->swEuclideanThreshold should also corrected to be distEuclidean[i] >= this->localSlidingWindowEuclideanThreshold Do you agree with me?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.