主要内容

基于 ROI 的处理

R2026b
定义感兴趣的区域 (ROI) 并对其执行运算

感兴趣的区域是您要以某种方式对其进行滤波或运算的部分图像。您可以将 ROI 表示为二值掩膜图像。在掩膜图像中,属于感兴趣区域的像素设置为 1,感兴趣区域外的像素设置为 0。工具箱提供了几个选项来指定 ROI 和创建二值掩膜。

工具箱支持一组对象,您可以使用这些对象创建许多形状的 ROI,例如圆形、椭圆形、多边形、矩形和手绘形状。创建对象后,您可以修改其形状、位置、外观和行为。有关 ROI 形状的详细信息,请参阅选择在图像中注解 ROI 的方法。

函数

全部展开

基于交互式查看器的 ROI

AngleAngle annotation (自 R2026a 起)
CircleCircle annotation (自 R2026a 起)
EllipseEllipse annotation (自 R2026a 起)
FreehandFreehand annotation (自 R2026a 起)
LineLine annotation (自 R2024a 起)
PointPoint annotation (自 R2024a 起)
PolygonPolygon annotation (自 R2026a 起)
PolylinePolyline annotation (自 R2026a 起)
RectangleRectangle annotation (自 R2026a 起)

基于静态查看器的 ROI

ArrowsStatic arrow annotation (自 R2026b 起)
CirclesStatic circle annotation (自 R2026b 起)
CuboidsStatic 3-D cuboid annotation (自 R2026b 起)
CylindersStatic 3-D cylinder annotation (自 R2026b 起)
EllipsesStatic ellipse annotation (自 R2026b 起)
EllipsoidsStatic 3-D ellipsoid annotation (自 R2026b 起)
LinesStatic line annotation (自 R2026b 起)
PlussesStatic plus-shaped annotation (自 R2026b 起)
PointsStatic point annotation (自 R2026b 起)
PolylinesStatic polyline annotation (自 R2026b 起)
RectanglesStatic rectangle annotation (自 R2026b 起)
SpheresStatic 3-D sphere annotation (自 R2026b 起)

基于坐标区的 ROI

AssistedFreehandAssisted freehand region of interest
CircleCircular region of interest
CrosshairCrosshair region of interest
CuboidCuboidal region of interest
EllipseElliptical region of interest
FreehandFreehand region of interest
LineLine region of interest
PointPoint region of interest
PolygonPolygonal region of interest
PolylinePolyline region of interest
RectangleRectangular region of interest
uidrawInteractively draw ROI in viewer window (自 R2026a 起)
uiannotateDraw static ROIs in viewer window (自 R2026b 起)
drawassistedCreate customizable freehand ROI with assistance from object edges
drawcircleCreate customizable circular ROI
drawcrosshairCreate customizable crosshair ROI
drawcuboidCreate customizable cuboidal ROI
drawellipseCreate customizable elliptical ROI
drawfreehandCreate customizable freehand ROI
drawlineCreate customizable linear ROI
drawpointCreate customizable point ROI
drawpolygonCreate customizable polygonal ROI
drawpolylineCreate customizable polyline ROI
drawrectangleCreate customizable rectangular ROI
draw开始以交互方式绘制 ROI
reduceReduce density of points in ROI
beginDrawingFromPointBegin drawing ROI from specified point
inROIQuery if points are located in ROI
bringToFrontBring ROI to front of Axes stacking order
waitBlock MATLAB command line until ROI operation is finished
createMask从 ROI 创建二值掩膜图像
roipolySpecify polygonal region of interest (ROI)
poly2mask将感兴趣的区域 (ROI) 多边形转换为区域掩膜
regionfill使用向内插值填充图像中的指定区域
inpaintCoherentRestore specific image regions using coherence transport based image inpainting
inpaintExemplarRestore specific image regions using exemplar-based image inpainting
roicolorSelect region of interest (ROI) based on color
roifilt2Filter region of interest (ROI) in grayscale image
reducepolyReduce density of points in ROI using Ramer–Douglas–Peucker algorithm

主题

指定 ROI

  • 选择在图像中注解 ROI 的方法
    了解用于将 ROI 表示为几何形状和手绘形状的工具。
  • Specify ROI as Binary Mask
    You can create a binary mask by selecting pixels based on intensity values or position, or by using binary segmentation techniques.
  • 使用 ROI 函数创建二值掩膜
    此示例说明如何将 ROI 创建函数之一(如 drawcircle)和掩膜创建函数 createMask 结合使用来创建二值掩膜。Image Processing Toolbox™ 针对不同用例提供多种类型的 ROI 对象,包括用于 imshow 显示的基于坐标区的 ROI,以及用于 imageshow 和 volshow 显示的交互式和静态注解。要了解详细信息,请参阅选择在图像中注解 ROI 的方法。
  • 对未完全落入 ROI 的像素进行分类
    了解有多少 Image Processing Toolbox™ 函数对仅部分位于感兴趣区域 (ROI) 边界内的像素进行分类。

对 ROI 进行滤波

使用事件和回调函数创建交互式关注区域

精选示例