【发布时间】:2018-03-27 21:23:24
【问题描述】:
基于上一个问题 (read coordinate text file for regionprop usage - Matlab) 我希望绘制具有扩展边界(零 + 10)的对象,但它不起作用。有什么原因吗?
代码:
clc;
clear;
filename = fullfile('E:/outline.txt');
fileID = fopen(filename);
C = textscan(fileID,'%d %d');
fclose(fileID);
xMax = double(max(C{1})-10)
yMax = double(max(C{2})+10)
bw=roipoly(zeros(xMax ,yMax ),C{1},C{2});
imshow(bw);
stats = regionprops(bw);
坐标文本文件内容如下:
88 10
87 11
87 12
88 13
88 14
92 21
93 22
93 23
94 24
95 25
100 33
101 34
102 34
103 34
103 33
103 32
103 31
103 30
103 29
103 28
103 27
102 26
102 25
101 24
101 23
100 22
100 21
100 20
99 19
99 18
94 12
93 12
92 12
91 11
90 11
【问题讨论】:
-
为什么不行........
-
可以看到图中的对象。如果我使用例如 bw=roipoly(zeros(500 ,500 ),C{1},C{2});我可以看到它,但图像很小。我正在寻找一种方法来扩展一点边界。
-
请完整阅读minimal reproducible example并提供一份
标签: matlab