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?
1 view (last 30 days)
Show older comments
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
Answers (3)
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
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
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.
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
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.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!