Read .seq file in MATLAB

Hi, I have a 20 minute video recording of an insect and i need to process it. Since it is the raw data,its file format is .seq.
Can anyone help me in reading the seq file in matlab?
Thanks

2 Comments

Was your .seq file created by Cyberpaint or by NorPix ?
kittu
kittu on 12 Sep 2012
Hi, Thanks for the reply.I am not sure about it,as I have not collected the data personally.But i think that it was created by NorPix.

Sign in to comment.

 Accepted Answer

Walter Roberson
Walter Roberson on 12 Sep 2012

0 votes

5 Comments

kittu
kittu on 13 Sep 2012
Edited: kittu on 13 Sep 2012
Hi, Thanks for the quick link and answer. I am trying to replicate the same code on my machine. But i am getting this error message:
??? Maximum variable size allowed by the program is exceeded.
I am trying to create a zero matrix for preallocation and for that I need to create a zero matrix.However the size of matrix is about:
404166936*522198298*9765
Here 404166936 is Image width and 522198298 is Image height while 9765 is the number of Allocated frames. I know it is a huge matrix, but some how the people in MATLAB has written the code and i am only replicating it for my use.
Any suggestions?Is there a way to increase the variable size? I am trying to read the .seq file which is about 50MB big. If the program fails in 50MB file, then how will i process even bigger files which are close to 3GB!
Thanks
There is no hope of reading in 404166936*522198298*9765: it would require 2E12 gigabytes!
Please recheck the sizes. 400 million pixels wide seems quite unlikely. Even a single frame would be 2E8 gigabytes.
kittu
kittu on 14 Sep 2012
Edited: kittu on 14 Sep 2012
Thanks for replying.Ya, i know..But some how when i am reading the header information then it is showing me these figures. I have this following code for header information:
clc
clear
fid = fopen('1.seq','r','b')
endianType = 'ieee-le';
%Reading Header Version
OFB = {28,1,'long'};
fseek(fid,OFB{1}, 'bof')
headerInfo.Version = fread(fid, OFB{2}, OFB{3}, endianType) %headerInfo is a structure
%Reading Header size
OFB = {32,1,'long'};
fseek(fid,OFB{1}, 'bof');
headerInfo.HeaderSize = fread(fid,OFB{2},OFB{3}, endianType)
%Reading Description Format
OFB = {592,1,'long'};
fseek(fid,OFB{1}, 'bof');
DescriptionFormat = fread(fid,OFB{2},OFB{3}, endianType)'
%Reading Byte Description
OFB = {36,512,'ushort'};
fseek(fid,OFB{1}, 'bof');
headerInfo.Description = fread(fid,OFB{2},OFB{3}, endianType)'
%Reading Image Information
OFB = {548,24,'uint32'};
fseek(fid,OFB{1}, 'bof');
tmp = fread(fid,OFB{2},OFB{3}, 0, endianType)
headerInfo.ImageWidth = tmp(1);
headerInfo.ImageHeight = tmp(2);
headerInfo.ImageBitDepth = tmp(3);
headerInfo.ImageBitDepthReal = tmp(4);
headerInfo.ImageSizeBytes = tmp(5);
vals = [0,100,101,200:100:900];
fmts = {'Unknown','Monochrome','Raw Bayer','BGR','Planar','RGB',...
'BGRx', 'YUV422', 'UVY422', 'UVY411', 'UVY444'};
headerInfo.ImageFormat =[fmts{vals == tmp(6)}];
%Reading information about number of allocated frames
OFB = {572,1,'ushort'};
fseek(fid,OFB{1}, 'bof');
headerInfo.AllocatedFrames = fread(fid,OFB{2},OFB{3}, endianType);
%Reading information about origin
OFB = {576,1,'ushort'};
fseek(fid,OFB{1}, 'bof');
headerInfo.Origin = fread(fid,OFB{2},OFB{3}, endianType);
%Reading information about true image size i.e number of bytes between the
%first pixel of each successive images.
OFB = {580,1,'ushort'};
fseek(fid,OFB{1}, 'bof');
headerInfo.Origin = fread(fid,OFB{2},OFB{3}, endianType);
%Reading True Image Size
OFB = {580,1,'ulong'};
fseek(fid,OFB{1}, 'bof');
headerInfo.TrueImageSize = fread(fid,OFB{2},OFB{3}, endianType);
%Reading information about fps
OFB = {584,8,'double'};
fseek(fid,OFB{1}, 'bof');
headerInfo.FrameRate = fread(fid,OFB{2},OFB{3}, endianType)
When i run this, i get the following header information: headerInfo =
Version: 0
HeaderSize: 36629
Description: [1x512 double]
ImageWidth: 404166936
ImageHeight: 522198298
ImageBitDepth: 572531232
ImageBitDepthReal: 639771172
ImageSizeBytes: 606348324
ImageFormat: []
AllocatedFrames: 9765
Origin: 10280
TrueImageSize: 673654824
FrameRate: [8x1 double]
Any suggestions?
There must be a problem in reading the header. The ImageWidth shown there happens to correspond to hex 0x18171918 which is entirely too regular to be an accident.

Sign in to comment.

More Answers (2)

Davide Ferraro
Davide Ferraro on 11 Sep 2012

0 votes

There are some routines for working with .seq files in MATLAB. I've not been able to test them.

2 Comments

kittu
kittu on 12 Sep 2012
Hi, Thanks for reply.Unfortunately none of those codes are working. I guess those codes are meant for reading the sequential files which are often generated during the sequence analysis of DNA/RNA etc which are text files. But in my case, these .seq files are raw video files.
I am unable to read this file in MATLAB using any of the reader. Please provide some solution. Thanks
hey kittu,
i have the same issue currently. did you solve your problem already?
Thanks!
Here is our file output:
width: 1920
height: 1080
imageBitDepth: 12
imageBitDepthReal: 12
imageSizeBytes: 3110400
imageFormat: 630
numFrames: 239
trueImageSize: 3112960
fps: 25.1130
seqVersion: 5
codec: 'imageFormat630'
descr: 'StreamPix 6.5.0.0 (x64) Ę䀀 䀀  乐䀴  ㋈䀴  g 䀴 ⊸3…'
nHiddenFinalFrames: 0

Sign in to comment.

Vijay Yadav
Vijay Yadav on 7 May 2019

0 votes

Hey,
Can anyone please share matlab script for reading .seq file

4 Comments

Vijay Yadav:
We have identified at least 3 different kinds of .seq files. We would need to know what software wrote your files to try to figure out what your file is.
Hi Walter,
Thnxs for ur reply.
My .seq raw videos files are from StreamPix.
You can now read compressed and uncompresed sequences completly, or within a reading window with the above script.

Sign in to comment.

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!