reading raw image data into frames

  • Permalink
  • submit to reddit
  • Email
  • Follow


I have exported the image frames as .dat (raw data) or .asc format. I do know all the image data are located in the raw data. I imported the .dat file and I could not see the information in MATLAB. I did it with avi format but I want the program to be written for .dat format. I would like to read the file and display the image frames in my GUI and navigate frame by frame.

Any idea... please share your ideas. 
0
Reply Krishna 9/8/2010 9:41:19 PM

See related articles to this posting

"Krishna " <sathishkrishna12@gmail.com> wrote in message <i68vtv$4de$1@fred.mathworks.com>...
> 
> I have exported the image frames as .dat (raw data) or .asc format. I do know all the image data are located in the raw data. I imported the .dat file and I could not see the information in MATLAB. I did it with avi format but I want the program to be written for .dat format. I would like to read the file and display the image frames in my GUI and navigate frame by frame.
> 
> Any idea... please share your ideas. 

Use fread() and your knowledge of the frame size to read in the raw data.
0
Reply sean.dewolski1 (106) 9/8/2010 9:57:04 PM

On 08/09/10 4:41 PM, Krishna wrote:
>
> I have exported the image frames as .dat (raw data) or .asc format. I do
> know all the image data are located in the raw data. I imported the .dat
> file and I could not see the information in MATLAB. I did it with avi
> format but I want the program to be written for .dat format. I would
> like to read the file and display the image frames in my GUI and
> navigate frame by frame.

There are an indefinite number of incompatible .dat formats. Saying that 
you imported the .dat file doesn't give me much confidence that you read 
it in a way that Matlab would be able to understand the data.

We are going to need more information about how you wrote the .dat file 
and how you are trying to read the file, and what results you are seeing.
0
Reply Walter 9/8/2010 10:06:45 PM

Then just write them as a standard image format, like PNG, TIFF, or
something.  Why are you using .dat????  What possible reason do you
have for doing that?
0
Reply ImageAnalyst 9/8/2010 10:23:33 PM

Well, I have the detailed information of the image frames (for ex,  frame rate, exposure time, etc.) from the custom code. If I export the recorded movie as avi, say 500 frames,  I personally think I am gonna lose all the data integrated with the the movie. Exporting .dat (raw data) file or .asc willl have all necessary information about recorded image frames or movie. 

I have tried to read the .dat or .asc file using fopen and fread commands, but this pop out a memory incompatible message. I would like to read the file in the matlab. It could be nice if I am able to read the data from .asc or .dat and pull out the images. This way I can write the code to pull out the acquisition details from the file. 


Walter Roberson <roberson@hushmail.com> wrote in message <VNTho.66316$co1.56745@newsfe11.iad>...
> On 08/09/10 4:41 PM, Krishna wrote:
> >
> > I have exported the image frames as .dat (raw data) or .asc format. I do
> > know all the image data are located in the raw data. I imported the .dat
> > file and I could not see the information in MATLAB. I did it with avi
> > format but I want the program to be written for .dat format. I would
> > like to read the file and display the image frames in my GUI and
> > navigate frame by frame.
> 
> There are an indefinite number of incompatible .dat formats. Saying that 
> you imported the .dat file doesn't give me much confidence that you read 
> it in a way that Matlab would be able to understand the data.
> 
> We are going to need more information about how you wrote the .dat file 
> and how you are trying to read the file, and what results you are seeing.
0
Reply Krishna 9/9/2010 7:29:23 AM

So why not just save a mat file, either one for the whole movie, or
one mat file for each frame if needed.  Let me get this straight.  Are
you extracting out and writing individual frames from your movie into
separate files?  And you have some measurements or parameters that are
unique for each frame and you're writing them back out?  And then
trying to read them back in again (from disk) in a different m-file?
0
Reply ImageAnalyst 9/9/2010 10:19:23 AM

Are you suggesting to export as avi and bring it to matlab, and then save as .mat file for each frames or a whole movie. I think it's a painstaking effort. I already have custom code to read and extract this information but still I wish to read in the .dat format. I could send a sample file in both .dat and .avi format.  Perhaps you can help me out.









ImageAnalyst <imageanalyst@mailinator.com> wrote in message <dedba3e5-35da-42da-9469-2755b158078e@a11g2000vbn.googlegroups.com>...
> So why not just save a mat file, either one for the whole movie, or
> one mat file for each frame if needed.  Let me get this straight.  Are
> you extracting out and writing individual frames from your movie into
> separate files?  And you have some measurements or parameters that are
> unique for each frame and you're writing them back out?  And then
> trying to read them back in again (from disk) in a different m-file?
0
Reply Sathish 9/9/2010 10:55:05 AM

It's not really clear (to me at least) what you have.  What I gathered
is that you already have an avi movie file, and that is what you're
starting with.  This is because you said "I have the detailed
information of the image frames (for ex,  frame rate, exposure time,
etc.) from the custom code" and you said that you already have a
"recorded movie."

Then I assume you read in frame by frame and (perhaps - it's not
clear) make some kind of measurements.  Then you say you "exported the
image frames as .dat (raw data) or .asc format."  So I take this to
mean that you took the existing movie, and perhaps any other
measurements you've created and then export them to one or more
(again, not clear) files with either .dat format or .asc format.

I was just suggesting that this set of output data (movie, individual
frames, or other measurements, again not clear) could be exported to a
standard data file format, like avi for a movie or .mat for other
data, instead of these non-specific and unsatisfactory .dat and/
or .asc files that you're having trouble with.  dat is not a standard
format anyway.  You could write out your own dat file with any kind of
crazy format you want but you can't be guaranteed the MATLAB will
understand it when it tries to read it back in.
0
Reply imageanalyst (7622) 9/9/2010 1:31:15 PM

Recorded movie is not in avi format.  It is .sif file . only possibility is to export in some format where MATLAB recognize the file. I think exporting avi will lose all the header information, but it will be preserved in raw data file. 

Thanks
0
Reply Sathish 9/9/2010 1:47:07 PM

On Sep 9, 9:47=A0am, "Sathish " <sathishkrishn...@gmail.com> wrote:
> Recorded movie is not in avi format. =A0It is .sif file . only possibilit=
y is to export in some format where MATLAB recognize the file. I think expo=
rting avi will lose all the header information, but it will be preserved in=
 raw data file.
>
> Thanks

--------------------------------------------------------------------
I don't know.  I'm not familiar with the details of either format.
What program would you be using to read in the sif file and write it
out to an avi file for MATLAB's consumption?
Image Analyst
0
Reply imageanalyst (7622) 9/9/2010 9:14:38 PM

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <92c9cd2f-0fc4-4578-b350-9c282b787aa4@j2g2000vbo.googlegroups.com>...
> On Sep 9, 9:47 am, "Sathish " <sathishkrishn...@gmail.com> wrote:
> > Recorded movie is not in avi format.  It is .sif file . only possibility is to export in some format where MATLAB recognize the file. I think exporting avi will lose all the header information, but it will be preserved in raw data file.
> >
> > Thanks
> 
> --------------------------------------------------------------------
> I don't know.  I'm not familiar with the details of either format.
> What program would you be using to read in the sif file and write it
> out to an avi file for MATLAB's consumption?
> Image Analyst
-------------------------------------------------------------------------------------------------------

Exporting option comes with manufacturer software. 
0
Reply sathishkrishna12 (3) 9/11/2010 8:50:07 PM

On Sep 11, 4:50=A0pm, "Sathish " <sathishkrishn...@gmail.com> wrote:
> Exporting option comes with manufacturer software.
----------------------------------------------
Then ask that manufacturer for details on how the other information
like exposure, etc. can also be exported, in addition to the avi file.


0
Reply ImageAnalyst 9/11/2010 10:13:56 PM
comp.soft-sys.matlab 201422 articles. 514 followers. Post

11 Replies
419 Views

Similar Articles

[PageSpeed] 45

  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Read Image from RAW (image data before demosaicking)
Hello, Does anyone know how I can open a RAW image (preferably .RWL taken from a Leica camera) such that I can see the data straight from the sensor before color interpolation? For example, for pixel 1,1 I expect to see a value representing the Green, but a zero for Red and Blue... Any help would be greatly appreciated. Thanks! "Jack Branning" <jbr.nospam@nospam.com> wrote in message <i0ak93$480$1@fred.mathworks.com>... > Hello, > > Does anyone know how I can open a RAW image (preferably .RWL taken from a Leica camera) such that I can see the data...

RAW Image data reading ERROR
I read RAW image data from a binary file stream. I have to read just bytes one by one and put them into a matrix of structs of unsigned chars. I have to use unsigned chars because their rangs go from 0 to 255. If I use chars then a value of 129 will be -128 :( The problem: infile.get(ImageDATA[i][j].R); Reads only chars... Ok, it works fine with chars, but when I access to the matrix the value is read like char... but i want rang from 0 - 255... Help meeeeee The source is something like that: #include <iostream> #include <fstream> #include <ctime> #include <s...

RAW Image data reading ERROR
I read RAW image data from a binary file stream. I have to read just bytes one by one and put them into a matrix of structs of unsigned chars. I have to use unsigned chars because their rangs go from 0 to 255. If I use chars then a value of 129 will be -128 :( The problem: infile.get(ImageDATA[i][j].R); Reads only chars... Ok, it works fine with chars, but when I access to the matrix the value is read like char... but i want rang from 0 - 255... Help meeeeee The source is something like that: #include <iostream> #include <fstream> #include <ctime> #include <s...

raw image data to binary image data
Hi MATLAB newsgroup I have a bunch of 128 x 128 x 128 16bit-integer raw data images taken by a NMR scanner. I will hopefully be using a program to register the images. But the program I am using requires the images to be in a 32bit float binary image file. So I would need to convert the images from 16bit integer raw data to 32bit float binary data Is this conversion possible in MATLAB? If it is possible, could anyone lead me in the right direction to as how I could make this conversion (i.e helpful functions and/or pseudo-code)? Any help would be appreciated, Trevor On Sat, 23 May 2009 00...

How to read desired data from raw data set (with example)?
Hi, I am struggling with one question of how to read desired data from the raw data set? And here is the example data first: **Example: Obs ID TX 1 1 OUT 2 1 OUT 3 1 OUT 4 1 IN 5 1 OUT 6 1 OUT 7 1 IN 8 1 OUT 9 2 OUT 10 2 OUT 11 2 OUT 12 2 OUT 13 2 IN 14 2 IN 15 2 OUT 16 2 OUT 17 2 OUT **My question: I want to read desired observations from the above raw data set: Within the SAME ID (1) whenever an observation with TX="IN", read...

Read non-image data from image acquisition toolbox
Hello, I am currently writing a IMAQ adaptor for a near-infrared camera. Our adaptor measures the camera temperature using the camera SDK. Can anyone imagine a solution for bringing back the measurement value from the camera into our MATLAB application? Thanks, Christian "Christian Keck" <christian.keck-pfarrherr@freenet.de> wrote in message news:46a86e66$1@news.fhg.de... > Hello, > > I am currently writing a IMAQ adaptor for a near-infrared camera. Our > adaptor measures the camera temperature using the camera SDK. Can anyone > imagine a solution f...

Re: How to read desired data from raw data set (with example)?
The following get what you need: data xx; input Obs ID TX $; cards; 1 1 OUT 2 1 OUT 3 1 OUT 4 1 IN 5 1 OUT 6 1 OUT 7 1 IN 8 1 OUT 9 2 OUT 10 2 OUT 11 2 OUT 12 2 OUT 13 2 IN 14 2 IN 15 2 OUT 16 2 OUT 17 2 OUT ; data xx; set xx; retain del; by id tx notsorted; if first.id and tx='OUT' then del=1; else if first.id and tx='IN' then del=0; if tx='IN' then del=0; if tx='IN' and not last.tx then delete; if del then delete; drop del; run; proc print; run; Obs Obs ID TX 1 ...

how to simply parse raw image data and output to an image file ?
Hi I have the text file of an email with an image attachment - I am ONLY looking to take the raw image (jpg) data that came in from an email attachment (I have ALREADY parsed it) and SIMPLY decode and dump the contents to an image file so it becomes an image again. I am not looking for fancy programs and all kinds of complex MIME:: programs. So I did the following assuming the jpg data that came in on an email was Base64, and that was wrong since the below didnt work - any ideas how to do this ? I am on windows and just want to create the image to a directory. I dont work with Perl on unix....

Re: How to read desired data from raw data set (with example)? #2
/**************************/ /** Create Data **/ /**************************/ data xx; input Obs ID TX $; cards; 1 1 OUT 2 1 OUT 3 1 OUT 4 1 IN 5 1 OUT 6 1 OUT 7 1 IN 8 1 OUT 9 2 OUT 10 2 OUT 11 2 OUT 12 2 OUT 13 2 IN 14 2 IN 15 2 OUT 16 2 OUT 17 2 OUT ; run ; /*****************************/ /** Subset the data **/ /*****************************/ data one (drop = del _tx i) ; set xx ; by Id ; retain del ; if first.Id then del = 0 ; /****************************/ /** If TX ...