HOME

TheInfoList



OR:

The Prewitt operator is used in image processing, particularly within
edge detection Edge detection includes a variety of mathematical methods that aim at identifying edges, curves in a digital image at which the image brightness changes sharply or, more formally, has discontinuities. The same problem of finding discontinuitie ...
algorithms. Technically, it is a discrete differentiation operator, computing an approximation of the
gradient In vector calculus, the gradient of a scalar-valued differentiable function of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p is the "direction and rate of fastest increase". If the gr ...
of the image intensity function. At each point in the image, the result of the Prewitt operator is either the corresponding gradient vector or the
norm Naturally occurring radioactive materials (NORM) and technologically enhanced naturally occurring radioactive materials (TENORM) consist of materials, usually industrial wastes or by-products enriched with radioactive elements found in the envi ...
of this vector. The Prewitt operator is based on convolving the image with a small, separable, and integer valued filter in horizontal and vertical directions and is therefore relatively inexpensive in terms of computations like
Sobel Sobel is a surname. Notable people with the surname include: * Adam Sobel (born 1967), American climatologist * Alex Sobel (born 1975), British politician * Barry Sobel (born 1959), American actor and comedian * Bernard Sobel (1887–1964), Amer ...
and Kayyali operators. On the other hand, the gradient approximation which it produces is relatively crude, in particular for high frequency variations in the image. The Prewitt operator was developed by Judith M. S. Prewitt.


Simplified description

In simple terms, the operator calculates the ''
gradient In vector calculus, the gradient of a scalar-valued differentiable function of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p is the "direction and rate of fastest increase". If the gr ...
'' of the image intensity at each point, giving the direction of the largest possible increase from light to dark and the rate of change in that direction. The result therefore shows how "abruptly" or "smoothly" the image changes at that point, and therefore how likely it is that part of the image represents an ''edge'', as well as how that edge is likely to be oriented. In practice, the magnitude (likelihood of an edge) calculation is more reliable and easier to interpret than the direction calculation. Mathematically, the
gradient In vector calculus, the gradient of a scalar-valued differentiable function of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p is the "direction and rate of fastest increase". If the gr ...
of a two-variable function (here the image intensity function) is at each image point a 2D
vector Vector most often refers to: *Euclidean vector, a quantity with a magnitude and a direction *Vector (epidemiology), an agent that carries and transmits an infectious pathogen into another living organism Vector may also refer to: Mathematic ...
with the components given by the
derivative In mathematics, the derivative of a function of a real variable measures the sensitivity to change of the function value (output value) with respect to a change in its argument (input value). Derivatives are a fundamental tool of calculus. ...
s in the horizontal and vertical directions. At each image point, the gradient vector points in the direction of largest possible intensity increase, and the length of the gradient vector corresponds to the rate of change in that direction. This implies that the result of the Prewitt operator at an image point which is in a region of constant image intensity is a zero vector and at a point on an edge is a vector which points across the edge, from darker to brighter values.


Formulation

Mathematically, the operator uses two 3×3 kernels which are
convolved In mathematics (in particular, functional analysis), convolution is a mathematical operation on two functions ( and ) that produces a third function (f*g) that expresses how the shape of one is modified by the other. The term ''convolution'' ...
with the original image to calculate approximations of the derivatives - one for horizontal changes, and one for vertical. If we define \mathbf as the source image, and \mathbf and \mathbf are two images which at each point contain the horizontal and vertical derivative approximations, the latter are computed as: : \mathbf = \begin +1 & 0 & -1 \\ +1 & 0 & -1 \\ +1 & 0 & -1 \end * \mathbf \quad \mbox \quad \mathbf = \begin +1 & +1 & +1 \\ 0 & 0 & 0 \\ -1 & -1 & -1 \end * \mathbf where * here denotes the 2-dimensional
convolution In mathematics (in particular, functional analysis), convolution is a mathematical operation on two functions ( and ) that produces a third function (f*g) that expresses how the shape of one is modified by the other. The term ''convolution'' ...
operation. Since the Prewitt kernels can be decomposed as the products of an averaging and a differentiation kernel, they compute the gradient with smoothing. Therefore, it is a
separable filter Separability may refer to: Mathematics * Separable algebra, a generalization to associative algebras of the notion of a separable field extension * Separable differential equation, in which separation of variables is achieved by various means ...
. For example, \mathbf can be written as : \begin +1 & 0 & -1 \\ +1 & 0 & -1 \\ +1 & 0 & -1 \end = \begin 1\\ 1\\ 1 \end \begin +1 & 0 & -1 \end The ''x''-coordinate is defined here as increasing in the "left"-direction, and the ''y''-coordinate is defined as increasing in the "up"-direction. At each point in the image, the resulting gradient approximations can be combined to give the gradient magnitude, using: :\mathbf = \sqrt Using this information, we can also calculate the gradient's direction: :\mathbf = \operatorname\left(\right) where, for example, Θ is 0 for a vertical edge which is darker on the right side.


Example


See also

*
Sobel operator The Sobel operator, sometimes called the Sobel–Feldman operator or Sobel filter, is used in image processing and computer vision, particularly within edge detection algorithms where it creates an image emphasising edges. It is named after ...
* Laplace operator * Roberts Cross *
Edge detection Edge detection includes a variety of mathematical methods that aim at identifying edges, curves in a digital image at which the image brightness changes sharply or, more formally, has discontinuities. The same problem of finding discontinuitie ...
*
Feature detection (computer vision) In computer vision and image processing, a feature is a piece of information about the content of an image; typically about whether a certain region of the image has certain properties. Features may be specific structures in the image such as poi ...
*
Digital image processing Digital image processing is the use of a digital computer to process digital images through an algorithm. As a subcategory or field of digital signal processing, digital image processing has many advantages over analog image processing. It allo ...
* Computer vision *
Feature extraction In machine learning, pattern recognition, and image processing, feature extraction starts from an initial set of measured data and builds derived values (features) intended to be informative and non-redundant, facilitating the subsequent learning a ...
* Image gradient *
Image derivative Image derivatives can be computed by using small convolution filters of size 2 × 2 or 3 × 3, such as the Discrete Laplace operator, Laplacian, Sobel operator, Sobel, Roberts cross, Roberts and Prewitt operator, Prewitt operato ...
* Gabor filter


References

{{Reflist Feature detection (computer vision)