Extracting single frame from 'From Video Device' block in Simulink
Show older comments
Hi,
Could someone please tell me how to extract a single frame from 'From Video Device' block in Simulink. I want to use this image later for image processing.
Thanking You, Harshil
Answers (1)
Aishwarya
on 4 Oct 2023
0 votes
Hi Harshil,
I understand that you are looking for a way to extract a single frame from the "From Video Device" block in Simulink and save it as a matrix in the MATLAB workspace.
Below is an approach you can follow to achieve this:
- Connect the "From Video Device" block to the "Video Viewer" block in your Simulink model.
- Run the simulation and pause it when the desired frame is displayed in the "Video Viewer" block.
- In the "Video Viewer" block, select "Export to Image Tool." This will open the "Image Tool" app with the desired frame.
- Inside the "Image Tool" app, go to "File" and choose "Export to Workspace." You will be prompted to enter an "Image variable name." This variable name will be used to save the image in the base workspace as a matrix.
Please note that the provided links below contain documentation that you may find helpful for further reference:
- https://in.mathworks.com/help/vision/ref/videoviewer.html
- https://in.mathworks.com/help/imaq/fromvideodevice.html
Hope this helps!
Regards,
Aishwarya Palli
Categories
Find more on Image Acquisition in Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!