Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 图像中胶囊形状的检测_Matlab_Image Processing_Detection - Fatal编程技术网

Matlab 图像中胶囊形状的检测

Matlab 图像中胶囊形状的检测,matlab,image-processing,detection,Matlab,Image Processing,Detection,我有一个,我想检测所有近似胶囊形状的区域,如(红色标记) 对于每个图像,所需区域的大小和方向不同,并且未知 所需的高宽比在3到5之间 我不知道如何检测方向和大小未知的形状,因此我尝试使用区域面积与其边界框对角线平方的比率作为标准,但结果不是很好。这是我使用的代码 regions=bwconncomp(img); 大小=cellfun(@numel,regions.PixelIdxList); N=regions.NumObjects; is_胶囊=假(N,1); 对于k=1:N idx=区域。像

我有一个,我想检测所有近似胶囊形状的区域,如(红色标记)

对于每个图像,所需区域的大小和方向不同,并且未知

所需的高宽比在3到5之间

我不知道如何检测方向和大小未知的形状,因此我尝试使用区域面积与其边界框对角线平方的比率作为标准,但结果不是很好。这是我使用的代码

regions=bwconncomp(img);
大小=cellfun(@numel,regions.PixelIdxList);
N=regions.NumObjects;
is_胶囊=假(N,1);
对于k=1:N
idx=区域。像素Idxlist{k};
[行,列]=ind2sub(sz,idx);
h=最大(排)-最小(排)+1;
w=最大(列)-最小(列)+1;
l=numel(idx)/(h^2+w^2);

如果l>=0.1&&l,则使用带有“MajorAxisLength”和“MinorAxisLength”属性的regionprops。如果为3,则选择元素