standard test videos for video processing - matlab

So.. In image processing, lena is the standard image for testing out algorithms in the research community. Similarly.. Are there any standard videos for testing out MATLAB codes for video processing?

There are also commonly used video sequences – though to a degree it depends on the type of video algorithm you're developing (reflected in the level of motion, type of motion, resolution etc.) and the file type you want (e.g. YUV, compressed).
As a starting point, foreman.yuv, Carphone.yuv, akiyo.yuv, bus.yuv, coastguard.yuv, flower.yuv.
For example googling the above turned up a reasonable looking repositories at the following:
YUV Video Sequences – ASU
Derf's Test Video Collection at xiph.org
Lately, the Blender clips Big Buck Bunny, Tears of Steel and Sintel have been more frequently used, as they are available in HD and 4K resolutions as well as in stereo 3D.

/Too long for a comment/
I came across some builtin sample/demo files in a matlab blog post: http://blogs.mathworks.com/loren/2007/01/10/colormap-manipulations/
Apparently the files clown and cameraman are builtin and you can just load them using load clown or load cameraman.
It depends however on the installed toolboxes: clown is from the wavelet toolbox and cameraman from the image processing toolbox. They both can be found on the matlab path of course, so you can always look around there. You'll also there find the files: autumn, board, canoe, cell, circbw, circuit,...
EDIT: also: http://www.mathworks.com/matlabcentral/answers/1376-finding-example-images-in-the-distribution
But for video I personally haven't seen anything like that in matlab
EDIT2:
I stand corrected: in the vision toolbox, there are some example videos, in the visiondemos subdirectory of the toolbox. Just search for avi files on the matlab install directory

Related

Generating smaller video file size from frames

I am doing a project in which I have a video I divide the video into frames and then the image steganography is applied to the frames and the encoded frames are generated. Then the encoded frames are to be converted into video again. All of the methods are applied successfully but the only problem is that I get the encoded video which is very large then the original video. I am using the movie2avi function to generate the video.
Can someone suggest any way to generate the video which is not very large compared to the original video?
First, if you're using movie2avi, you have a limited choice of very poor codecs (compression formats). If you have a new enough version of Matlab (R2009b+ I think) you should be using the VideoWriter class instead. The choice of codecs is still not very good, but they are of much better quality. You didn't indicate which codec (or OS) you're using so I can't recommend an alternative.
Second, even under ideal circumstances you should expect your movie file to get larger with what you're doing unless you apply additional compression. Adding steganographic content is akin to adding noise so you're making the data harder to compress. In both movie2avi and VideoWriter you can adjust the compression level or quality depending on the codec. Also, the default movie2avi codec under Linux and OS X uses no compression so the file will be huge if you haven't changed that.
If VideoWriter doesn't meet your needs (or if your version doesn't have it) you can try my QTWriter class on GitHub that allows one to export QuickTime movies in Matlab. It works very much like VideoWriter, but allows you to create high quality QuickTime movies using a few image-based codecs. No inter-frame compression is used and the PNG and TIFF formats are lossless (this may be important to your steganographic application) while being very efficient at encoding content like that often generated in Matlab. There is also a JPEG format that may be better suited to general images. The QuickTime files can then be converted to other formats if needed. You can read more and see examples here and download the single M-file here.
This is completely dependent on what you are trying to hide in the original video. Remember that the original video is using a compression codec that can take advantage of minimal change frame to frame and various other things, but if you go and try to hide something in that video through steganography, you are making it more difficult for the compression algorithm to do that, which will definitely result in a larger file. So you have to be careful what you are attempting to do, and how you are attempting to encode it.

Split a movie file into audio and video Psychtoolbox

I am working on a project where I have to split a movie file into its basic audio and video parts first. After googling and through documentation and psychdemos in psychtoolbox, I am unable to find even a clue to this issue.
Is there any function in psychtoolbox to split a movie clip like .mpeg or .mov or .avi or .flv into its audio and video parts ?
Please help.
Thanks a lot for your consideration.
First off, it is key to realize that pyschtoolbox is well simply a toolbox. There is a host of other built in MATLAB functions that you can use along with pyschtoolbox.
It looks like even in MATLAB, doing this is a pain in the a$$, but I did find this untested by me FEX entry. http://www.mathworks.com/matlabcentral/fileexchange/8028-mmread
It looks like it should be able to do what you want and it does not depend on purchasing other toolboxes, etc.
By the way, is this a project from elance.com?

MATLAB <---> Image editor with support for layers

I was wondering if anybody knows of an API, toolbox, or library that extracts layers from an image format that is supported by a free editor such as Paint.NET (native format: .pdn)
Motivation: An interface to an image with layers that can be edited in a free image editor would be of interest for those of us who do computer vision and machine learning in MATLAB. For example, it could facilitate the automatic collection of manual pixel annotations for supervised learning.
I suggest using the .PSD Photoshop file format, which has layers support and is also implemented by many non-Adobe applications.
The PSD plugin for Paint.NET allows you to open and save PSD images: http://www.psdplugin.com/
You can then use Imagemagick to extract the layers to a format that MATLAB can read:
convert filename.psd filename-%d.png
Almost nothing can read a .pdn file. http://extension.nirsoft.net/pdn
So, you are left with the following options.
Use GIMP to read in the file, and export it into something matlab supports: http://www.mathworks.com/help/techdoc/ref/imread.html.
Use GIMP to read in the file, and export it into something ImageMagick supports:http://www.imagemagick.org/script/formats.php and then convert it into something matlab supports.
Export the data from Paint.NET into a matlab friendly format.
Note, the Matlab links are for the image processing toolbox, if you don't have that, the options are more limited.

How to create a PNG image that is only a byte

We've seen PNG images on the web that are less than 1kb. When I create a new blank PNG in Photoshop, its size is about 20-30 Kb :(
For example, I've seen a 100*10 px PNG that was only 90 bytes!
Which Apps can generate these? Do you have any tips?
After fvu's answer: plz tell me what optimizer is better than other?
There no reason a minimal png should be that big. Check out png optimizers like this one or this online tool should Photoshop not include such a tool. Google knows about even more PNG optimizer tools.
Edit: a 10*100px png floodfilled with red measures 143 bytes optimized with Paintshop Pro's integrated PNG optimizer. Apparently it can be made even smaller than what Paintshop manages :-)
Edit based on OP's comment: Corel Paint Shop Pro is a photo editor, I guess you can call it a lightweight alternative to Photoshop. It was the quickest way for me to create a png comparabable to op's example.
As for what optimizer is best: some good old fashioned testing and comparing should tell you a lot, I wouldn't be surprised to see that the performance of individual optimizers depends on the input characteristics - eg some will do better on photos than others but on computer imagery it's the other way around, based on the algorithms used.
Aside from the compression ratio the ease with which you can integrate the optimizer in your workflow should be considered quite important.

rendering a waveform on an iphone

I was wondering if anyone has any suggestions on how to go about rendering a waveform of an audio file. I wold like to enable the user to set an in and out point of an audio track and I need to have a waveform so you can see where to put the points.
Are there any libraries available for this or does it need to be a completely custom solution?
Is it even called a waveform ? Maybe there's a better word for it so I can do some more searching.
TIA !
I'm reposting my answer from this question, since it applies here as well:
When displaying an audio waveform, you will want to do some sort of data reduction on the original data, because there is usually more data available in an audio file than pixels on the screen. Most audio editors build a separate file (called a peak file or overview file) which stores a subset of the audio data (usually the peaks and valleys of a waveform) for use at different zoom levels. Then as you zoom in past a certain point you start referencing the raw audio data itself.
Here are some good articles on this:
Waveform Display
As far as source code goes, I would recommend looking through the Audacity source code. Audacity's waveform display is pretty good and mostly likely does a similar sort of data reduction when rendering the waveforms.
CorePlot is the library you are looking for. It is hosted on Google code.
See this related SO question.
I realise this is an old post, however i searched for this recently, and decided to roll my own solution based on a few snippets i located on SO and a few other sites.
See my answer to This question