MATLAB Answers

I have video with 10 frames. I want the video depth. In other words stack 10 frames and get the thickness of the stack as a whole. Can anybody help me?

8 views (last 30 days)
Surya Gnyawali
Surya Gnyawali on 30 Mar 2017
Commented: Walter Roberson on 5 Apr 2017
I have video with 10 frames. I want the video depth. In other words stack 10 frames and get the thickness of the stack as a whole.
Please see the image attached. Thanks so much for help Surya

  0 Comments

Sign in to comment.

Answers (3)

zepp
zepp on 30 Mar 2017
I'm not sure what you mean by depth/thickness but if you stack N frames of size (HxWxC) into a video (4d array of size HxWxCxN), the fourth dimension will give you the length of the video.

  0 Comments

Sign in to comment.


Walter Roberson
Walter Roberson on 31 Mar 2017
The thickness of a stack of N frames will (N-1) times the distance between slices, plus the thickness of one slice.
For example if had slices of bread that were 1 cm thick and you stacked with the center of the slices 4 cm apart then 10 such would have total thickness (10-1)*4 = 36, to which you have to add the distance between the outer edge of the bread thickness and the first center (so 1/2cm) and another such 1/2cm from the last center to its outside edge, for a total of 37 cm.
If the slices are infinitesimally thin then this reduces down to 9 times the distance between slices.

  2 Comments

Surya Gnyawali
Surya Gnyawali on 31 Mar 2017
That makes much better sense. However, in a video with frame rate 15 (that means 15 slices are stacked per second), how do I know the thickness of one frame or the distance between slices? is resolution involved to find the thickness of the frame? Say the resolution is 30 micron. Any idea please. Thanks for helping
Walter Roberson
Walter Roberson on 31 Mar 2017
You cannot use x or y resolution to find the distance between planes. You also cannot use the frame rate to find the distance between planes. You need to have been given additional information.
Example: I used to sometimes work with MRI images. For timing and noise reasons (MRI are really loud!), the X and Y resolutions were equal to each other, but the Z distance was 2 to 10 times greater, depending on the set up of the experiment. It was not possible to deduce the Z distance by knowing the X and Y distance. Furthermore, they would sometimes do Z fill-in: run a sequence at a fixed Z distance, and then run the sequence again at the same fixed Z distance but starting half that distance further on, doubling the number of Z slices so as to be able to get data in a more cube-like sampling, so you cannot just generalize that "the Z for MRI is always such-and-such greater than the X distance", because they might have accounted for that by running additional experiments.

Sign in to comment.


Image Analyst
Image Analyst on 1 Apr 2017
I don't know what that is - perhaps a video of an ultrasound or something. Anyway, if you have 10 frames, the "length of z" and you called it is 10. It is 10 frames. If each frame was taken a 1/30 of a second apart, then the "length" of the whole video is 10/30 of a second. I think you need to explain to us what you think the units should be. It could be number of frame, or seconds, but if you don't think so then tell us what units you think the time dimension should be in your video.

  8 Comments

Show 5 older comments
Walter Roberson
Walter Roberson on 3 Apr 2017
If you can match features between adjacent frames, you could get an estimate of the distance traveled during the scan.
Surya Gnyawali
Surya Gnyawali on 5 Apr 2017
Image Analysist's Q. If the hand does not move, does it still sweep out a volume somehow?
A: No, If hand doesn't move from one position, this means that the same image is recorded with a 15 frames per second all 15 frames will look like the same. This will not give me a wound volume.
Walter R's Q.: If you can match features between adjacent frames, you could get an estimate of the distance traveled during the scan.
A: I did not get by "match features between adjacent frames". Where do I get the features?
Walter Roberson
Walter Roberson on 5 Apr 2017
Your situation is similar to registering aerial photographs: you have a camera (of sorts) moving over an area.
Another way of phrasing the situation is that it is like you need stitch the images together to create a panoramic view.
The frame rate (15 frames per second) is not relevant to this at all.
Once you have the images stitched together into a larger image, then you can use your known pixel resolution (30 micron) to calculate real-world distances from distances measured in your image.
Note: measuring real-world distances relies upon your pixel resolution staying constant -- so, for example, the tool has to remain exactly the same distance from the wound as the user moves the tool. If you cannot be certain of that, then you need to have an object of known length in the field of view, such as a measuring tape.

Sign in to comment.