graydiffweight
Calculate weights for image pixels based on grayscale intensity difference
Syntax
Description
calculates the pixel weights W
= graydiffweight(I
,refGrayVal
)W
for all pixels
in the 2-D or 3-D grayscale image I
using a
single reference grayscale intensity,
refGrayVal
. Pick a reference grayscale
intensity value that is representative of an object that you want to
segment.
The weight of a pixel is inversely related to the absolute value of
the difference between the intensity of the pixel and the reference
grayscale intensity. If the difference is small (intensity value
close to refGrayVal
), the weight value is
large. If the difference is large (intensity value very different
from refGrayVal
), the weight value is
small.
You can use the weights returned by the
graydiffweight
function for image or
volume segmentation using the imsegfmm
function. For more information, see More About.
calculates the pixel weights, where the reference grayscale
intensity value is the average of the intensity values of all the
pixels in W
= graydiffweight(I
,mask
)I
that are marked as logical
true
in mask
. Using
the average of several pixels to calculate the reference grayscale
intensity value can be more effective than using a single reference
intensity value, as in the previous syntax.
uses additional name-value arguments to control aspects of the
weight calculation.W
= graydiffweight(___,Name=Value
)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
More About
Version History
Introduced in R2014b