Method and device for enhancing image contrast, display apparatus, and storage medium
11238571 · 2022-02-01
Assignee
Inventors
Cpc classification
International classification
Abstract
The present disclosure provides a method for enhancing image contrast, including: dividing an input image into a plurality of input sub-images, each of the plurality of input sub-images corresponding to a gray value distribution range, the gray value distribution ranges of the respective input sub-images being different from each other, and each input sub-image comprising all pixels, among pixels of the input image, whose gray values are within the gray value distribution range of the input sub-image; performing an equalization processing on each of the plurality of input sub-images, and obtaining a plurality of output sub-images corresponding to the plurality of input sub-images, respectively, based on a result of the equalization processing; and merging the plurality of output sub-images to obtain an output image corresponding to the input image. The present disclosure further provides a device for enhancing image contrast, a display apparatus, and a computer-readable storage medium.
Claims
1. A method for enhancing image contrast, comprising: dividing an input image into a plurality of input sub-images, each of the plurality of input sub-images corresponding to a gray value distribution range, the gray value distribution ranges of the respective input sub-images being different from each other, and each input sub-image comprising all pixels, among pixels of the input image, whose gray values are within the gray value distribution range of the input sub-image; performing an equalization processing on each of the plurality of input sub-images, and obtaining a plurality of output sub-images corresponding to the plurality of input sub-images, respectively, based on a result of the equalization processing; wherein the step of diving the input image into the plurality of input sub-images comprises: merging the plurality of output sub-images to obtain an output image corresponding to the input image; performing a histogram statistics on gray values of the pixels of the input image to obtain a histogram of the input image, wherein the histogram of the input image indicates a total gray value distribution range of the input image and comprises pixel information of the input image, and the pixel information of the input image comprises a plurality of gray values and the number of pixels of the input image corresponding to each of the plurality of gray values; and dividing, according to the histogram of the input image, the input image into the plurality of input sub-images, wherein the step of dividing, according to the histogram of the input image, the input image into the plurality of input sub-images comprises: dividing, according to the histogram of the input image, the input image into n input sub-images respectively corresponding to different gray value distribution ranges, such that a total gray value of each input sub-image is the same, the total gray value of each input sub-image is obtained by using the following formula (1):
g=(1/n)G (1) where g is the total gray value of each input sub-image and is obtained by summing gray values of all pixels in the input sub-image, and G is a total gray value of the input image and is obtained by summing gray values of all pixels of the input image.
2. The method of claim 1, wherein the step of performing the equalization processing on each of the plurality of input sub-images, and obtaining the plurality of output sub-images corresponding to the plurality of input sub-images, respectively, based on the result of the equalization processing comprises: performing the histogram statistics on the gray values of the pixels of each input sub-image to obtain a histogram of the input sub-image, wherein the histogram of the input sub-image comprises pixel information of the input sub-image, and the pixel information of the input sub-image comprises each of gray values within the gray value distribution range of the input sub-image and the number of pixels of the input sub-image corresponding to each of the gray values within the gray value distribution range; forming a first matrix by using the pixel information of the input sub-image; performing a histogram equalization processing on the first matrix to obtain an intermediate matrix corresponding to the input sub-image; performing a singular value decomposition (SVD) on the first matrix to obtain a first singular value mean corresponding to the first matrix; performing the SVD on the intermediate matrix to obtain a second singular value mean corresponding to the intermediate matrix; calculating and obtaining a ratio of the second singular value mean and the first singular value mean; and fitting the first singular value mean towards the intermediate matrix by using the ratio, to obtain an output submatrix, numerical values in the output submatrix being equal to gray values of pixels of an output sub-image corresponding to the input sub-image, respectively.
3. The method of claim 2, wherein the steps of performing the SVD on the first matrix and the intermediate matrix comprise: performing, in a case that the input image is divided into the n input sub-images, the SVD on sub_img.sub.i and sub_img.sub.i_heq.sub.i by using the following formulas (2) and (3):
sub_img.sub.i=U.sub.i*S.sub.i*V.sub.i (2)
sub_img.sub.i_=U_heq.sub.i*S_heq.sub.i*V_heq.sub.i (3) wherein i represents a serial number of the input sub-image, and is a natural number ranged from 1 to n, sub_img.sub.i represents the first matrix formed by using pixel information of an i-th input sub-image, sub_img.sub.i_heq.sub.i represents the intermediate matrix obtained by performing the histogram equalization processing on sub_img.sub.i, U.sub.i is a k×k matrix, S.sub.i is a k×1 matrix, V.sub.i is a 1×1 matrix, U_heq.sub.i is a k×k matrix, S_heq.sub.i is a k×1 matrix, V_heq.sub.i is a 1×1 matrix, S.sub.i comprises a singular value of sub_img.sub.i, and S_heq.sub.i comprises a singular value of sub_img.sub.i_heq.sub.i.
4. The method of claim 3, wherein the step of calculating and obtaining the ratio of the second singular value mean and the first singular value mean comprises: obtaining the first singular value mean S_mean.sub.i corresponding to sub_img.sub.i by calculating a mean value of S.sub.i; obtaining the second singular value mean S_heq.sub.i_mean.sub.i corresponding to sub_img.sub.i_heq.sub.i by calculating a mean value of S_heq.sub.i; and obtaining the ratio of the second singular value mean and the first singular value mean by using the following formula (4):
r=S_heq.sub.i_mean.sub.i/S_mean.sub.i (4) wherein r is the ratio of S_heq.sub.i_mean.sub.i to S_mean.sub.i, and The step of fitting the first singular value mean towards the intermediate matrix by using the ratio, to obtain the output submatrix comprises: obtaining the output submatrix sub_img_out.sub.i of the i-th input sub-image by using the following formula (5), the output submatrix sub_img_out.sub.i including pixel information of the output sub-image corresponding to the i-th input sub-image:
sub_img_out.sub.i=U.sub.i*(r*S.sub.i)*V.sub.i (5).
5. The method of claim 4, wherein the step of merging the plurality of output sub-images to obtain the output image corresponding to the input image comprises: merging output submatrices of the n output sub-images by using the following formula (6) to obtain an output matrix of the output image corresponding to the input image:
6. A device for enhancing image contrast comprising: an image division unit configured to divide an input image into a plurality of input sub-images according to gray values of pixels of the input image, each of the plurality of input sub-images corresponding to a gray value distribution range, the gray value distribution ranges of the respective input sub-images being different from each other, and each input sub-image comprising all pixels, among the pixels of the input image, whose gray values are within the gray value distribution range of the input sub-image; an image equalization unit configured to perform an equalization processing on each of the plurality of input sub-images, and obtain a plurality of output sub-images corresponding to the plurality of input sub-images, respectively, based on a result of the equalization processing; an image merging unit configured to merge the plurality of output sub-images to obtain an output image corresponding to the input image, wherein the image division unit comprises: a histogram statistics subunit configured to perform a histogram statistics on the gray values of the pixels of the input image to obtain a histogram of the input image, wherein the histogram of the input image indicates a total gray value distribution range of the input image and comprises pixel information of the input image, and the pixel information of the input image comprises a plurality of gray values and the number of pixels of the input image corresponding to each of the plurality of gray values; and a sub-image division subunit configured to divide the input image into the plurality of input sub-images according to the histogram of the input image, wherein the subimage division subunit is configured to: divide the input image into n input sub-images respectively corresponding to different gray value distribution ranges according to the histogram of the input images, such that a total gray value of each input sub-image is the same, the total gray value of catch input sub-image is obtained by using the following formula (1):
g=(1/n)G (1) wherein g is the total gray value of each input sub-image and is obtained by summing gray values of all pixels in the input sub-image, and G is a total gray value of the input image and is obtained by summing gray values of all pixels of the input image.
7. An apparatus comprising: at least one processor; and a memory for storing at least one computer program; wherein when the at least one computer program is executed by the at least one processor, the at least one processor performs the method for enhancing image contrast of claim 1.
8. A non-transitory computer-readable storage medium encoded with a computer program, wherein when the computer program is executed by a processor, causes the processor to perform the method for enhancing image contrast of claim 1.
9. The device of claim 6, wherein the image equalization unit comprises: a histogram equalization processing subunit configured to: perform the histogram statistics on the gray values of the pixels of each input sub-image to obtain a histogram of the input sub-image comprising pixel information of the input sub-image, wherein the pixel information of the input sub-image comprises each of gray values within the gray value distribution range of the input sub-image and the number of pixels of the input sub-image corresponding to each of the gray values within the gray value distribution range; form a first matrix by using the pixel information of the input sub-image; and perform a histogram equalization processing on the first matrix to obtain an intermediate matrix corresponding to the input sub-image; a calculation subunit configured to: perform a singular value decomposition (SVD) on the first matrix to obtain a first singular value mean corresponding to the first matrix; perform the SVD on the intermediate matrix to obtain a second singular value mean corresponding to the intermediate matrix; and calculate and obtain a ratio of the second singular value mean and the first singular value mean; and a fitting subunit configured to fit the first singular value mean towards the intermediate matrix by using the ratio, to obtain an output submatrix, numerical values in the output submatrix being equal to gray values of pixels of an output sub-image corresponding to the input sub-image, respectively.
10. The device of claim 9, wherein the calculation subunit is configured to: perform, in a case that the input image is divided into the n input sub-images, the SVD on sub_img.sub.i and sub_img.sub.i_heq.sub.i by using the following formulas (2) and (3):
sub_img.sub.i=U.sub.i*S.sub.i*V.sub.i (2)
sub_img.sub.i_=U_heq.sub.i*S_heq.sub.i*V_heq.sub.i (3) wherein i represents a serial number of the input sub-image, and is a natural number ranged from 1 to n, sub_img.sub.i represents the first matrix formed by using pixel information of an i-th input sub-image, sub_img.sub.i_heq.sub.i represents the intermediate matrix obtained by performing the histogram equalization processing on sub_img.sub.i, U.sub.i is a k×k matrix, S.sub.i is a k×1 matrix, V.sub.i is a 1×1 matrix, U_heq.sub.i is a k×k matrix, S_heq.sub.i is a k×1 matrix, V_heq.sub.i is a 1×1 matrix, S.sub.i comprises a singular value of sub_img.sub.i, and S_heq.sub.i includes a singular value of sub_img.sub.i_heq.sub.i.
11. The device of claim 10, wherein the calculation subunit is configured to: obtain the first singular value mean S_mean.sub.i corresponding to sub_img.sub.i, by calculating a mean value of S.sub.i; obtain the second singular value mean S_heq.sub.i_mean.sub.i corresponding to sub_img.sub.i_heq.sub.i by calculating a mean value of S_heq.sub.i; and obtain the ratio of the second singular value mean and the first singular value mean by using the following formula (4):
r=S_heq.sub.i_mean.sub.i/S_mean.sub.i (4) wherein r is the ratio of S_heq.sub.i_mean.sub.i to S_mean.sub.i; and the fitting subunit is configured to: obtain the output submatrix sub_img_out.sub.i of the i-th input sub-image by using the following formula (5), the output submatrix sub_img_out.sub.i comprising pixel information of the output sub-image corresponding to the i-th input sub-image:
sub_img_out.sub.i=U.sub.i*(r*S.sub.i)*V.sub.i (5).
12. The device of claim 11, wherein the image merging unit is configured to: merge output submatrices of the n output sub-images by using the following formula (6) to obtain an output matrix of the output image corresponding to the input image:
13. A display apparatus comprising a display panel and the device for enhancing image contrast of claim 6.
Description
BRIEF DESCRIPTION OF THE FIGURES
(1) The above and other aspects of the present disclosure will become more apparent by describing the exemplary embodiments of the disclosure in detail with reference to the drawings. In the drawings,
(2)
(3)
(4)
(5)
DETAILED DESCRIPTION
(6) Specific embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein is only intended to illustrate and explain the present disclosure, instead of limiting the present disclosure.
(7)
(8) As shown in
(9) In step S1, an input image is divided into a plurality of input sub-images, each input sub-image corresponds to a gray value distribution range. The gray value distribution ranges of the respective input sub-images are different from each other, and each input sub-image includes all pixels, among pixels of the input image, whose gray values are within the gray value distribution range of this input sub-image.
(10) In step S2, an equalization processing is performed on each of the plurality of input sub-images, and a plurality of output sub-images corresponding to the plurality of input sub-images are obtained based on a result of the equalization processing.
(11) In step S3, the plurality of output sub-images are merged to obtain an output image corresponding to the input image.
(12) Specifically, in an embodiment of the present disclosure, in step S1, the input image is divided into the plurality of input sub-images according to the gray value distribution of the pixels of the input image. Gray values of the pixels of the same input sub-image are within a same gray value distribution range, and gray values of the pixels of different input sub-images are within different gray value distribution ranges, respectively. Therefore, the equalization processing performed on each input sub-image in step S2 may be not affected by other input sub-images, such that the image contrast of the output image obtained by the method for enhancing image contrast provided by the present disclosure can be enhanced in comparison with that of the input image, and the brightness of the output image can be maintained substantially the same as that of the input image, i.e., excessive brightness of the output image can be avoided.
(13) In some embodiments of the present disclosure, the equalization processing performed in step S2 may be a histogram equalization processing. However, the present disclosure is not limited thereto. The equalization processing performed in step S2 may be any other suitable equalization processing.
(14) It should be noted that, the principle of the histogram equalization processing is that the gray values of the pixels of the input image which are mostly concentrated in some gray value intervals of the histogram of the input image are processed so as to be uniformly distributed throughout the gray value distribution range of the histogram of the input image. That is to say, the histogram equalization processing is to stretch the input image in a nonlinear manner, and redistribute the gray values of the pixels of the input image such that the number of pixels with any one gray value within a certain gray range is substantially the same as the number of pixels with any another gray value within the certain gray range. Therefore, by transforming the histogram of the original input image into a histogram in a form in which the gray values are uniformly distributed, the dynamic range of the gray values of the pixels of the input image is increased, thus the effect of enhancing the overall image contrast can be achieved.
(15) Based on the principle of the histogram equalization process described above, it is easily understood that in practical applications, the distribution of gray values of the input image may be non-uniform. When there is a region in the input image where the gray values differ greatly, the histogram equalization processing is generally performed on the entire input image, which causes the gray values of all the pixels in the input image to approach a mean value. The mean value has a large deviation from the original gray values of the pixels in the region where the gray values differ greatly, and therefore the overall image contrast is seriously degraded, and the image is distorted.
(16) In the method for enhancing image contrast provided by an embodiment of the present disclosure, the image distortion can be avoided by dividing the input image into the plurality of input sub-images and then performing histogram equalization processing on the respective input sub-images.
(17)
(18) The above steps S1 to S3 will be further described in detail below based on the histogram of the input image shown in
(19)
(20) As shown in
(21) In step S11, the histogram statistics is performed on the gray values of the pixels of the input image to obtain the histogram of the input image. The histogram of the input image includes pixel information of the input image, and the pixel information of the input image includes a plurality of gray values and the number of the pixels of the input image corresponding to each of the plurality of gray values.
(22) In step S12, the input image is divided into the plurality of input sub-images according to the histogram of the input image. Each of the plurality of input sub-images corresponds to a gray value distribution range, the gray value distribution ranges of the respective input sub-images are different from each other, and each input sub-image includes all pixels, among pixels of the input image, whose gray values are within the gray value distribution range of this input sub-image.
(23) For example, as shown in
(24) In some embodiments, step S12 may include dividing, according to a division value, the input image into n input sub-images corresponding to different gray value distribution ranges, respectively. The division value is equal to a total gray value of each input sub-image and may be obtained by using the following formula (1):
(25)
in which, g is the division value of each input sub-image, and G is a total gray value of the input image.
(26) It will be appreciated that, in the process of dividing the input image into the plurality of input sub-images by using the above formula (1), it is required to calculate the total gray value G of the input image. The division value g of each input sub-image is equal to 1/n of the total gray value G of the input image. That is to say, the division values of the n input sub-images are the same. In this case, the n input sub-images obtained by performing the dividing by using the division value g have gray value distribution ranges different from each other.
(27) It will be appreciated that, the total gray value G of the input image can be obtained by summing the gray values of all the pixels of the input image. Accordingly, the total gray value of each input sub-image can be obtained by summing the gray values of all the pixels in this input sub-image.
(28) It should be noted that the present disclosure has no limitation on the value of n. For example, the value of n can be adaptively set according to the computing power of a device for image division.
(29) As described above, the division value g is equal to the total gray value of each input sub-image, and the respective input sub-images have different gray value distribution ranges. It is easily understood in conjunction with
(30) As shown in
(31) In step S21, the histogram statistics is performed on the gray values of the pixels of each input sub-image so as to obtain a histogram of the input sub-image including pixel information of the input sub-image, and a first matrix is formed by using the pixel information of the input sub-image, the histogram equalization processing is performed on the first matrix to obtain an intermediate matrix corresponding to the input sub-image. The pixel information of the input sub-image includes: each of the gray values within the gray value distribution range of the input sub-image, and the number of the pixels of the input sub-image corresponding to each of the gray values within the gray value distribution range of the input sub-image.
(32) In step S22, singular value decomposition (SVD) is performed on the first matrix to obtain a first singular value mean corresponding to the first matrix.
(33) In step S23, the SVD is performed on the intermediate matrix to obtain a second singular value mean corresponding to the intermediate matrix.
(34) In step S24, a ratio of the second singular value mean and the first singular value mean is calculated and obtained.
(35) In step S25, the first singular value mean is fitted towards the intermediate matrix by using the ratio, to obtain an output submatrix. The numeral values in the output submatrix are equal to the gray values of the pixels in the output sub-image corresponding to the input sub-image, respectively. In other words, an image including the information in the output submatrix is the output sub-image obtained by performing the equalization processing on the input sub-image.
(36) As described above, the principle of the histogram equalization processing has been described in the above, and will not be repeated here. Based on the principle of the histogram equalization processing, the histogram equalization processing is performed on the first matrix of the input sub-image including the pixel information of the input sub-image so as to obtain the intermediate matrix corresponding to the input sub-image.
(37) In some embodiments, in the case that the input image is divided into n input sub-images, the above steps S22 and S23 include the following processing, in which a first matrix formed by using pixel information of an i-th input sub-image is represent by sub_img.sub.i, where i is an natural number ranged from 1 to n, a corresponding intermediate matrix obtained by performing the histogram equalization processing on the first matrix sub_img.sub.i is represent by sub_img.sub.i_heq.sub.i, and the SVD is performed respectively on sub_img.sub.i and sub_img.sub.i_heq.sub.i by using the following formulas (2) and (3):
sub_img.sub.i=U.sub.i*S.sub.i*V.sub.i (2)
sub_img.sub.i—heq.sub.i=U_heq.sub.i*S_heq.sub.i*V_heq.sub.i (3)
in which, U.sub.i is a k×k matrix, S.sub.i is a k×1 matrix, V.sub.i is a 1×1 matrix, U_heq.sub.i is a k×k matrix, S_heq.sub.i is a k×1 matrix, V_heq.sub.i is a 1×1 matrix. S.sub.i includes a singular value of the first matrix sub_img.sub.i formed by using the pixel information of the i-th input sub-image, and S_heq.sub.i includes a singular value of the intermediate matrix sub_img.sub.i_heq.sub.i of the i-th input sub-image.
(38) In some embodiments, the above steps S24 and S25 include: obtaining a first singular value mean S_mean.sub.i corresponding to sub_img.sub.i by calculating a mean value of S.sub.i; obtaining a second singular value mean S_heq.sub.i_mean.sub.i corresponding to sub_img.sub.i_heq.sub.i by calculating a mean value of S_heq.sub.i; and performing fitting by using the following formulas (4) and (5) so as to obtain the output submatrix sub_img_out.sub.i of the i-th input sub-image, i.e., a matrix including pixel information of the output sub-image corresponding to the i-th input sub-image:
r=S_heq.sub.i_mean.sub.i/S_mean.sub.i (4)
sub_img_out.sub.i=U.sub.i*(r*S.sub.i)*V.sub.i (5)
in which, r is a ratio of S_heq.sub.i_mean.sub.i to S_mean.sub.i.
(39) It will be appreciated that, since the numeral values in the output submatrix of the i-th input sub-image are equal to the gray values of the respective pixels in the output sub-images corresponding to the i-th input sub-image, the output sub-image corresponding to the i-th input sub-image can be easily obtained from the output sub-matrix sub_img_out.sub.i of the i-th input sub-image.
(40) In some embodiments, in the case that the input image is divided into n input sub-images, step S3 may include: merging the output submatrices of the n output sub-images by using the following formula (6), so as to obtain an output matrix of the output image corresponding to the input image:
(41)
in which, ω.sub.i represents a merging weight value and Σω.sub.i=1, img_out represents an output matrix including the pixel information of the output image, sub_img_out.sub.i represents the output submatrix including the pixel information of the output sub-image corresponding to the i-th input sub-image, and i represents a serial number of the input sub-image and is an natural number ranged from 1 to n.
(42) It should be noted that, the merging weight value ω.sub.i may be set according to different image scenarios by using multi-dataset statistics, and the output image may be obtained according to img_out. The output image has an enhanced contrast compared with the input image, and has a good overall image brightness.
(43)
(44) As shown in
(45) The image division unit 101 is configured to perform step S1, that is, is configured to divide the input image into the plurality of input sub-images according to the gray values of the pixels of the input image, each of the plurality of input sub-images corresponds to a gray value distribution range, the gray value distribution ranges of the respective input sub-images are different from each other, and each input sub-image includes all pixels, among the pixels of the input image, whose gray values are within the gray value distribution range of this input sub-image.
(46) The image equalization unit 102 is configured to perform step S2, that is, it is configured to perform an equalization processing on each of the plurality of input sub-images, and obtain a plurality of output sub-images corresponding to the a plurality of input sub-images, respectively, based on a result of the equalization processing.
(47) The image merging unit 103 is configured to perform step S3, that is, is configured to merge the plurality of output sub-images to obtain the output image corresponding to the input image.
(48) As described above, instead of performing the histogram equalization processing on the overall input image (i.e., the original image to be processed) in the related art, the apparatus 100 for enhancing image contrast provided by the present disclosure: firstly, dividing the input image into the plurality of input sub-images; secondly, performing the equalization processing on each input sub-image to obtain the plurality of output sub-images in one-to-one correspondence with the plurality of input sub-images; finally, merging the plurality of obtained output sub-images to obtain the output image corresponding to the input image. Therefore, compared to the related art, the output image obtained by the apparatus 100 for enhancing image contrast provided by the present disclosure has an enhanced contrast, and has a good overall image brightness.
(49) In some embodiments, the image division unit 101 may include a histogram statistics subunit 101a and a sub-image division subunit 101b.
(50) The histogram statistics subunit 101a is configured to perform the histogram statistics on the gray values of the pixels of the input image to obtain the histogram of the input image. The histogram of the input image includes the pixel information of the input image, and the pixel information of the input image includes the plurality of gray values and the number of the pixels of the input image corresponding to each of the gray values.
(51) The sub-image division subunit 101b is configured to divide the input image into the plurality of input sub-images according to the histogram of the input image.
(52) In some embodiments, the sub-image division subunit 101b is configured to: divide, according to the division value, the input image into n input sub-images corresponding to different gray value distribution ranges, respectively. The division value is equal to the total gray value of each input sub-image and may be obtained by using the following formula (1):
(53)
in which, g is the division value of each input sub-image, and G is the total gray value of the input image.
(54) In some embodiments, the image equalization unit 102 includes a histogram equalization processing subunit 102a, a calculation subunit 102b, and a fitting subunit 102c.
(55) The histogram equalization processing subunit 102a is configured to: perform the histogram statistics on the gray values of the pixels of each input sub-image to obtain the histogram of the input sub-image including the pixel information of the input sub-image, form a first matrix by using the pixel information of the input sub-image, and perform the histogram equalization processing on the first matrix to obtain an intermediate matrix corresponding to the input sub-image. The pixel information of the input sub-image includes each of the gray values within the gray value distribution range of the input sub-image and the number of the pixels of the input sub-image corresponding to each of the gray values within the gray value distribution range.
(56) The calculation subunit 102b is configured to: perform the SVD on the first matrix to obtain a first singular value mean corresponding to the first matrix, perform the SVD on the intermediate matrix to obtain a second singular value mean corresponding to the intermediate matrix, and calculate and obtain a ratio of the second singular value mean and the first singular value mean.
(57) The fitting subunit 102c is configured to: fit the first singular value mean towards the intermediate matrix by using the ratio, to obtain an output submatrix. The numerical values in the output submatrix are equal to the gray values of the pixels in an output sub-image corresponding to the input sub-image, respectively.
(58) In some embodiments, based on the principle of the histogram equalization processing, the histogram equalization processing is performed on the first matrix of the input sub-image including the pixel information of the input sub-image so as to obtain the intermediate matrix corresponding to the input sub-image.
(59) In some embodiments, in the case that the input image is divided into n input sub-images, the performing SVD on the first matrix and the intermediate matrix includes the following processing, in which the first matrix formed by using the pixel information of the i-th input sub-image is represent by sub_img.sub.i, where i is an natural number ranged from 1 to n, the corresponding intermediate matrix obtained by performing the histogram equalization processing on the first matrix sub_img.sub.i is represent by sub_img.sub.i_heq.sub.i, and the SVD is performed respectively on sub_img.sub.i and sub_img.sub.i_heq.sub.i by using the following formulas (2) and (3):
sub_img.sub.i=U.sub.i*S.sub.i*V.sub.i (2)
sub_img.sub.i_heq.sub.i=U_heq.sub.i*S_heq.sub.i*V_heq.sub.i (3)
in which, U.sub.i is a k×k matrix, S.sub.i is a k×1 matrix, V.sub.i is a 1×1 matrix, U_heq.sub.i is a k×k matrix, S_heq.sub.i is a k×1 matrix, V_heq.sub.i is a 1×1 matrix. S.sub.i includes the singular value of the first matrix sub_img.sub.i formed by using the pixel information of the i-th input sub-image, and S.sub.i_heq.sub.i includes the singular value of the intermediate matrix sub_img.sub.i_heq.sub.i of the i-th input sub-image.
(60) In some embodiments, the above calculating and obtaining the ratio of the second singular value mean and the first singular value mean, and fitting the first singular value mean towards the intermediate matrix by using the ratio so as to obtain the output submatrix includes: obtaining the first singular value mean S_mean.sub.i corresponding to sub_img.sub.i by calculating the mean value of S.sub.i; obtaining the second singular value mean S_heq.sub.i_mean.sub.i corresponding to sub_img.sub.i_heq.sub.i by calculating the mean value of S_heq.sub.i; and then performing fitting by using the the following formulas (4) and (5) so as to obtain the output submatrix sub_img_out.sub.i of the i-th input sub-image, i.e., the matrix including the pixel information of the output sub-image corresponding to the i-th input sub-image:
r=S_heq.sub.i_mean.sub.i/S_mean.sub.i (4)
sub_img_out.sub.i=U.sub.i*(r*S.sub.i)*V.sub.i (5)
in which, r is the ratio of S_heq.sub.i_mean.sub.i to S_mean.sub.i.
(61) In some embodiments, the merging the plurality of output sub-images by the image merging unit 103 to obtain the output image corresponding to the input image may include: merging the output submatrices of the n output sub-images by using the following formula (6), so as to obtain the output matrix of the output image corresponding to the input image:
(62)
in which, ω.sub.i represents a merging weight value and Σω.sub.1=1, img_out represents an output matrix including the pixel information of the output image, sub_img_out.sub.i represents the output submatrix including the pixel information of the output sub-image corresponding to the i-th input sub-image, and i represents the serial number of the input sub-image, and is an natural number ranged from 1 to n.
(63) Since the numbers of the pixels of the respective output sub-images may be different from each other, a method of zero-padding in an output submatrix of an output sub-image having fewer pixels may be adopted, such that the output submatrices of all the output sub-images have the same number of elements.
(64) It should be noted that, the merging weight value ω.sub.i may be set according to different image scenarios by using multi-dataset statistics, and the output image may be obtained according to img_out. The output image has an enhanced contrast compared with the input image, and has a good overall image brightness.
(65) It should be noted that the units or modules involved in the device for enhancing image contrast provided by the present disclosure may be implemented by software, hardware, or a combination thereof. The described units or modules may also be provided in a processor. For example, the units may be software programs disposed in a computer or a mobile smart device, or may be a separately configured hardware device. The names of these units or modules are not a limitation to the units or modules.
(66) An embodiment of the present disclosure further provides a display apparatus which includes a display panel and any of the devices for enhancing image contrast according to the embodiments of the present disclosure.
(67) As described above, since the display apparatus includes the device for enhancing image contrast provided by the present disclosure, an image displayed by the display apparatus has an enhanced contrast compared with the original input image, and has a good overall image brightness, i.e., excessive brightness of the image displayed by the display apparatus can be avoided.
(68) An embodiment of the present disclosure further provides an apparatus which includes at least one processor and a memory for storing at least one program. When the at least one program is executed by the at least one processor, the at least one processor performs the method for enhancing image contrast according to an embodiment of the present disclosure.
(69) An embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program thereon. When the program is executed by a processor, the processor performs the method for enhancing image contrast according to an embodiment of the present disclosure.
(70) It will be appreciated that the above implementations are only exemplary implementations for illustrating the principle of the present disclosure. However, the present disclosure is not limited thereto. An ordinary person skilled in the art can make various modifications and improvements to the present disclosure without departing from the spirit and essence of the present disclosure. These modifications and improvements should be also considered within the protective scope of the present disclosure.