MATLAB GUI: How to Flip Video Preview?

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
Steve Beguin on 28 Nov 2016
I found a good answer and gave my code in this post
Steve

Asked:

on 26 Oct 2016

Answered:

on 28 Nov 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!