# Digital image processing – Wikipedia

Algorithmic serve of digitally-represented images
This article is about mathematical process of digital images. For aesthetic processing of images, see persona edit. For compression algorithm, see persona compaction Digital image processing is the consumption of a digital computer to process digital images through an algorithm. [ 1 ] [ 2 ] As a subcategory or discipline of digital signal process, digital effigy process has many advantages over analogue picture action. It allows a a lot broad stove of algorithm to be applied to the input signal data and can avoid problems such as the build-up of make noise and distorted shape during processing. Since images are defined over two dimensions ( possibly more ) digital trope process may be modeled in the form of multidimensional systems. The generation and development of digital picture process are chiefly affected by three factors : first base, the development of computers ; second, the development of mathematics ( specially the initiation and improvement of discrete mathematics theory ) ; third base, the requirement for a wide range of applications in environment, farming, military, diligence and medical science has increased .

## history

many of the techniques of digital double serve, or digital visualize process as it much was called, were developed in the 1960s, at Bell Laboratories, the Jet Propulsion Laboratory, Massachusetts Institute of Technology, University of Maryland, and a few other research facilities, with lotion to satellite imagination, wire-photo standards conversion, medical visualize, videophone, character recognition, and photograph enhancement. [ 3 ] The purpose of early image process was to improve the choice of the effigy. It was aimed for human beings to improve the ocular effect of people. In image process, the input is a low-quality image, and the output is an double with improved quality. Common image serve include picture enhancement, restitution, encoding, and compression. The first successful application was the american Jet Propulsion Laboratory ( JPL ). They used prototype processing techniques such as geometric correction, grade transformation, noise removal, etc. on the thousands of lunar photos sent back by the Space Detector Ranger 7 in 1964, taking into report the position of the sun and the environment of the moon. The impact of the successful map of the lunar month ‘s airfoil map by the computer has been a huge success. late, more complex persona processing was performed on the closely 100,000 photos sent back by the spacecraft, so that the topographical map, color map and bird’s-eye mosaic of the moon were obtained, which achieved extraordinary results and laid a solid foundation garment for homo landing on the moon. [ 4 ]

The cost of processing was fairly high gear, however, with the computing equipment of that era. That changed in the 1970s, when digital prototype process proliferated as cheaper computers and dedicated hardware became available. This led to images being processed in real-time, for some dedicated problems such as television standards conversion. As general-purpose computers became faster, they started to take over the function of dedicated hardware for all but the most specialized and computer-intensive operations. With the fast computers and signal processors available in the 2000s, digital image march has become the most common shape of persona processing, and is broadly used because it is not only the most versatile method, but besides the cheapest .

### image sensors

The footing for mod visualize sensors is metal-oxide-semiconductor ( MOS ) engineering, [ 5 ] which originates from the invention of the MOSFET ( MOS field-effect transistor ) by Mohamed M. Atalla and Dawon Kahng at Bell Labs in 1959. [ 6 ] This led to the development of digital semiconductor double sensors, including the charge-coupled device ( CCD ) and late the CMOS detector. [ 5 ] The charge-coupled device was invented by Willard S. Boyle and George E. Smith at Bell Labs in 1969. [ 7 ] While researching MOS technology, they realized that an electric charge was the analogy of the magnetic burp and that it could be stored on a bantam MOS capacitor. As it was fairly straightforward to fabricate a series of MOS capacitors in a rowing, they connected a desirable voltage to them so that the charge could be stepped along from one to the adjacent. [ 5 ] The CCD is a semiconductor circuit that was late used in the first digital video cameras for television broadcast medium. [ 8 ] The NMOS active-pixel detector ( APS ) was invented by Olympus in Japan during the mid-1980s. This was enabled by advances in MOS semiconductor device fabrication, with MOSFET scaling reaching smaller micron and then sub-micron levels. [ 9 ] [ 10 ] The NMOS APS was fabricated by Tsutomu Nakamura ‘s team at Olympus in 1985. [ 11 ] The CMOS active-pixel detector ( CMOS detector ) was later developed by Eric Fossum ‘s team at the NASA Jet Propulsion Laboratory in 1993. [ 12 ] By 2007, sales of CMOS sensors had surpassed CCD sensors. [ 13 ]

### image compression

An crucial development in digital image compression technology was the discrete cosine translate ( DCT ), a lossy compaction proficiency first proposed by Nasir Ahmed in 1972. [ 14 ] DCT compression became the basis for JPEG, which was introduced by the Joint Photographic Experts Group in 1992. [ 15 ] JPEG compresses images down to much smaller file sizes, and has become the most widely practice trope file format on the Internet. [ 16 ] Its highly effective DCT compaction algorithm was largely creditworthy for the wide proliferation of digital images and digital photograph, [ 17 ] with respective billion JPEG images produced every day as of 2015. [ 18 ]

### Digital signal processor ( DSP )

electronic signal serve was revolutionized by the wide adoption of MOS engineering in the 1970s. [ 19 ] MOS integrated circuit technology was the basis for the beginning single-chip microprocessors and microcontrollers in the early 1970s, [ 20 ] and then the first single-chip digital signal processor ( DSP ) chips in the former 1970s. [ 21 ] [ 22 ] DSP chips have since been wide used in digital visualize process. [ 21 ] The discrete cosine transform ( DCT ) picture compression algorithm has been widely implemented in DSP chips, with many companies developing DSP chips based on DCT technology. DCTs are widely used for encoding, decoding, video recording cryptography, sound recording tease, multiplexing, control signals, signaling, analog-to-digital conversion, formatting luminosity and color differences, and color formats such as YUV444 and YUV411. DCTs are besides used for encoding operations such as gesture estimate, motion compensation, inter-frame prediction, quantization, perceptual slant, information encode, variable encode, and motion vectors, and decoding operations such as the inverse operation between different color formats ( YIQ, YUV and RGB ) for display purposes. DCTs are besides normally used for high-definition television ( HDTV ) encoder/decoder chips. [ 23 ]

### medical imaging

In 1972, the engineer from british caller EMI Housfield invented the roentgenogram computed imaging device for head diagnosis, which is what is normally called CT ( calculator imaging ). The CT nucleus method acting is based on the expulsion of the human heading section and is processed by calculator to reconstruct the cross-section visualize, which is called picture reconstruction. In 1975, EMI successfully developed a CT device for the whole body, which obtained a clear up tomographic picture of versatile parts of the human torso. In 1979, this diagnostic proficiency won the Nobel Prize. [ 4 ] Digital persona action engineering for checkup applications was inducted into the Space Foundation Space Technology Hall of Fame in 1994. [ 24 ]

Digital effigy march allows the function of a lot more building complex algorithm, and therefore, can offer both more advanced performance at dim-witted tasks, and the implementation of methods which would be impossible by analogue means. In particular, digital image processing is a concrete application of, and a practical engineering based on :
Some techniques which are used in digital image processing include :

## Digital persona transformations

### Filtering

Digital filters are used to blur and sharpen digital images. Filtering can be performed by :

• convolution with specifically designed kernels (filter array) in the spatial domain[25]
• masking specific frequency regions in the frequency (Fourier) domain

The follow examples show both methods : [ 26 ]

Filter type Kernel or mask Example
Original Image [ 0 0 0 0 1 0 0 0 0 ] { \displaystyle { \begin { bmatrix } 0 & 0 & 0\\0 & 1 & 0\\0 & 0 & 0\end { bmatrix } } }
Spatial Lowpass 1 9 × [ 1 1 1 1 1 1 1 1 1 ] { \displaystyle { \frac { 1 } { 9 } } \times { \begin { bmatrix } 1 & 1 & 1\\1 & 1 & 1\\1 & 1 & 1\end { bmatrix } } }
Spatial Highpass [ 0 − 1 0 − 1 4 − 1 0 − 1 0 ] { \displaystyle { \begin { bmatrix } 0 & -1 & 0\\-1 & 4 & -1\\0 & -1 & 0\end { bmatrix } } }
Fourier Representation Pseudo-code:
prototype = checkerboard F = Fourier Transform of persona Show image : log ( 1+Absolute Value ( F ) )
Fourier Lowpass
Fourier Highpass

Images are typically padded before being transformed to the Fourier quad, the highpass filtered images below illustrate the consequences of different padding techniques :

Notice that the highpass filter shows extra edges when zero padded compared to the repeated edge pad .

#### Filtering code examples

MATLAB model for spatial sphere highpass filter .

 img = checkerboard ( 20 ) ; % render checkerboard
% * * * * * * * * * * * * * * * * * * * * * * * * * * SPATIAL DOMAIN * * * * * * * * * * * * * * * * * * * * * * * * * * *
klaplace = [ 0  - 1  0 ;  - 1  5  - 1 ; 0  - 1  0 ] ; % Laplacian filter kernel
x = conv2 ( img, klaplace ) ; % convolve test img with
% 3x3 Laplacian kernel
figure ( )
imshow ( ten, [ ] ) % appearance Laplacian filtered
title ( 'Laplacian Edge Detection ' )


### Affine transformations

Affine transformations enable basic image transformations including scale, revolve, translate, mirror and shear as is shown in the follow examples : [ 26 ]

Transformation Name Affine Matrix Example
Identity [ 1 0 0 0 1 0 0 0 1 ] { \displaystyle { \begin { bmatrix } 1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end { bmatrix } } }
Reflection [ − 1 0 0 0 1 0 0 0 1 ] { \displaystyle { \begin { bmatrix } -1 & 0 & 0\\0 & 1 & 0\\0 & 0 & 1\end { bmatrix } } }
Scale [ carbon x = 2 0 0 0 c y = 1 0 0 0 1 ] { \displaystyle { \begin { bmatrix } c_ { ten } =2 & 0 & 0\\0 & c_ { y } =1 & 0\\0 & 0 & 1\end { bmatrix } } }
Rotate [ cos ⁡ ( θ ) sin ⁡ ( θ ) 0 − sin ⁡ ( θ ) carbon monoxide ⁡ ( θ ) 0 0 0 1 ] { \displaystyle { \begin { bmatrix } \cos ( \theta ) & \sin ( \theta ) & 0\\-\sin ( \theta ) & \cos ( \theta ) & 0\\0 & 0 & 1\end { bmatrix } } } where θ =

π

/

6

=30°

Shear [ 1 c adam = 0.5 0 c yttrium = 0 1 0 0 0 1 ] { \displaystyle { \begin { bmatrix } 1 & c_ { x } =0.5 & 0\\c_ { yttrium } =0 & 1 & 0\\0 & 0 & 1\end { bmatrix } } }

To apply the affinal matrix to an effigy, the prototype is converted to matrix in which each entrance corresponds to the pixel volume at that localization. then each pixel ‘s placement can be represented as a vector indicating the coordinates of that pixel in the image, [ x, y ], where x and yttrium are the row and column of a pixel in the image matrix. This allows the coordinate to be multiplied by an affine-transformation matrix, which gives the put that the pixel rate will be copied to in the output picture. however, to allow transformations that require translation transformations, 3 dimensional homogeneous coordinates are needed. The third dimension is normally set to a non-zero constant, normally 1, then that the modern organize is [ x, y, 1 ]. This allows the coordinate vector to be multiplied by a 3 by 3 matrix, enabling translation shifts. indeed the third base proportion, which is the changeless 1, allows translation. Because matrix multiplication is associative, multiple affinal transformations can be combined into a single affine transformation by multiplying the matrix of each person transformation in the ordain that the transformations are done. This results in a single matrix that, when applied to a point vector, gives the same result as all the person transformations performed on the vector [ x, yttrium, 1 ] in sequence. Thus a sequence of affine transformation matrices can be reduced to a single affine transformation matrix. For example, 2 dimensional coordinates only allow rotation about the lineage ( 0, 0 ). But 3 dimensional homogeneous coordinates can be used to beginning translate any indicate to ( 0, 0 ), then perform the rotation, and last translate the lineage ( 0, 0 ) back to the original charge ( the face-to-face of the first translation ). These 3 affinal transformations can be combined into a unmarried matrix, thus allowing rotation around any point in the picture. [ 27 ]

### double denoising with Morphology

numerical morphology is desirable for denoising images. Structuring element are important in Mathematical morphology. The follow examples are about Structuring elements. The denoise function, prototype as I, and structuring element as B are shown as downstairs and table. e.g. ( I ′ ) = [ 45 50 65 40 60 55 25 15 5 ] B = [ 1 2 1 2 1 1 1 0 3 ] { \displaystyle ( I ‘ ) = { \begin { bmatrix } 45 & 50 & 65\\40 & 60 & 55\\25 & 15 & 5\end { bmatrix } } B= { \begin { bmatrix } 1 & 2 & 1\\2 & 1 & 1\\1 & 0 & 3\end { bmatrix } } } Define Dilation ( I, B ) ( i, j ) = m a ten { I ( i + molarity, j + normality ) + B ( meter, normality ) } { \displaystyle max\ { I ( i+m, j+n ) +B ( meter, newton ) \ } } . Let Dilation ( I, B ) = D ( I, B ) D ( I ‘, B ) ( 1,1 ) = m a adam ( 45 + 1, 50 + 2, 65 + 1, 40 + 2, 60 + 1, 55 + 1, 25 + 1, 15 + 0, 5 + 3 ) = 66 { \displaystyle soap ( 45+1,50+2,65+1,40+2,60+1,55+1,25+1,15+0,5+3 ) =66 } Define Erosion ( I, B ) ( one, j ) = m i n { I ( iodine + m, j + nitrogen ) − B ( megabyte, n ) } { \displaystyle min\ { I ( i+m, j+n ) -B ( megabyte, nitrogen ) \ } } . Let Erosion ( I, B ) = E ( I, B ) E ( I ‘, B ) ( 1,1 ) = thousand one n ( 45 − 1, 50 − 2, 65 − 1, 40 − 2, 60 − 1, 55 − 1, 25 − 1, 15 − 0, 5 − 3 ) = 2 { \displaystyle min ( 45-1,50-2,65-1,40-2,60-1,55-1,25-1,15-0,5-3 ) =2 } After dilation ( I ′ ) = [ 45 50 65 40 66 55 25 15 5 ] { \displaystyle ( I ‘ ) = { \begin { bmatrix } 45 & 50 & 65\\40 & 66 & 55\\25 & 15 & 5\end { bmatrix } } } After corrosion ( I ′ ) = [ 45 50 65 40 2 55 25 15 5 ] { \displaystyle ( I ‘ ) = { \begin { bmatrix } 45 & 50 & 65\\40 & 2 & 55\\25 & 15 & 5\end { bmatrix } } } An unfold method acting is merely merely corrosion inaugural, and then dilation while the closure method is vice versa. In reality, the D ( I, B ) and E ( I, B ) can implemented by whirl

Original Image None Use Matlab to read Original image

 original  =  imread ( 'scene.jpg ' ) ;
prototype  =  rgb2gray ( original ) ;
[ gas constant,  c,  channel ]  =  size ( image ) ;
southeast  =  legitimate ( [ 1  1  1  ;  1  1  1  ;  1  1  1 ] ) ;
[ p,  q ]  =  size ( selenium ) ;
halfH  =  floor ( phosphorus / 2 ) ;
halfW  =  floor ( q / 2 ) ;
fourth dimension  =  3 ; % denoising 3 times with all method acting

original lotus
Dilation [ 1 1 1 1 1 1 1 1 1 ] { \displaystyle { \begin { bmatrix } 1 & 1 & 1\\1 & 1 & 1\\1 & 1 & 1\end { bmatrix } } } Use Matlab to dilation

 imwrite ( persona,   scene_dil.jpg '' )
extractmax  =  zero ( size ( effigy ),  course ( trope ) ) ;
for  i  =  1  :  time
dil_image  =  imread ( 'scene_dil.jpg ' ) ;
for  col  =  ( halfW  +  1 ) :  ( c  -  halfW )
for  rowing  =  ( halfH  +  1 )  :  ( gas constant  -  halfH )
dpointD  =  row  -  halfH ;
dpointU  =  row  +  halfH ;
dpointL  =  col  -  halfW ;
dpointR  =  col  +  halfW ;
dneighbor  =  dil_image ( dpointD : dpointU,  dpointL : dpointR ) ;
trickle  =  dneighbor ( southeast ) ;
extractmax ( row,  col )  =  soap ( percolate ) ;
end
end
imwrite ( extractmax,   scene_dil.jpg '' ) ;
end

Denoising mental picture with dilation method acting
Erosion [ 1 1 1 1 1 1 1 1 1 ] { \displaystyle { \begin { bmatrix } 1 & 1 & 1\\1 & 1 & 1\\1 & 1 & 1\end { bmatrix } } } Use Matlab to erosion

 imwrite ( image,  'scene_ero.jpg ' ) ;
extractmin  =  zero ( size ( image ),  classify ( image ) ) ;
for  one  =  1 :  time
ero_image  =  imread ( 'scene_ero.jpg ' ) ;
for  col  =  ( halfW  +  1 ) :  ( c  -  halfW )
for  rowing  =  ( halfH  + 1 ) :  ( r  - halfH )
pointDown  =  row - halfH ;
Read more : 679,988 Computer Room Stock Photos and Images – 123RF  pointUp  =  quarrel + halfH ;
pointLeft  =  col - halfW ;
pointRight  =  col + halfW ;
neighbor  =  ero_image ( pointDown : pointUp, pointLeft : pointRight ) ;
filter  =  neighbor ( southeast ) ;
extractmin ( row,  col )  =  min ( filter ) ;
goal
end
imwrite ( extractmin,   scene_ero.jpg '' ) ;
end

Opening [ 1 1 1 1 1 1 1 1 1 ] { \displaystyle { \begin { bmatrix } 1 & 1 & 1\\1 & 1 & 1\\1 & 1 & 1\end { bmatrix } } } Use Matlab to Opening

 imwrite ( extractmin,   scene_opening.jpg '' )
extractopen  =  nothing ( size ( persona ),  class ( effigy ) ) ;
for  one  =  1  :  prison term
dil_image  =  imread ( 'scene_opening.jpg ' ) ;
for  col  =  ( halfW  +  1 ) :  ( c  -  halfW )
for  quarrel  =  ( halfH  +  1 )  :  ( radius  -  halfH )
dpointD  =  quarrel  -  halfH ;
dpointU  =  row  +  halfH ;
dpointL  =  col  -  halfW ;
dpointR  =  col  +  halfW ;
dneighbor  =  dil_image ( dpointD : dpointU,  dpointL : dpointR ) ;
filter  =  dneighbor ( selenium ) ;
extractopen ( row,  col )  =  soap ( filter ) ;
end
end
imwrite ( extractopen,   scene_opening.jpg '' ) ;
end

Closing [ 1 1 1 1 1 1 1 1 1 ] { \displaystyle { \begin { bmatrix } 1 & 1 & 1\\1 & 1 & 1\\1 & 1 & 1\end { bmatrix } } } Use Matlab to Closing

 imwrite ( extractmax,   scene_closing.jpg '' )
extractclose  =  zero ( size ( effigy ),  classify ( image ) ) ;
for  one  =  1  :  time
ero_image  =  imread ( 'scene_closing.jpg ' ) ;
for  col  =  ( halfW  +  1 ) :  ( c  -  halfW )
for  quarrel  =  ( halfH  +  1 )  :  ( radius  -  halfH )
dpointD  =  row  -  halfH ;
dpointU  =  course  +  halfH ;
dpointL  =  col  -  halfW ;
dpointR  =  col  +  halfW ;
dneighbor  =  ero_image ( dpointD : dpointU,  dpointL : dpointR ) ;
trickle  =  dneighbor ( southeast ) ;
extractclose ( row,  col )  =  minute ( filter ) ;
end
end
imwrite ( extractclose,   scene_closing.jpg '' ) ;
end

Denoising photograph with close up method

In arrange to apply the denoising method to an visualize, the visualize is converted into grayscale. A masquerade with denoising method is coherent matrix with [ 111 ; 111 ; 111 ] { \displaystyle [ 111 ; 111 ; 111 ] } . The denoising methods start from the center of the picture with half of altitude, half of width, and end with the image limit of row number, column issue. Neighbor is a barricade in the original image with the limit [ the point below center : the point above, the point on left of center : the point on the right of center ]. Convolution Neighbor and structuring element and then replace the center with a minimum of neighbor. Take the Closing method acting for exercise. dilation first

1. Read the image and convert it into grayscale with Matlab.
1. Get the size of an image. The return value row numbers and column numbers are the boundaries we are going to use later.
2. structuring elements depend on your dilation or erosion function. The minimum of the neighbor of a pixel leads to an erosion method and the maximum of neighbor leads to a dilation method.
3. Set the time for dilation, erosion, and closing.
2. Create a zero matrix of the same size as the original image.
3. Dilation first with structuring window.
1. structuring window is 3*3 matrix and convolution
2. For loop extract the minimum with window from row range [2 ~ image height – 1] with column range [2 ~ image width – 1]
4. Fill the minimum value to the zero matrix and save a new image
1. For the boundary, it can still be improved. Since in the method, a boundary is ignored. Padding elements can be applied to deal with boundaries.

then Erosion ( Take the dilation effigy as stimulation )

1. Create a zero matrix of the same size as the original image.
2. Erosion with structuring window.
1. structuring window is 3*3 matrix and convolution
2. For loop extract the maximum with window from row range [2 ~ image height – 1] with column range [2 ~ image width – 1]
3. Fill the maximum value to the zero matrix and save a new image
1. For the boundary, it can still be improved. Since in the method, boundary is ignored. Padding elements can be applied to deal with boundaries.
4. Results are as above table shown

## Applications

### Digital television camera images

Digital cameras generally include specialize digital double processing hardware – either dedicated chips or added circuitry on other chips – to convert the naked data from their image detector into a color-corrected visualize in a standard image file format. Additional post process techniques increase edge edge or color saturation to create more naturally looking images .

### film

Westworld ( 1973 ) was the first feature movie to use the digital trope serve to pixellate photography to simulate an android ‘s steer of watch. [ 28 ] Image process is besides vastly used to produce the saturation key impression that replaces the background of actors with natural or artistic scenery .

### face detection

Face detection process Face detection can be implemented with Mathematical morphology, Discrete cosine transform which is normally called DCT, and horizontal Projection ( mathematics ). General method with feature-based method The feature-based method acting of face detection is using skin tone, edge detection, face condition, and feature of speech of a face ( like eyes, mouth, etc. ) to achieve face detection. The skin tone, grimace determine, and all the singular elements that merely the human face have can be described as features. Process explanation

1. Given a batch of face images, first, extract the skin tone range by sampling face images. The skin tone range is just a skin filter.
1. Structural similarity index measure (SSIM) can be applied to compare images in terms of extracting the skin tone.
2. Normally, HSV or RGB color spaces are suitable for the skin filter. E.g. HSV mode, the skin tone range is [0,48,50] ~ [20,255,255]
2. After filtering images with skin tone, to get the face edge, morphology and DCT are used to remove noise and fill up missing skin areas.
1. Opening method or closing method can be used to achieve filling up missing skin.
2. DCT is to avoid the object with tone-like skin. Since human faces always have higher texture.
3. Sobel operator or other operators can be applied to detect face edge.
3. To position human features like eyes, using the projection and find the peak of the histogram of projection help to get the detail feature like mouse, hair, and lip.
1. Projection is just projecting the image to see the high frequency which is usually the feature position.

### improvement of visualize quality method

image quality can be influenced by television camera oscillation, over-exposure, gray tied distribution excessively centralized, and noise, etc. For example, noise trouble can be solved by Smoothing method while grey level distribution trouble can be improved by Histogram Equalization. Smoothing method In draw, if there is some dissatisfy color, taking some color around disgruntled color and averaging them. This is an easily means to think of Smoothing method. Smoothing method acting can be implemented with disguise and Convolution. Take the small image and disguise for exemplify as below. persona is [ 2 5 6 5 3 1 4 6 1 28 30 2 7 3 2 2 ] { \displaystyle { \begin { bmatrix } 2 & 5 & 6 & 5\\3 & 1 & 4 & 6\\1 & 28 & 30 & 2\\7 & 3 & 2 & 2\end { bmatrix } } } mask is [ 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 ] { \displaystyle { \begin { bmatrix } 1/9 & 1/9 & 1/9\\1/9 & 1/9 & 1/9\\1/9 & 1/9 & 1/9\end { bmatrix } } } After Convolution and polish, double is [ 2 5 6 5 3 9 10 6 1 9 9 2 7 3 2 2 ] { \displaystyle { \begin { bmatrix } 2 & 5 & 6 & 5\\3 & 9 & 10 & 6\\1 & 9 & 9 & 2\\7 & 3 & 2 & 2\end { bmatrix } } } Oberseving picture [ 1, 1 ], image [ 1, 2 ], image [ 2, 1 ], and double [ 2, 2 ]. The original image pixel is 1, 4, 28, 30. After smoothing mask, the pixel becomes 9, 10, 9, 9 respectively. new image [ 1, 1 ] = 1 9 { \displaystyle { \tfrac { 1 } { 9 } } } * ( picture [ 0,0 ] +image [ 0,1 ] +image [ 0,2 ] +image [ 1,0 ] +image [ 1,1 ] +image [ 1,2 ] +image [ 2,0 ] +image [ 2,1 ] +image [ 2,2 ] ) new trope [ 1, 1 ] = floor ( 1 9 { \displaystyle { \tfrac { 1 } { 9 } } } * ( 2+5+6+3+1+4+1+28+30 ) ) = 9 newly picture [ 1, 2 ] = floor ( { 1 9 { \displaystyle { \tfrac { 1 } { 9 } } } * ( 5+6+5+1+4+6+28+30+2 ) ) = 10 new double [ 2, 1 ] = floor ( 1 9 { \displaystyle { \tfrac { 1 } { 9 } } } * ( 3+1+4+1+28+30+73+3+2 ) ) = 9 new image [ 2, 2 ] = floor ( 1 9 { \displaystyle { \tfrac { 1 } { 9 } } } * ( 1+4+6+28+30+2+3+2+2 ) ) = 9 Gray Level Histogram method by and large, given a gray flush histogram from an trope as below. Changing the histogram to uniform distribution from an trope is normally what we called Histogram equalization .
digit 1 figure 2 In discrete time, the area of gray level histogram is ∑ one = 0 potassium H ( p i ) { \displaystyle \sum _ { i=0 } ^ { thousand } H ( p_ { i } ) } ( see calculate 1 ) while the area of uniform distribution is ∑ one = 0 k G ( q iodine ) { \displaystyle \sum _ { i=0 } ^ { potassium } G ( q_ { i } ) } ( see figure 2 ). It ‘s clear that the area wo n’t change, so ∑ i = 0 kelvin H ( p i ) = ∑ one = 0 kelvin G ( q one ) { \displaystyle \sum _ { i=0 } ^ { k } H ( p_ { i } ) =\sum _ { i=0 } ^ { kilobyte } G ( q_ { i } ) } . From the consistent distribution, the probability of q i { \displaystyle q_ { i } } is N 2 q potassium − q 0 { \displaystyle { \tfrac { N^ { 2 } } { q_ { k } -q_ { 0 } } } } while the 0 < iodine < k { \displaystyle 0
In continuous time, the equation is ∫ q 0 q N 2 q thousand − q 0 vitamin d second = ∫ p 0 p H ( s ) d second { \displaystyle \displaystyle \int _ { q_ { 0 } } ^ { q } { \tfrac { N^ { 2 } } { q_ { k } -q_ { 0 } } } ds=\displaystyle \int _ { p_ { 0 } } ^ { phosphorus } H ( s ) d } . furthermore, based on the definition of a function, the Gray flat histogram method is like finding a function degree fahrenheit { \displaystyle farad } that satisfies fluorine ( phosphorus ) =q .

Improvement method Issue Before improvement Process After improvement
Smoothing method noise
with Matlab, salt & pepper with 0.01 argument is added
to the original prototype in ordering to create a noisy picture .
1. read image and convert image into grayscale
2. convolution the graysale image with the mask [ 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 1 / 9 ] { \displaystyle { \begin { bmatrix } 1/9 & 1/9 & 1/9\\1/9 & 1/9 & 1/9\\1/9 & 1/9 & 1/9\end { bmatrix } } }
3. denoisy image will be the result of step 2.
Histogram Equalization Gray level distribution too centralized Refer to the Histogram equalization

## far take

source : https://oanhthai.com
Category : Tutorial