function [im, disp_im] = imreadx(ex)
% Read a training example image.
%   im = imreadx(ex)
%
% Return value
%   im    The image specified by the example ex
%
% Argument
%   ex    An example returned by pascal_data.m

if nargout > 1
    disp_im = color(imread(ex.imdisp));
    if ex.flip
      disp_im = disp_im(:,end:-1:1,:);
    end
end

im = color(imread(ex.im));
if ex.flip
  im = im(:,end:-1:1,:);
end
