Patent ID: 9734564
Date: 2017-08-15
CPC Classifications: G06K,G06T,H04N

Claim:
1. An image contrast enhancement method, comprising steps of: step 1, providing an image comprising a plurality of pixels aligned in an array, and converting the image into a gray scale image; step 2, calculating an absolute value Q1 of a difference of gray scale values of pixels of two adjacent rows in each same column and a first gray scale value weight k1; a formula of the absolute value Q1 of the difference of gray scale values of pixels of two adjacent rows in each same column is: a formula of the first gray scale value weight k1 is: wherein a value range of the absolute value Q1 of the difference of gray scale values of pixels of two adjacent rows in the same column is 0 to 255, and n is a positive integer larger than 1; performing a first cumulative calculation according to the first gray scale value weight k1 and the gray scale values of pixels of two adjacent rows in each same column; a formula of the first cumulative calculation is: wherein i, j are positive integers, which respectively represent a row number and a column number where the pixel is, and Gray(i,j) is a gray scale value of the pixel of an ith row, jth column, and Gray(i+1,j) is a gray scale value of the pixel of an i+1th row, jth column, and H1 (a) is an amount of the pixels, of which gray scale values are a, and C1(X) is a sum amount of the pixels corresponded with respective gray scale values between Gray(i,j) and Gray(i+1,j); step 3, calculating an absolute value Q2 of a difference of gray scale values of pixels of two adjacent columns in each same row and a second gray scale value weight k2; a formula of the absolute value Q2 of the difference of gray scale values of pixels of two adjacent columns in each same row is: a formula of the second gray scale value weight k2 is: wherein a value range of the absolute value Q2 of the difference of gray scale values of pixels of two adjacent columns in the same row is 0 to 255, and n is a positive integer larger than 1 and is the same value in step 2; performing a second cumulative calculation according to the second gray scale value weight k2 and the gray scale values of pixels of two adjacent columns in each same row; a formula of the second cumulative calculation is: wherein i, j are positive integers, which respectively represent a row number and a column number where the pixel is, and Gray(i,j) is a gray scale value of the pixel of an ith row, jth column, and Gray(i,j+1) is a gray scale value of the pixel of an ith row, j+1 th column, and H3(a) is an amount of the pixels, of which gray scale values are a, and C3(X) is a sum amount of the pixels corresponded with respective gray scale values between Gray(i,j) and Gray(i,j+1); step 4, adding the C1(X) in the step 2 and the C3(X) in the step 3 to obtain C(X); step 5, performing maximum normalization; a formula of the maximum normalization is: and multiplying N(X) by 255 to obtain an enhancement gray scale table out(X), and looking up the enhancement gray scale table out(X) to obtain a new output gray scale value out_gray(i,j).