1

我使用 bwboundaries 来获取图像边框。它返回整数值。但我需要浮动像素。(空间像素)我该如何解决?

clc
clear all
close all
grayImage= dicomread('diz');

subplot(1, 1, 1);
imshow(grayImage, []);

hFH = imfreehand();

binaryImage = hFH.createMask();

subplot(1, 1, 1);
imshow(binaryImage);

structBoundaries = bwboundaries(binaryImage);
arrayBoundaries=cell2mat(structBoundaries);
4

1 回答 1

1

interparc在 MATLAB Files Exchange 上尝试该函数。对于 中的第一个结构structBoundaries,输出bwboundaries

px = structBoundaries{1}(:,2);
py = structBoundaries{1}(:,1);
N = 100;
pt = interparc(N,px,py,'spline');
plot(px,py,'r*',pt(:,1),pt(:,2),'b-o') 
于 2013-10-30T20:27:20.987 回答