Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
reading raw image data into frames

Subject: reading raw image data into frames

From: Krishna

Date: 8 Sep, 2010 21:41:19

Message: 1 of 12


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.

Subject: reading raw image data into frames

From: Sean

Date: 8 Sep, 2010 21:57:04

Message: 2 of 12

"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.

Subject: reading raw image data into frames

From: Walter Roberson

Date: 8 Sep, 2010 22:06:45

Message: 3 of 12

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.

Subject: reading raw image data into frames

From: ImageAnalyst

Date: 8 Sep, 2010 22:23:33

Message: 4 of 12

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?

Subject: reading raw image data into frames

From: Krishna

Date: 9 Sep, 2010 07:29:23

Message: 5 of 12

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.

Subject: reading raw image data into frames

From: ImageAnalyst

Date: 9 Sep, 2010 10:19:23

Message: 6 of 12

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?

Subject: reading raw image data into frames

From: Sathish

Date: 9 Sep, 2010 10:55:05

Message: 7 of 12

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?

Subject: reading raw image data into frames

From: ImageAnalyst

Date: 9 Sep, 2010 13:31:15

Message: 8 of 12

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.

Subject: reading raw image data into frames

From: Sathish

Date: 9 Sep, 2010 13:47:07

Message: 9 of 12

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

Subject: reading raw image data into frames

From: ImageAnalyst

Date: 9 Sep, 2010 21:14:38

Message: 10 of 12

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

Subject: reading raw image data into frames

From: Sathish

Date: 11 Sep, 2010 20:50:07

Message: 11 of 12

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.

Subject: reading raw image data into frames

From: ImageAnalyst

Date: 11 Sep, 2010 22:13:56

Message: 12 of 12

On Sep 11, 4:50 pm, "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.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us