How to know the number of frames in a single image?

Hi there,
I have a .RAW image that contains many frames. Is there a way to know how many frames are there in a single image?

8 Comments

It totally depends on where the file came from. Standards vary. If there's any information about framecount, it'll be somewhere in the header. I don't think I've run into multiframe RAW files, so i don't know how likely existing decoders would work.
Thank you for your reply.
RAW is only partially standardized, so we would need to know more about what kind of device wrote the file.
Thank you Walter,
This is the camera that generates the .raw images. Link: https://www.first-light-imaging.com/product/c-red-3/
I am not sure if it would help but if there is a place/way to know through the device, I would appreaciate if you could direct me and I would find it and reply here.
Thanks
Sadly, the SDK manual available on their site only contains the cover page. I was able to find copies of the C-RED-3 User Manual on other sites, but I was not able to find copies of the SDK manual on other sites.
The documentation implies that the SDK can be invoked from MATLAB.
Thank you, Walter,
I think I know how to find the number of the frames now. I have collected a new .raw image with 1000 frames and then I did the following to verify the number of the frames:
I=read_cube_camera('filename.raw',640,512,1000);
% where 640 is the width of the image, 512 is the height, and 1000 is the
% frame # 1000 in the image.
The output is: 512x640x1000 double (contains more than 524288 elements). If i replace the 1000 (frames) with, lets say, 1001, then it wont output more than 1000 and this is the # of frames in the image.
Now, I need to average these 1000 frames, any idea on how to attempt that? First, I tried the following to access these frames:
B =I(100,:,100); %picking the row# 100 from frame# 100
But it throws an error:
Index in position 3 exceeds array bounds. Index must not exceed 1.
This is why i wanted to access the frames in a single image to average them.
Many thanks
mean(I, 3)
would average the pixels over the third dimension.

Sign in to comment.

Answers (1)

Hi Naif,
I understand that you want to find the number of frames in a single RAW image. You can retrieve this data from the Preview of the Image Acquisition toolbox, that displays the image data from your image acquisition device.
If you toggle the Preview switch to On, then it displays status messages below the tab, when you capture an image snapshot or record a video. The messages provide information about the current acquisition mode, the number of frames or seconds captured, and the file name or workspace variable name that the data is saved as.
You can refer to the documentation of Preview and Acquire Data in Image Acquisition Explorer - MATLAB & Simulink (mathworks.com) for further details.

1 Comment

It is not obvious to me that this is relevant? The user has a existing .RAW file that was created by an infrared sensor; they are not using the Image Acquisition Toolbox. (At some point it might make sense for them to switch to live work using that toolbox, but currently they are working with stored files.)

Sign in to comment.

Products

Release

R2021b

Asked:

on 3 Apr 2022

Commented:

on 7 Apr 2022

Community Treasure Hunt

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

Start Hunting!