返回特定地区 [英] Returning specific regions

查看:59
本文介绍了返回特定地区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个标记的图像,在该图像中,我计算了每个区域的area.如何退回特定地区?也就是说,说我想返回具有>=300<500的区域?

Say that I have a labeled image, where I have calculated the area of each region. How can I return specific regions? That is, say I want to return the regions that have >=300 and <500?

谢谢.

推荐答案

您可以将regionprops的结果分组为一个向量,并将其用于索引:

You can group the results of regionprops into a vector and use it for indexing:

rg = regionprops( L, 'Area' );
allArea = [rg(:).Area]; % grouping all area values into a single vecotr
labels = find( allArea >= 300 & allArea < 500); % select relevant regions

这篇关于返回特定地区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆