(1) Extract keyframes
Run: VideoSummarization.exe or run from Visual studio, pass Video Path as parametter
(2) Extract features:
- Color moments and LBP features:
Run script: extract_feature_leduy.sh from command, view http://nii-kaori.blogspot.com/2010/07/trecvid-datasets-global-feature.html to get detail description
- Optical flow - motion histogram
Run matlab command:
ComputeOpticalFlow(ftFilePath, frameLstFilePath, frameLstRoot, runFromPos, runToPos, gridX, gridY, piStep)
+ ftFilePath: Đường dẫn đến file feature muốn tạo
+ frameLstFilePath: File chứa danh sách các frame muốn extract feature
+ frameLstRoot: Đường dẫn đến thư mục chứa các frames
+ runFromPos: Bắt đầu chạy từ frame nào (mục đích là để chạy song song nhiều thread)
+ rungToPos: Chạy đến frame nào
+ gridX: chia lưới ảnh theo chiều ngang thành bao nhiêu
+ gridY: chia lưới ảnh theo chiều dọc thành bao nhiêu
+ piStep: bước chia để quantize optical flow tạo histogram (ví dụ piStep = 4 --> khoảng chia độ: [-pi:pi/4:pi] tức là quantize thành 8 hướng chính
(3) Feature Fusion
Trước khi fusion các features cần thực hiện việc chuẩn hóa các features để khi kết hợp vai trò của các feature như nhau
3.1. Scale các feature về đoạn [0 1]: giá trị của mỗi bin chỉ rơi vào trong khoảng [0,1]
Run matlab command:
ScalingFeature(ftFilePath)
+ ftFilePath: Đường dẫn đến file chứa feature cần scale
3.2. Normalize các feature về đoạn [0 1]: giá trị mỗi bin nằm trong khoảng [0 1] và tổng giá trị của các bin trong 1 vector = 1
Run matlab command:
NormalizeFeature(ftFilePath)
+ ftFilePath: Đường dẫn đến file chứa feature cần normalize
3.3. Bin-based normalize: (Normalize by standard deviation) Đây là bước bắt buộc phải làm nếu training bằng SVM
Run matlab command:
NormalizeFeatureByDeviation(ftFilePath)
+ ftFilePath: Đường dẫn đến file chứa feature cần normalize
Tiếp theo là concatenate các feature lại theo thứ thự: colormoment + lbp + motion
Run php script:
FeatureConcatenate(ftDesFilePath, ftScrFilePath1, ftScrFilePath2, ftScrFilePath3)
+ ftDesFilePath: Đường dẫn đến file feature muốn tạo
+ ftSrcFilePath1: Đường dẫn đến file feature color moments
+ ftSrcFiletPath2: Đường dẫn đến file feature LBP
+ ftSrcFilePath3: Đường dẫn đến file feature motion
(4) Kmean - Clustering
Run matlab command:
SaveClusteringLabel2File(clusteringFilePath, ftFilePath, numberOfCluster)
+ clusteringFilePath: Đường dẫn đến file chứa label (output)
+ ftFilePath: Đường dẫn đến file feature
+ numberOfCluster: Số lượng cluster
(5) Build scoring matrix
Run matlab command:
BuildScoringMatrixOfClusterSequence(clusterFilePath)
+ clusterFilePath: Đường dẫn đến file chứa cluster label
(6) Find all sub-sequence repeated in the video
Rung matlab command
SaveSequenceAlignment2RankListFile(scoringMatrixFilePath)
+ scoringMatrixFilePath: Đường dẫn đến file chứa scoring
(7) Clustering takes of the same scene
Run php script (dùng web browser để chạy)
http://localhost/videosummarization/TakesClustering.php
+ Chọn số lượng cluster tương ứng, sẽ cho ra các kết quả nhóm take khác nhau
(8) Evaluate
- Evaluate theo tiêu chí tự propose (so độ overlap giữa take của system và take của ground truth)
Run php script (dùng web browser để chạy)
http://localhost/videosummarization/SceneTakeEvaluation.php
- Evaluate bằng cách: So sánh giữa 2 cách clustering (ground truth clustering, system clustering) khi đó coi mỗi scene là một cluster của các frame và mỗi take là một cluster của các frame
Run matlab command:
SceneTakeEvaluateByRI(gtClusteringFilePath, systemClusteringFilePath)
+ gtClusteringFilePath: Đường dẫn đến file scene take ground truth
+ systemClusteringFilePath: Đường dẫn đến file scene take của hệ thống