Тёмный

Reading Video Files With Matlab For Image Processing 

CodingLikeMad
Подписаться 3,4 тыс.
Просмотров 17 тыс.
50% 1

This matlab tutorial video shows how to load video files in matlab using the videoReader object for image processing. Covers things like reading movie files in matlab, rewind and fast forwarding to a specific time, and extracting and analyzing a movie frame in the matlab API. This is critical to get started doing matlab video processing.
If you want to read Matlab's own documentation on this, check out: www.mathworks.com/help/matlab...
You can also look at our previous video on writing data to movie files with matlab here: • Making Videos From Fig...
The video used in the example is from NASA's Johnson Space Center, further details of usage (and additional very cool videos) can be found via:
eol.jsc.nasa.gov/FAQ/
The source file used was hosted from wikimedia, found here:
commons.wikimedia.org/wiki/Fi...

Наука

Опубликовано:

 

29 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 31   
@Schubs
@Schubs 4 года назад
This was great! Thank you very much - I would love to see more!
@abidmehmoods
@abidmehmoods 4 года назад
doing a thesis on this topic... really helpful video. Thanx
@faranjadoon4622
@faranjadoon4622 3 года назад
excuse me i need help regarding this topic
@algola7024
@algola7024 Год назад
Wow -This is great content. I appreciate your work into this.
@CodingLikeMad
@CodingLikeMad Год назад
The humidity in the region of my socks is increasing rapidly.
@FelTContreras
@FelTContreras 3 года назад
very good job :)
@harshgarg4438
@harshgarg4438 2 года назад
Liked the video, can you make a video on how to get object speed like car on highways using matlab.
@Schubs
@Schubs 4 года назад
Sorry to comment again, but what would I need to change in my code so I could do image processing with the frames? In my case I have an expanding circle I have a formula to calculate the area for, but I want to inject that into my loop. can I directly inject it into the loop as the code stands?
@CodingLikeMad
@CodingLikeMad 4 года назад
You should be able to process each frame in the loop as it's loaded. For large files this is virtual ly required as you will run out of memory. For small files you can load and store each frame and then work on the data cube.
@crazyishwarya479
@crazyishwarya479 4 года назад
Could you please upload a video on facial expression detection using MATLAB...
@rohankulkarni5386
@rohankulkarni5386 4 года назад
Can I transform the frames and then display it. So I am looking for a technique where in I want to have a bird's eye view of the video. I am planning to extract each frame and then use the perspective transformation method to transform the frame in top view format.
@CodingLikeMad
@CodingLikeMad 4 года назад
Hi Rohan! You can indeed transform the frames and then display it. The frame that is grabbed and then imaged in the code is a 3 channel (RGB) image, you can do whatever you like to it once it is extracted, including applying a technique which adjust perspective. I don't know anything about such techniques though, but the raw data can be collected and manipulated for almost anything you want to do using the code in this video. Goodluck! ~Kyros
@alonso7327
@alonso7327 3 года назад
Great video, thanks so much, do you know how to get some plot from the video?.
@CodingLikeMad
@CodingLikeMad 3 года назад
To make a plot, just calculate per frame whatever you are interested in, drop it in a vector, and then plot at the end after all frames are looped over. Thanks :)
@xallen22
@xallen22 4 года назад
Could this be used to receive a live feed from a camera? Or does the video have to be saved to the computer first?
@CodingLikeMad
@CodingLikeMad 4 года назад
You absolutley can, either using the figure loop I show here, or the preview command as discussed in the video :)
@xallen22
@xallen22 4 года назад
CodingLikeMad okey, cool! Would it work wirelessly as well? I mean, if I want to transmit a live video from another room and receive it to matlab
@xallen22
@xallen22 4 года назад
CodingLikeMad And do you think can I use this for the transmitting side as well?
@CodingLikeMad
@CodingLikeMad 4 года назад
The webcam interface is usb based. I'm not familiar with any way to this wirelessly, with this setup, but there might be some kind of wireless usb bridge? Let me.know if you find one :)
@kammelna
@kammelna 4 года назад
Hi, Thanks for sharing. I have a dataset that contains 64 columns and 46 rows when converting each row to an 8*8 matrix I can see a picture or a video frame. Now I have done this conversion and data became 8 columns by 368 rows, but I don't know how to read the data as a video. the data set is for classifying human activity, can you please assist with this? Many thanks
@CodingLikeMad
@CodingLikeMad 4 года назад
Hi Kammelna, It sounds to me like you don't really have a video file per se, but rather someone has already converted the video file into a matrix for you, and then smushed the 8x8 frames together into one giant matrix and handed you that. What you do next depends on how you want to work with the data, but probably the right first step is to make a routine that generates those 8x8 frames, and saves them into a matrix with the correct dimensionality. IE, something of size [8,8,1,46]. You can do this potentially with the reshape command, or just a for loop if it is easier to write and you don't have the speed concerns(it sounds like you mostly already have this). A matrix like this is actually already appropriate for feeding into tensor flow for classification of images actually, if you have access to the deep learning toolbox: www.mathworks.com/solutions/deep-learning/convolutional-neural-network.html (although with only 46 samples this will be likely impossible to use productively). Just my thoughts on how to handle it. Each image is accessible via a command like img(:,:,1,index), where index = 1 to 46. You may want to apply a squeeze() operation to deal with the singleton dimensions. Also, I'm assuming your images are grey scale here, otherwise the size is [8,8,3,46]. Best, Kyros
@kammelna
@kammelna 4 года назад
CodingLikeMad Hi Kyros, Thanks for your quick response. Yes you’re right the dataset is given as you mentioned. As for the 46 samples, they are only for one activity and there are 9 activities in total, also the same activities are performed by 6 different subjects. So in total I think the samples are around 55K. Thanks for your suggestions and Will try them. Regards.
@akilandeswari.p4205
@akilandeswari.p4205 3 года назад
Sir pls upload the video for removing rain and snow particles from the video and the output have video with out any rain particals using matlab function
@CodingLikeMad
@CodingLikeMad 3 года назад
That sounds like a really cool project! Unfortunately, I have no idea how to do with matlab functions... I think I could imagine doing it with neural networks using pixel mapping? Boy what a tough project though. Sorry I can't help, good luck! Let me know if you figure out how to do it!
@khadizatunsuha1999
@khadizatunsuha1999 3 года назад
Can you please show how to select region of interest in a video . I have tried doint it. But it is not working inside a loop ,the same frame is showing for the entire video...
@CodingLikeMad
@CodingLikeMad 3 года назад
In the video I copy the image frame to a temporary variable. This is essentially an array, and you can crop it directly by selecting a region of it, ie, temp = vid.readFrame() temp = temp( 200:400, 300:600, :) imshow( temp, 'Parent', ax) At least, I think that should work, let me know if something goes wrong.
@hamedmmsulimanSuliman
@hamedmmsulimanSuliman 4 года назад
Please, I need to calculate a speed of moving object. Can you help me please.
@CodingLikeMad
@CodingLikeMad 4 года назад
Hi There, I'm not sure how much help I can be, but I will try. I assume since you are commenting on this video, you have video of the object that is moving. If it is not moving at a right angle to the camera direction, it will be very difficult to get any useful information out. The general approach you want to use for this is to assume that the speed of an object is constant (briefly) between two frames of the video. If you have a lab setup, you can take video of the object with a reference next to it. These look like rulers basically, usually black and white, with known spacing. You can then just measure how many pixels per marker distance (so if 10 pixels = 1 marker, and 1 marker = 10 cm, then 1 pixel = 1 cm). You can then use the frame rate of the video (accessible from the video format, or the video object, as described in this video), and just divide by the time 1 frame takes (or just multiply by the frame rate, it's the same thing). Now if you don't have a reference, you have a whole different problem. You need to generate one somehow. If you known the size of the object, it can be it's OWN reference I think actually (this is how human eyes work - it's why a fly looks like it is moving very fast, when in fact it is still walking speed). Another possibility is to work out the field of view of the camera after the fact in degrees per pixel, and then estimate the distance to the object and work out the remaining side of the triangle. Another option is to use known landmarks which happen to be nearby. So if you were trying to figure out how fast a car was going as it sped past your house, you could use road markers that you measure the distance between for example. Anyway, giving more general advice is probably not helpful, but those are my thoughts on how to do what you asked. If you are asking about non-video motion, probably the easiest thing is record it on video as above :p Good luck! -Kyros
@oldacc2508
@oldacc2508 Год назад
Idk why but i wrote the same script to just play video but for some reason it's only plays 1 frame per 5 seconds, readframe taking too much time and I don't know why! Myabe it's because matlab installed on hdd instead of ssd? But i dont have free space on ssd.
@oldacc2508
@oldacc2508 Год назад
I got 1920x1080 29fps video, maybe it's too much, i tried 1280x720 29fps, it's slow too
@CodingLikeMad
@CodingLikeMad Год назад
Is the video itself on the ssd? That may help. Otherwise I'm not sure.
Далее
Stray Kids <ATE> UNVEIL : TRACK "MOUNTAINS"
00:59
Creating Movies and Animations in Matlab
27:01
Просмотров 113 тыс.
Matlab Basics: Histograms
6:01
Просмотров 50 тыс.
Getting Started with Image Processing
13:08
Просмотров 76 тыс.
What is the Smallest Possible .EXE?
17:57
Просмотров 113 тыс.
LEARN UNITY - The Most BASIC TUTORIAL I'll Ever Make
2:04:31
Recursive Particle Tracking - MATLAB
25:02
Просмотров 9 тыс.
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
Просмотров 120 тыс.