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

    %% Detect a Checkerboard in Image
% Load an image containing a checkerboard pattern.

% Copyright 2015 The MathWorks, Inc.

imageFileName = fullfile(matlabroot,'toolbox','vision','visiondata','calibration','webcam','image4.tif');
I = imread(imageFileName);
 
%% 
% Detect the checkerboard points in the image.
[imagePoints, boardSize] = detectCheckerboardPoints(I);
 
%% 
% Display the detected points.
J = insertText(I,imagePoints,1:size(imagePoints,1));
J = insertMarker(J, imagePoints,'o','Color','red','Size', 5);
imshow(J);
title(sprintf('Detected a %d x %d Checkerboard',boardSize));