Using Webcam in GUI to view the image,capture image,save image and acquisition
13 views (last 30 days)
Show older comments
Aziz
on 18 Apr 2012
Edited: MathWorks MATLAB Hardware Team
on 4 May 2021
I already build my file.fig at GUI: http://i41.tinypic.com/2cz3c5y.jpg ...my problem is the view from the webcam actually display outside the axes box... can anyone solve my problem??.. i also having difficulty to find source code for capture image,save and doing acquisition....
Accepted Answer
Image Analyst
on 3 Oct 2012
See this function from my webcam app:
%=====================================================================
% Turn on the live video preview. Display the bounding box over it if there is one selected.
function TurnOnLiveVideo(handles)
global vidobj; % Video camera object.
% Bail out if there is no video object class instantiated.
if isempty(vidobj), return, end;
% Switch the current graphic axes to handles.axesImage.
% This is where we want the video to go.
axes(handles.axesImage);
% Reset image magnification. Required if you ever displayed an image
% in the axes that was not the same size as your webcam image.
hold off;
axis auto;
% Get the handle to the image in the axes.
hImage = findobj(handles.axesImage, 'Type', 'image');
% Turn on the live video.
preview(vidobj, hImage);
First display something in the axes, for example a splash image or logo, so that this function has an image in the axes to get the handle of.
3 Comments
NUR SHOLIHAH RAMLEE
on 27 Mar 2018
hello Image Analyst, may I know how do you do the view, capture, and store it in the file exchange?
More Answers (2)
MathWorks MATLAB Hardware Team
on 4 May 2021
Edited: MathWorks MATLAB Hardware Team
on 4 May 2021
You can also try using the Acquire Webcam Image MATLAB Live Task. For more details refer to the following answer https://www.mathworks.com/matlabcentral/answers/821010-how-do-i-view-the-live-video-feed-and-capture-images-from-my-usb-webcam-in-matlab
0 Comments
See Also
Categories
Find more on Image Data Acquisition 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!