Image Filter 1.0.0

An embossed image comparison.

Size of the filter, specified as a positive integer or 2-element vector of positive integers. Use a vector to specify the number of rows and columns in h.If you specify a scalar, then h is a square matrix. When used with the 'average' filter type, the default filter size is 3 3. The filter accepts 8 and 16 bpp grayscale images for processing. Note:Since the filter can be applied as to 8 bpp and to 16 bpp images, the ThresholdValue value should be set appropriately to the pixel format. In the case of 8 bpp images the threshold value is in the 0, 255 range, but in the case of 16 bpp images the threshold value is in the.

Image embossing is a computer graphics technique in which each pixel of an image is replaced either by a highlight or a shadow, depending on light/dark boundaries on the original image. Low contrast areas are replaced by a gray background. The filtered image will represent the rate of color change at each location of the original image. Applying an embossing filter to an image often results in an image resembling a paper or metal embossing of the original image, hence the name.

Technical details[edit]

The emboss filter, also called a directional difference filter,[1] will enhance edges in the direction of the selected convolution mask(s). When the emboss filter is applied, the filter matrix is in convolution calculation with the same square area on the original image. So it involves a large amount of calculation when either the image size or the emboss filter mask dimension is large. The emboss filter repeats the calculation as encoded in the filter matrix for every pixel in the image; the procedure itself compares the neighboring pixels on the image, leaving a mark where a sharp change in pixel value is detected. In this way, the marks form a line following an object's contour. The process yields an embossed image with edges highlighted.

Four primary emboss filter masks are:

(0+10000010){displaystyle left({begin{array}{rrr}0&+1&00&0&00&-1&0end{array}}right)}

(+100000001){displaystyle left({begin{array}{rrr}+1&0&00&0&00&0&-1end{array}}right)}

Image filter 1.0.0 10Image

(000+101000){displaystyle left({begin{array}{rrr}0&0&0+1&0&-10&0&0end{array}}right)}

(00+1000100){displaystyle left({begin{array}{rrr}0&0&+10&0&0-1&0&0end{array}}right)}

According to the need to enhance edge details from different directions, we can also rotate the emboss filter masks, such as:

(10000000+1){displaystyle left({begin{array}{rrr}-1&0&00&0&00&0&+1end{array}}right)}

(001000+100){displaystyle left({begin{array}{rrr}0&0&-10&0&0+1&0&0end{array}}right)}

To control the depth of edges, we can enlarge the emboss filter masks, such as:

(+100000+1000000000001000001){displaystyle left({begin{array}{rrrrr}+1&0&0&0&00&+1&0&0&00&0&0&0&00&0&0&-1&00&0&0&0&-1end{array}}right)}

Example[edit]

Two different emboss filters are applied to the original photo. Image (a) is the result of a 5×5 filter with the +1 and -1 in the horizontal direction, which emphasizes vertical lines. Image (b) is the result of a 5×5 filter with the +1 and -1 in the vertical direction; it emphasizes horizontal lines. Since the entries of a given emboss filter matrix sum to zero, the output image has an almost completely black background, with only the edges visible. Adding a 128 value of brightness (half the 0-255 range) to each pixel creates the final, displayed images with grey-toned backgrounds:

Sample photo with horizontal and vertical embossing
Original image
Image (a): horizontal emboss
Image (b):vertical emboss

Image Filter Software


See also[edit]

Image Filter 1.0.0 10

References[edit]

  1. ^'Computer imaging: Digital image analysis and processing (Second ed.)' by Scott E Umbaugh, ISBN978-1-4398-0206-9(2010)
  • 'Computer imaging: Digital image analysis and processing (Second ed.)' by Scott E Umbaugh, ISBN978-1-4398-0206-9(2010)

External links[edit]

Retrieved from 'https://en.wikipedia.org/w/index.php?title=Image_embossing&oldid=914712287'

BWBinary image
2-D numeric matrix | 2-D logical matrix

Binary image, specified as a 2-D numeric matrix or 2-D logical matrix. For numeric input, any nonzero pixels are considered to be 1 (true).

Image Filter 1.0.0 Mac

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical

operationMorphological operation to perform
character vector | string scalar

Morphological operation to perform, specified as one of thefollowing.

Operation

Description

'bothat'

Performs the morphological “bottom hat”operation, returning the image minus the morphological closing ofthe image (dilation followed by erosion).

'branchpoints'

Find branch points of skeleton. For example:

Note:To find branch points, the image must be skeletonized. To create askeletonized image, use bwmorph(BW,'skel').

'bridge'

Bridges unconnected pixels, that is, sets 0-valued pixelsto 1 if they have two nonzero neighbors that arenot connected. For example:

'clean'

Removes isolated pixels (individual 1s that are surroundedby 0s), such as the center pixel in this pattern.

'close'

Performs morphological closing (dilation followed by erosion).

'diag'

Uses diagonal fill to eliminate 8-connectivity of the background. For example:

'endpoints'

Finds end points of skeleton. For example:

Note: To findend points, the image must be skeletonized. To create a skeletonizedimage, use bwmorph(BW,'skel').

'fill'

Fills isolated interior pixels (individual 0s that aresurrounded by 1s), such as the center pixel in this pattern.

'hbreak'

Removes H-connected pixels. For example:

'majority'

Sets a pixel to 1 if five or morepixels in its 3-by-3 neighborhood are 1s; otherwise, it sets the pixelto 0.

'open'

Performs morphological opening (erosion followed by dilation).

'remove'

Removes interior pixels. This option sets a pixel to 0 ifall its 4-connected neighbors are 1, thus leavingonly the boundary pixels on.

'shrink'

With n = Inf, shrinks objects to points.It removes pixels so that objects without holes shrink to a point,and objects with holes shrink to a connected ring halfway betweeneach hole and the outer boundary. This option preserves the Eulernumber.

'skel'

With n = Inf, removes pixels on theboundaries of objects but does not allow objects to break apart. Thepixels remaining make up the image skeleton. This option preservesthe Euler number.

When working with 3-D volumes, or when you want to prune a skeleton, use the bwskel function.

'spur'

Removes spur pixels. For example:

'thicken'

With n = Inf, thickens objects byadding pixels to the exterior of objects until doing so would resultin previously unconnected objects being 8-connected. This option preservesthe Euler number.

'thin'

With n = Inf, thins objects to lines.It removes pixels so that an object without holes shrinks to a minimallyconnected stroke, and an object with holes shrinks to a connectedring halfway between each hole and the outer boundary. This optionpreserves the Euler number. See Algorithms for more detail.

'tophat'

Performs morphological 'top hat' operation, returningthe image minus the morphological opening of the image (erosion followedby dilation).

Example: BW3 = bwmorph(BW,'skel');

Data Types: char | string

Image Filter Codes

nNumber of times to perform the operation
numeric value

Number of times to perform the operation, specified as a numericvalue. n can be Inf, in whichcase bwmorph repeats the operation until theimage no longer changes.

Online Image Filter

Example: BW3 = bwmorph(BW,'skel',100);

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical