MATLAB Image Processing functions

Source: Internet
Author: User

1. dilate Function

This function can expand a binary image in the following forms:

Bw2 = dilate (bw1, SE)

Bw2 = dilate (bw1, Se ,..., N)

Bw2 = dilate (bw1, SE) indicates to use the Binary Structure Element Matrix se team image data matrix bw1 to perform the expansion operation. The type of the input image bw1 is double or unit8, and the type of the output image bw2 is unit8. Bw2 = dilate (bw1, Se ,..., N) indicates that the expansion operation is performed n times.

2. erode Functions

This function can corrode Binary Images in the following forms:

Bw2 = erode (bw1, SE)

Bw2 = erode (bw1, Se ,..., N)

Bw2 = erode (bw1, SE) indicates that the Binary Structure Element Matrix se team image data matrix bw1 is used for corrosion. The type of the input image bw1 is double or unit8, and the type of the output image bw2 is unit8. Bw2 = erode (bw1, Se ,..., N) indicates that the corrosion operation is performed n times.

3. bwmorph Function

This function is used to perform morphological operations on binary images. The format is as follows:

① Bw2 = bwmorph (bw1, Operation)

② Bw2 = bwmorph (bw1, operation, n)

For the format ①, The bwmorph function can use the specified morphological operation for the binary image bw1; for the format ②, The bwmorph function can use the specified morphological operation for the binary image bw1 n times. Operation is one of the following strings:

'Clean': remove isolated pixels (1 surrounded by 0)

'Close': calculates the binary closure.

'Delete': calculates image expansion using structural elements

'Erode': using structural elements to calculate image erosion

4. imclose Function

This function is used to perform morphological close operations on grayscale images. That is, the same structural elements are used to expand the images and then perform corrosion operations. The call format is:

IM2 = imclose (IM, SE)

IM2 = imclose (IM, nhood)

5. imopen Function

This function is used to perform morphological operations on grayscale images. That is, the same structural elements are used to first corrode the images and then expand the images. The call format is:

IM2 = imopen (IM, SE)

IM2 = imopen (IM, nhood)

6. strel Functions

This function is used to create structural elements corresponding to a specified shape. The shape types include:
Arbitrary pair diamond periodicline

Disk rectangle line square Octagon
The parameters parameter generally controls the se size.

Example:

SE1 = strel ('square ', 6)
% Create 6*6 squares

Se2 = strel ('line', 10, 45)
% Create line length 10, angle 45

Se3 = strel ('disk', 15)
% Create disc radius 15

Se4 = strel ('ball', 15, 5)
% Create an elliptical body with a radius of 15 and a height of 5

7. bwlabel Function

L = bwlabel (BW, n)
Returns an L matrix of the same size as BW. It contains the class labels marked for each connected area in BW. The values of these labels are 1, 2, and num (number of connected areas ). The value of N is 4 or 8, indicating whether to search for a region by 4 or 8 connections. The default value is 8.

The four-or eight-connection is the basic concept in the image processing. The eight-connection is a pixel, if they are connected to other pixels in the upper, lower, left, right, upper left, lower left, upper right, or lower right corner, they are considered to be connected, if the pixel position is on the top, bottom, left, or right adjacent to other pixels, they are considered to be connected, connected, and connected in the upper left, lower left, upper right, or lower right corner, they are not considered to be connected.

[L, num] = bwlabel (BW, n)
Here num returns the number of connected regions in BW.
Supplement: I have heard of 16 connections. This should be a concept in 3D space.

The end!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.