Mathematical basics and related operations of Digital Image Processing: vertex operations

Source: Internet
Author: User

Mathematical basics and related operations of Digital Image Processing: vertex operations

(1) linear vertex operation:

> Mission ();

> Aw.imread('guet.gif ');

Figure (1); imshow ();

B1 = a + 45;

Figure (2); imshow (B1 );

> B2= 1.2 *;

> Figure (3); imshow (B2)

> B3= 0.65 *;

> Figure (4); imshow (B3 );

>>B4 =-double (A) + 255;

> Figure (5); imshow (B4 );

> B4 =-double ();

> Figure (5); imshow (B4 );

> B4 =-double (A) + 100; % B4 = (-1) * A + 100; perform image population. Convert the type to double.

> Figure (5); imshow (B4 );

> B5 = (-1) * A + 100;

> Figure (6); imshow (B5 );

> B65 = (-0.5) * A + 100;

> Figure (7); imshow (b65 );

> B65 = (-2) * A + 100;

> Figure (7); imshow (b65 );

> B65 =-double (A) + 100;

> Figure (7); imshow (b65 );


Conclusion: When the gray-scale transformation of the GST function is linear, that is, B = f (a) = AA + P, the transformation is called a linear vertex operation.

Apparently: When a = 1, p! When the value is 0, the gray level of the image is increased or decreased;

When a> 1, the contrast increases;

When 0 <A <1, the contrast is reduced;

When a is less than 0, the bright area of the image is dimmed, and the dark area is highlighted, that is, the image is supplemented.

(2) Non-linear vertex operation: displays the distortion of the image relative to the original image, eliminates the distortion caused by the dynamic range, and uses the non-linear vertex operation.

There are several transformation formulas:

Round (B) = a + A * a * (max (a)-)

Example: round (x) = (x) + 0.06 * X. * (255-x)

> Aw.imread('guet.gif ');

> Figure (1); imshow ();

> Xlabel ('original image ');

>

> X =;

> Y = x + X. * (255-x)/255;

> Figure (2); imshow (y );

> Figure (3); plot (x, y );

> Xlabel ('graph of the B function ');

> B1 = double (A) + 0.06 * double (a). * (255-double ());

> Figure (4); imshow (B1 );

> Figure (5); imshow (uint8 (B1 ));


(3) histogram changes:

Linear transformation only translates the histogram of the image after it is stretched, and the shape is basically not changed. parts beyond [0,255] are accumulated on the boundary.

> Clear

> Aw.imread('guet.gif ');

> Imhist ();

> Help hist

> Title ('histogram of the original image ');

> B1 = 1.25 * double (A) + 45;

> Figure (2); imhist (uint8 (B1 ));

> Title ('histogram after Transformation ');



(4) histogram equalization:

Convert the input image to a gray level with the same pixel (even if the output histogram is flat, the distribution is even) to enhance the overall contrast of the image.

Clear

Histgram = zeros (1,256 );

CDF = zeros (1,256 );

Export cm,map]=imread('guet.gif ');

[A, B] = size (CM );

For I = 1:

For j = 1: B

K = cm (I, j );

Histgram (K) = histgram (k) + 1;

End

End

CDF (1) = histgram (1 );

For I = 2:256

CDF (I) = CDF (I-1) + histgram (I );

End

For I = 1:

For j = 1: B

K = cm (I, j );

Cm_equ (I, j) = CDF (k) * 256/(A * B );

End

End

Imshow (uint8 (cm_equ ));

Figure (2); imhist (uint8 (cm_equ ));



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.