MATLAB GUI: How to Flip Video Preview?
Show older comments
I created a new GUI and put an axes inside a panel. The GUI will straightaway previews a live video from my camera once it is initialized. Problem is, my video is somehow inverted horizontally. When I lift my right arm in front of the camera, it is not as how I see myself in front of a mirror. How do I invert the video preview to reflect this?
% --- Executes just before GUI is made visible.
function GUI_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to GUI (see VARARGIN)
% Choose default command line output for GUI
handles.output = hObject;
axes(handles.axes1);
vid = videoinput('winvideo',1,'YUY2_640x480');
src = getselectedsource(vid);
%src.HorizontalFlip = 'on';
himage = image(zeros(480,640,3),'parent',handles.axes1);
preview(vid,himage);
Answers (1)
Steve Beguin
on 28 Nov 2016
0 votes
Steve
Categories
Find more on Image Preview and Device Configuration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!