gpt4 book ai didi

image - bwboundaries 获取图像边界

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:07:47 25 4
gpt4 key购买 nike

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

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);

最佳答案

试试 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')

关于image - bwboundaries 获取图像边界,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19692730/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com