【matlab图像处理】生成棋方格,五子棋标定板(设置个数,尺寸,打印)

61 篇文章 27 订阅
50 篇文章 18 订阅

五子棋


%% 五子棋
clear all;clc;close all
pha=0:pi/20:2*pi;%角度[0,2*pi]
R=0.75;%半径
x=R*cos(pha);
y=R*sin(pha);
n=5;
for i=1:2:n
for j=1:2:n
plot(i+x,j+y,'-');
axis equal
fill(i+x,j+y,'k');
hold on
end
end




clear all;clc  
%% 棋方格 %http://blog.sina.com.cn/s/blog_6ae056ec01017449.html
        %http://blog.sina.com.cn/s/blog_6920072701012zdx.html
        %http://blog.sina.com.cn/s/blog_6da2b94d0101j7i9.html
        
%% 棋方格1   参数6表示显示像素尺寸
clear all;close all;clc 
I=checkerboard(12);
figure(1)
imshow(I)

%%
figure(2)
I2=checkerboard(6);
imshow(I2)
%%
figure(3)
I3=checkerboard(2);
imshow(I3)






%% 棋方格2 参数S表黑白的四个分布 ,0黑,1白;repmat后两位参数为棋方格的个数
clear all;clc
S=[0 1;1 0];
A=repmat(S,1,1);
figure(1)
imshow(A,'InitialMagnification','fit')
%%
S2=[1 0;0 1];
A2=repmat(S2,1,1);
figure(2)
imshow(A2,'InitialMagnification','fit')
%%
S3=[0 1;1 0];
A3=repmat(S3,5,5);
figure(3)
imshow(A3,'InitialMagnification','fit')
%%
S4=[0 1;1 0];
A4=repmat(S4,6,4);
figure(4)
imshow(A4,'InitialMagnification','fit')




  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值