bwboundaries获取图像边框

时间:2013-10-30 20:00:40

标签: image algorithm matlab image-processing dicom

我使用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);

1 个答案:

答案 0 :(得分:1)

试试interparc function on the 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')