📄 mksq.m
字号:
%MKSQ Make a test pattern comprising squares%% im = MKSQ(w, numsq)%% Create a square output image (W x W) with NUMSQ filled squares along % the diagonal. Pixels in the squares are set to one, all others to zero.%% SEE ALSO: mkline, ihough, xyhough%% Copyright (c) Peter Corke, 1999 Machine Vision Toolbox for Matlab% 1997 Peter Corkefunction im = mksq(w, nsq) im = zeros(w,w); % make the image k = 2^(nsq+1); % a useful quantity ws = w / k; % each square is 2ws x 2ws for j=1:4:k, % for each square l = j*ws; % left coord r = (j+2)*ws-1; % right coord im(l:r,l:r) = ones(2*ws,2*ws); % then fill it end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -