Skip to content

DrNickRedfern/VideoProcessingOctave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

VideoProcessingOctave

chromaR

@detsutut has created the chromaR toolkit containing a range of interesting functions for processing colour data derived from motion pictures in R.

He has also provoided a Matlab script VideoProcessing.m for users to generate their own dataset from a video file. This script extracts the average RGB value for each frame and stores the result as a .csv file. From the chroma repository:

This means that you must have Matlab installed on your local machine. The script above inspects the video source frame by frame. Each frame is a Height×Width×3 tensor. Since we are mostly interested in exploring the color trend over the entire clip rather than focusing on the palette of a single frame at this point, the only information we need to extract here is the average color (i.e RGB triplet) of each frame.

You can find the details of how to do this on the detsutut/chroma repository.

Octave instead of Matlab

Matlab is not a cheap piece of software and is possibly not accessible to many users due to the prohibitive cost.

Fortunately Octave is an open source alternative to Matlab that will run .m files, such as that described on the chroma repository, with very minimal changes.

Therefore, I have adapted @detsutut's original VideoProcessing.m file to run in Ocatve and it is available on this repository as VideoProcessingOctave.m.

To run this file you will need to have the video package for Octave installed. Installation details are available on the video package website.

Load the video package into the environment, at the Octave prompt enter pkg load video, before running VideoProcessingOctave.m.

The difference between VideoProcessing.m and VideoProcessingOctave.m is not even a single letter: in line 19 of the script, mov.duration must be changed to mov.Duration. For those of you still struggling to see the difference, the video package in Octave requires that duration has a capital letter unlike it's Matlab counterpart.

Like I said, not even a single letter's difference.

About

A script for obtaining average RGB values of each frame of a video file using Octave based on @detsutut's VideoProcessing.m script

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages