HighlightImage
HighlightImage[image,roi]
highlights the specified region of interest roi in image.
HighlightImage[image,{roi1,roi2,…}]
highlights several regions of interest roii.
HighlightImage[image,{…,w[roii],…}]
adds a feature defined by the symbolic wrapper w.
HighlightImage[image,fg,bgstyle]
applies the styling bgstyle to the complement of all the regions of interest.
Details 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 region a 2D geometric region (Point, Line, Disk, etc) maskimage non-zero pixels of an Image object graphics a Graphics object f a 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:
-
Automatic automatically select the highlighting method color color specification (RGBColor, LABColor, etc.) directive any 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[e,…] an image marker, placing a marker at the medoid of e 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",r}blur using range r neighborhoods 
"Darken",{"Darken",a} blend with black (default
)
"Lighten",{"Lighten",a} blend with white (default
)
"Desaturate",{"Desaturate",s} desaturate 
"Remove" make background transparent 
{"Remove",color} replace background with color 
f perform f on the background - HighlightImage accepts all Graphics options with the following changes and additions:
-
DataRange Full range of coordinates in the original image PlotRange Automatic range of coordinates to include PlotRangePadding None how much to pad the range of values - Typical settings for DataRange include:
-
Automatic {{0,1},{0,h/w}} Full {{0,w},{0,h}} {{left,right},{bottom,top}} explicit coordinate ranges in 2D - Typical settings for PlotRange include:
-
All all points are included Automatic same as DataRange settings {{left,right},{bottom,top}} explicit coordinate ranges
Examples
open allclose allSee Also
Related Guides
Introduced in 2012
(9.0)
| Updated in 2017 (11.2)