看了https://jingyan.baidu.com/article/ed2a5d1f89a68909f6be17d2.html自己试了一下

tu = imread('E:\Desktop\11.jpg');  

Trial>> figure(1);

Trial>> subplot(121);

Trial>> imshow(tu);

Trial>> title('原始图像');
Trial>> x=rgb2gray(tu);
Trial>> subplot(122);
Trial>> imshow(x);

Trial>> title('灰度图像');

在matlab中转换图像为矩阵

在matlab中转换图像为矩阵

Trial>> thresh1 = graythresh(x);
Trial>> tu2 = im2bw(x,thresh1);
Trial>> imshow(tu2);
Trial>> title('灰度图像二值化');

在matlab中转换图像为矩阵

在matlab中转换图像为矩阵

在matlab中转换图像为矩阵

csvwrite('0和1矩阵x.csv',tu2);

导出的一个(215*304)的矩阵

在matlab中转换图像为矩阵

相关文章:

  • 2021-08-09
  • 2021-07-31
  • 2021-08-05
  • 2021-12-23
  • 2022-12-23
  • 2021-12-22
  • 2022-01-26
猜你喜欢
  • 2021-11-19
  • 2021-12-08
  • 2022-02-07
  • 2021-12-15
  • 2022-02-12
  • 2022-01-04
相关资源
相似解决方案