highlights the specified region of interest roi in image.

highlights several regions of interest roii.

adds a feature defined by the symbolic wrapper w.

applies the styling bgstyle to the complement of all the regions of interest.

Details and OptionsDetails and Options

  • HighlightImage is used for highlighting particular regions or features in an image. It returns the highlighted image as a Graphics object.
  • The region of interest roi can be any of the following:
  • {{x1,y1},}a list of image positions
    regiona 2D geometric region (Point, Line, Disk, etc)
    maskimagenon-zero pixels of an Image object
    graphicsa Graphics object
    fa region returned by a function f
  • By default, using DataRange->Full, positions {xi,yi} and geometric regions are assumed to be in the standard image coordinate system.
  • Basic style specifications include:
  • Automaticautomatically select the highlighting method
    colorcolor specification (RGBColor, LABColor, etc.)
    directiveany valid graphics directive (PointSize, Thickness, etc.)
  • By default, the most suitable highlighting style is used.
  • The following wrappers w can be used:
  • Annotation[e,label]provide an annotation
    Button[e,action]define an action to execute when the element is clicked
    EventHandler[e,]define a general event handler for the element
    Hyperlink[e,uri]make the element act as a hyperlink
    ImageMarker[roi,]an image marker, placing a marker at the medoid of roi
    PopupWindow[e,cont]attach a popup window to the element
    StatusArea[e,label]display in the status area when the element is moused over
    Style[e,opts]show the element using the specified styles
    Tooltip[e,label]attach an arbitrary tooltip to the element
  • Additional style specifications include:
  • "Blur",{"Blur",r}blur using range r neighborhoods
    "Boundary",{"Boundary",t}highlight the boundary using thickness t
  • Nested lists of regions-of-interest and styles can be given. Style specifications remain in effect only until the end of the list that contains them.
  • The background is taken to be the complement of all regions of interest. The following bgstyle specifications can be used:
  • "Blur",
    blur using range r neighborhoods
    "Darken",{"Darken",a}blend with black (default )
    "Lighten",{"Lighten",a}blend with white (default )
    "Remove"make background transparent
    {"Remove",color}replace background with color
    fapply f to the background
  • HighlightImage accepts all Graphics options with the following changes and additions:
  • DataRangeFullrange of coordinates in the original image
    PlotRangeAutomaticrange of coordinates to include
    PlotRangePaddingNonehow much to pad the range of values
  • Typical settings for DataRange include:
  • Automatic{{0,1},{0,h/w}}
    {{left,right},{bottom,top}}explicit coordinate ranges in 2D
  • Typical settings for PlotRange include:
  • Allall points are included
    Automaticsame as DataRange settings
    {{left,right},{bottom,top}}explicit coordinate ranges

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Highlight the corners of an image:

Click for copyable input
Click for copyable input

Highlight a region of interest:

Click for copyable input

Highlight a region of interest by dehighlighting the rest of the image:

Click for copyable input
Introduced in 2012
| Updated in 2016
Translate this page: