www.gusucode.com > vision 源码程序 matlab案例代码 > vision/DetectCheckerboardInASetOfImageFilesExample.m

    %% Detect Checkerboard in a Set of Image Files

% Copyright 2015 The MathWorks, Inc.


%% Create a cell array of file names of calibration images.
  for i = 1:5
      imageFileName = sprintf('image%d.tif', i);
      imageFileNames{i} = fullfile(matlabroot, 'toolbox', 'vision',...
           'visiondata','calibration','webcam',imageFileName);
  end
 
%% Detect calibration pattern in the images.
  [imagePoints, boardSize, imagesUsed] = detectCheckerboardPoints(imageFileNames);
 
%% Display the detected points.
  imageFileNames = imageFileNames(imagesUsed);
  for i = 1:numel(imageFileNames)
      I = imread(imageFileNames{i});
      subplot(2, 2, i);
      imshow(I); hold on; plot(imagePoints(:,1,i), imagePoints(:,2,i), 'ro');
  end