标定简单图片联通区域中心的Matlab程序-test_1.rar
标定简单图片联通区域中心的程序以及串口通讯。
M币不够下载的,原来的3M也稀里糊涂丢了。。只好自己赚了。。
附件中程序:
a = imread;%导入图像
aa=a;
b = rgb2gray;%二值化图像
bw = dither;%中值滤波
L = bwlabel;%标定
stats = regionprops;%找出标定部分的中心
centroids = cat;
x = centroids
y = centroids
subplot,imshow,title
subplot,imshow,title
subplot,imagesc;hold on;plot ,title
s=serial;
fopen;
fwrite %向com1口发送x中存储的坐标值
fwrite %向com1口发送y中存储的坐标值
re=fscanf
fclose;%关闭串口
delete;%清除句柄
clear s;
end