U.S. patent application number 15/768908 was filed with the patent office on 2019-03-14 for image processing method and device.
The applicant listed for this patent is BEIJING BOE DISPLAY TECHNOLOGY CO., LTD., BOE TECHNOLOGY GROUP CO., LTD.. Invention is credited to Ming CHEN, Jun GUO, Shou LI, Xibin SHAO, Jieqiong WANG.
Application Number | 20190080441 15/768908 |
Document ID | / |
Family ID | 63170108 |
Filed Date | 2019-03-14 |
View All Diagrams
United States Patent
Application |
20190080441 |
Kind Code |
A1 |
GUO; Jun ; et al. |
March 14, 2019 |
IMAGE PROCESSING METHOD AND DEVICE
Abstract
An image processing method and device is configured to convert
an obtained image to be processed into a grayscale chrominance YUV
mode image; determine an equilibrium mapping curve of a whole
grayscale image according to the grayscale image in the YUV mode
image; divide the whole grayscale image into a plurality of
sub-regions, and determine a mapping restriction parameter for each
pixel in each of the sub-regions; adjust a grayscale value of each
pixel in the grayscale image according to the determined
equilibrium mapping curve of the whole grayscale image and the
mapping restriction parameter of each pixel in each of the
sub-regions; and convert the adjusted grayscale image into an image
of original mode. an image is processed using an equilibrium
mapping curve and a plurality of mapping restriction parameters
present the image details well and greatly reduce the calculation
amount.
Inventors: |
GUO; Jun; (Beijing, CN)
; SHAO; Xibin; (Beijing, CN) ; CHEN; Ming;
(Beijing, CN) ; LI; Shou; (Beijing, CN) ;
WANG; Jieqiong; (Beijing, CN) |
|
Applicant: |
Name |
City |
State |
Country |
Type |
BOE TECHNOLOGY GROUP CO., LTD.
BEIJING BOE DISPLAY TECHNOLOGY CO., LTD. |
Beijing
Beijing |
|
CN
CN |
|
|
Family ID: |
63170108 |
Appl. No.: |
15/768908 |
Filed: |
October 27, 2017 |
PCT Filed: |
October 27, 2017 |
PCT NO: |
PCT/CN2017/108018 |
371 Date: |
April 17, 2018 |
Current U.S.
Class: |
1/1 |
Current CPC
Class: |
G06T 7/11 20170101; G06T
2207/20021 20130101; G06T 5/40 20130101; G06T 5/007 20130101; G06T
5/009 20130101 |
International
Class: |
G06T 5/40 20060101
G06T005/40; G06T 5/00 20060101 G06T005/00; G06T 7/11 20060101
G06T007/11 |
Foreign Application Data
Date |
Code |
Application Number |
Feb 17, 2017 |
CN |
201710085931.X |
Claims
1. An image processing method, comprising the steps of: determining
an equilibrium mapping curve of a whole grayscale image according
to the grayscale image in a YUV mode image; dividing the whole
grayscale image into a plurality of sub-regions, and determining a
mapping restriction parameter for each pixel in each of the
sub-regions; and adjusting a grayscale value of each pixel in the
grayscale image according to the determined equilibrium mapping
curve of the whole grayscale image and the mapping restriction
parameter of each pixel in each of the sub-regions.
2. The image processing method according to claim 1, further
comprising the steps of: converting an image to be processed into a
grayscale chrominance YUV mode image; and converting the adjusted
grayscale image into an image of original mode.
3. The image processing method according to claim 1, wherein the
step of determining an equilibrium mapping curve of a whole
grayscale image according to a grayscale image in a YUV mode image
further comprises the steps of: determining a pixel depth and a
grayscale histogram of the grayscale image in the YUV mode image,
and the grayscale value of each pixel in the grayscale image; and
calculating the equilibrium mapping curve of the whole grayscale
image by the following formula: S k = D .times. i = 0 k H ( i ) SUM
, 0 .ltoreq. k .ltoreq. D ##EQU00017## wherein, k is the grayscale
value of a pixel in the grayscale image, S.sub.k is the mapping
value of a pixel with a grayscale value of k in the grayscale
image, SUM is the total number of the pixels in the grayscale
image, H(i) is the number of the pixels with a grayscale value of i
in the grayscale image, and D is the pixel depth of the grayscale
image.
4. The image processing method according to claim 3, wherein the
step of dividing the whole grayscale image into a plurality of
sub-regions, and determining a mapping restriction parameter for
each pixel in each of the sub-regions further comprises the steps
of: dividing the whole grayscale image into a plurality of
transitional regions, and determining a transitional mapping
restriction parameter of each of the transitional regions; and
dividing each of the transitional regions into a plurality of
sub-regions, and determining a mapping restriction parameter for
each pixel in each of the sub-regions according to the determined
transitional mapping restriction parameter of each of the
transitional regions and a set linear interpolation calculation
rule.
5. The image processing method according to claim 4, wherein the
step of determining a transitional mapping restriction parameter of
each of the transitional regions further comprises the steps of:
determining a grayscale mean value and a grayscale standard
deviation of each of the transitional regions; and calculating the
transitional mapping restriction parameter of each of the
transitional regions by the following formula:
L.sub.1x=[M.sub.x.times.N.sub.min1+(T.sub.1-M.sub.x).times.N.sub.max1]/D
L.sub.2x=[S.sub.x.times.N.sub.min2+(T.sub.2-S.sub.x).times.N.sub.max2]/D
L.sub.x= {square root over (L.sub.1x.times.L.sub.2x)} wherein, x is
the serial number of a transitional region, M.sub.x is the
grayscale mean value of the x-th transitional region, S.sub.x is
the grayscale standard deviation of the x-th transitional region,
N.sub.min1 and N.sub.max1 are respectively the preset minimum limit
value and maximum limit value corresponding to the grayscale mean
value of each of the transitional regions, N.sub.min2 and
N.sub.max2 are respectively the preset minimum limit value and
maximum limit value corresponding to the grayscale standard
deviation of each of the transitional regions, T.sub.1 is a preset
limit threshold corresponding to the grayscale mean value of each
of the transitional regions, T.sub.2 is a preset limit threshold
corresponding to the grayscale standard deviation of each of the
transitional regions, D is the pixel depth of the grayscale image,
L.sub.1x is a transitional mapping restriction parameter
corresponding to the grayscale mean value M.sub.x of the x-th
transitional region, L.sub.2x is a transitional mapping restriction
parameter corresponding to the grayscale standard deviation S.sub.x
of the x-th transitional region, and L.sub.x is the transitional
mapping restriction parameter of the x-th transitional region.
6. The image processing method according to claim 4, wherein the
step of determining a mapping restriction parameter for each pixel
in each of the sub-regions according to the determined transitional
mapping restriction parameter of each of the transitional regions
and a set linear interpolation calculation rule further comprises
the steps of: determining a category of each of the sub-regions
according to the position of each of the sub-regions in the
grayscale image, the category comprising: sub-regions located in
four corners of the grayscale image, sub-regions located on the
borders, except the four corners, of the grayscale image, and
sub-regions located in other space, except on the borders, of the
grayscale image; determining a mapping restriction parameter for
each pixel in the sub-regions located in the four corners of the
grayscale image as the transitional mapping restriction parameter
of the transitional region it belongs to according to the
determined transitional mapping restriction parameter of each of
the transitional regions; determining a mapping restriction
parameter for each pixel in the sub-regions located on the borders,
except the four corners, of the grayscale image according to the
determined transitional mapping restriction parameter of each of
the transitional regions and according to a preset uni-linear
interpolation calculation rule; and determining a mapping
restriction parameter for each pixel in the sub-regions located in
other space, except on the borders, of the grayscale image
according to the determined transitional mapping restriction
parameter of each of the transitional regions and according to a
preset bi-linear interpolation calculation rule.
7. The image processing method according to claim 6, wherein the
step of determining a mapping restriction parameter for each pixel
in the sub-regions located on the borders, except the four corners,
of the grayscale image according to the determined transitional
mapping restriction parameter of each of the transitional regions
and according to a preset uni-linear interpolation calculation rule
further comprises the step of: calculating a mapping restriction
parameter for each pixel in the sub-regions located on the borders,
except the four corners, of the grayscale image by the following
formula: .lamda. tr = a .times. L n + b .times. L n ' a + b
##EQU00018## wherein, n is the serial number of the transitional
region to which the pixel to be calculated belongs, t is the serial
number of the sub-region to which the pixel to be calculated
belongs, r is the serial number of the pixel to be calculated in
the t-th sub-region, L.sub.n is the transitional mapping
restriction parameter of the n-th transitional region, n' is the
serial number of the transitional region located on the borders of
the grayscale image and closest to the t-th sub-region, Ln' is the
transitional mapping restriction parameter of the n'-th
transitional region, a is the distance between the pixel to be
calculated and the median of the n'-th transitional region, b is
the distance between the pixel to be calculated and the median of
the transitional region to which it belongs, and .lamda..sub.tr is
the mapping restriction parameter of the pixel to be
calculated.
8. The image processing method according to claim 6, wherein the
step of determining a mapping restriction parameter for each pixel
in the sub-regions located in other space, except on the borders,
of the grayscale image according to the determined transitional
mapping restriction parameter of each of the transitional regions
and according to a preset bi-linear interpolation calculation rule
further comprises the step of: calculating a mapping restriction
parameter for each pixel in the sub-regions located in other space,
except on the borders, of the grayscale image by the following
formula: T pz = c .times. L x + d .times. L x ' c + d ##EQU00019##
T qz ' = c ' .times. L m + d ' .times. L m ' c ' + d '
##EQU00019.2## W pz = g .times. T pz + h .times. T qz ' g + h
##EQU00019.3## Wherein, x is the serial number of the transitional
region to which the pixel to be calculated belongs, p is the serial
number of the sub-region to which the pixel to be calculated
belongs, z is the serial number of the pixel to be calculated in
the p-th sub-region, m is the serial number of the transitional
region longitudinally adjacent to the x-th transitional region and
closest to the p-th sub-region, q is the serial number of the
sub-region adjacent to the p-th sub-region longitudinally and
located in the m-th transitional region, z' is the serial number of
a pixel located in the same column as the pixel to be calculated in
the q-th sub-region, L.sub.x is the transitional mapping
restriction parameter of the x-th transitional region, x' is the
serial number of the transitional region horizontally adjacent to
the x-th transitional region and closest to the p-th sub-region,
L.sub.x' is the transitional mapping restriction parameter of the
x'-th transitional region, L.sub.m is the transitional mapping
restriction parameter of the m-th transitional region, m' is the
serial number of the transitional region horizontally adjacent to
the m-th transitional region and closest to the q-th sub-region,
L.sub.m' is the transitional mapping restriction parameter of the
m'-th transitional region, c is the distance between the pixel to
be calculated and the longitudinal median of the x'-th transitional
region, d is the distance between the pixel to be calculated and
the longitudinal median of the transitional region to which it
belongs, c' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the m'-th transitional
region, d' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the transitional region
to which it belongs, g is the distance between the pixel to be
calculated and the horizontal median of the m-th transitional
region, h is the distance between the pixel to be calculated and
the horizontal median of the transitional region to which it
belongs, T.sub.pz is a middle mapping restriction parameter of the
pixel to be calculated, T.sub.qz' is a middle mapping restriction
parameter of the z'-th pixel in the q-th sub-region, and W.sub.pz
is a mapping restriction parameter of the pixel to be
calculated.
9. The image processing method according to claim 6, wherein the
step of adjusting a grayscale value of each pixel in the grayscale
image according to the determined equilibrium mapping curve of the
whole grayscale image and the mapping restriction parameter of each
pixel in each of the sub-regions further comprises the step of:
adjusting a grayscale value of each pixel in the grayscale image by
the following formula: i y ' = .lamda. y .times. S y + i y .lamda.
y + 1 ##EQU00020## wherein, y is the serial number of each pixel,
i.sub.y is the original grayscale value of the y-th pixel in the
grayscale image, i.sub.y' is the adjusted grayscale value of the
y-th pixel in the grayscale image, .lamda..sub.y is a mapping
restriction parameter of the y-th pixel, and S.sub.y is a mapping
value of the y-th pixel.
10. An image processing device, comprising: an equilibrium mapping
curve determiner configured to determine an equilibrium mapping
curve of a whole grayscale image according to the grayscale image
in a YUV mode image; a mapping restriction parameter determiner
configured to divide the whole grayscale image into a plurality of
sub-regions, and determine a mapping restriction parameter for each
pixel in each of the sub-regions; and a grayscale adjustor
configured to adjust a grayscale value of each pixel in the
grayscale image according to the determined equilibrium mapping
curve of the whole grayscale image and the mapping restriction
parameter of each pixel in each of the sub-regions.
11. The image processing device according to claim 10, further
comprising: a first image converter configured to convert an
obtained image to be processed into a grayscale chrominance YUV
mode image; and a second image converter configured to convert the
adjusted grayscale image into an image of original mode.
12. The image processing device according to claim 10, wherein the
equilibrium mapping curve determiner is further configured to
determine a pixel depth and a grayscale histogram of the grayscale
image in the YUV mode image, and the grayscale value of each pixel
in the grayscale image; and calculate the equilibrium mapping curve
of the whole grayscale image by the following formula: S k = D
.times. i = 0 k H ( i ) SUM , 0 .ltoreq. k .ltoreq. D ##EQU00021##
wherein, k is the grayscale value of each pixel in the grayscale
image, S.sub.k is the mapping value of a pixel with a grayscale
value of k in the grayscale image, SUM is the total number of the
pixels in the grayscale image, H(i) is the number of the pixels
with a grayscale value of i in the grayscale image, and D is the
pixel depth of the grayscale image.
13. The image processing device according to claim 12, wherein the
mapping restriction parameter determiner is further configured to
divide the whole grayscale image into a plurality of transitional
regions, and determine a transitional mapping restriction parameter
of each of the transitional regions; and divide each of the
transitional regions into a plurality of sub-regions, and determine
a mapping restriction parameter for each pixel in each of the
sub-regions according to the determined transitional mapping
restriction parameter of each of the transitional regions and a set
linear interpolation calculation rule.
14. The image processing device according to claim 13, wherein the
mapping restriction parameter determiner is further configured to
determine a grayscale mean value and a grayscale standard deviation
of each of the transitional regions; and calculate the transitional
mapping restriction parameter of each of the transitional regions
by the following formula:
L.sub.1x=[M.sub.x.times.N.sub.min1+(T.sub.1-M.sub.x).times.N.sub.max1]/D
L.sub.2x=[S.sub.x.times.N.sub.min2+(T.sub.2-S.sub.x).times.N.sub.max2]/D
L.sub.x= {square root over (L.sub.1x.times.L.sub.2x)} Wherein, x is
the serial number of a transitional region, M.sub.x is the
grayscale mean value of the x-th transitional region, S.sub.x is
the grayscale standard deviation of the x-th transitional region,
N.sub.min1 and N.sub.max1 are respectively the preset minimum limit
value and maximum limit value corresponding to the grayscale mean
value of each of the transitional regions, N.sub.min2 and
N.sub.max2 are respectively the preset minimum limit value and
maximum limit value corresponding to the grayscale standard
deviation of each of the transitional regions, T.sub.1 is a preset
limit threshold corresponding to the grayscale mean value of each
of the transitional regions, T.sub.2 is a preset limit threshold
corresponding to the grayscale standard deviation of each of the
transitional regions, D is the pixel depth of the grayscale image,
L.sub.1x is a transitional mapping restriction parameter
corresponding to the grayscale mean value M.sub.x of the x-th
transitional region, L.sub.2x is a transitional mapping restriction
parameter corresponding to the grayscale standard deviation S.sub.x
of the x-th transitional region, and L.sub.x is the transitional
mapping restriction parameter of the x-th transitional region.
15. The image processing device according to claim 13, wherein the
mapping restriction parameter determiner is further configured to
determine a category of each of the sub-regions according to the
position of each of the sub-regions in the grayscale image, the
category comprising: sub-regions located in four corners of the
grayscale image, sub-regions located on the borders, except the
four corners, of the grayscale image, and sub-regions located in
other space, except on the borders, of the grayscale image;
determine a mapping restriction parameter for each pixel in the
sub-regions located in the four corners of the grayscale image as
the transitional mapping restriction parameter of the transitional
region it belongs to according to the determined transitional
mapping restriction parameter of each of the transitional regions;
determine a mapping restriction parameter for each pixel in the
sub-regions located on the borders, except the four corners, of the
grayscale image according to the determined transitional mapping
restriction parameter of each of the transitional regions and
according to a preset uni-linear interpolation calculation rule;
and determine a mapping restriction parameter for each pixel in the
sub-regions located in other space, except on the borders, of the
grayscale image according to the determined transitional mapping
restriction parameter of each of the transitional regions and
according to a preset bi-linear interpolation calculation rule.
16. The image processing device according to claim 15, wherein the
mapping restriction parameter determiner is further configured to
calculate a mapping restriction parameter for each pixel in the
sub-regions located on the borders, except the four corners, of the
grayscale image by the following formula: .lamda. tr = a .times. L
n + b .times. L n ' a + b ##EQU00022## Wherein, n is the serial
number of the transitional region to which the pixel to be
calculated belongs, t is the serial number of the sub-region to
which the pixel to be calculated belongs, r is the serial number of
the pixel to be calculated in the t-th sub-region, L.sub.n is the
transitional mapping restriction parameter of the n-th transitional
region, n' is the serial number of the transitional region located
on the borders of the grayscale image and closest to the t-th
sub-region, Ln' is the transitional mapping restriction parameter
of the n'-th transitional region, a is the distance between the
pixel to be calculated and the median of the n'-th transitional
region, b is the distance between the pixel to be calculated and
the median of the transitional region to which it belongs, and
.lamda..sub.tr is the mapping restriction parameter of the pixel to
be calculated.
17. The image processing device according to claim 15, wherein the
mapping restriction parameter determiner is further configured to
calculate a mapping restriction parameter for each pixel in the
sub-regions located in other space, except on the borders, of the
grayscale image by the following formula: T pz = c .times. L x + d
.times. L x ' c + d ##EQU00023## T qz ' = c ' .times. L m + d '
.times. L m ' c ' + d ' ##EQU00023.2## W pz = g .times. T pz + h
.times. T qz ' g + h ##EQU00023.3## wherein, x is the serial number
of the transitional region to which the pixel to be calculated
belongs, p is the serial number of the sub-region to which the
pixel to be calculated belongs, z is the serial number of the pixel
to be calculated in the p-th sub-region, m is the serial number of
the transitional region longitudinally adjacent to the x-th
transitional region and closest to the p-th sub-region, q is the
serial number of the sub-region adjacent to the p-th sub-region
longitudinally and located in the m-th transitional region, z' is
the serial number of a pixel located in the same column as the
pixel to be calculated in the q-th sub-region, Lx is the
transitional mapping restriction parameter of the x-th transitional
region, x' is the serial number of the transitional region
horizontally adjacent to the x-th transitional region and closest
to the p-th sub-region, L.sub.x' is the transitional mapping
restriction parameter of the x'-th transitional region, L.sub.m is
the transitional mapping restriction parameter of the m-th
transitional region, m' is the serial number of the transitional
region horizontally adjacent to the m-th transitional region and
closest to the q-th sub-region, L.sub.m' is the transitional
mapping restriction parameter of the m'-th transitional region, c
is the distance between the pixel to be calculated and the
longitudinal median of the x'-th transitional region, d is the
distance between the pixel to be calculated and the longitudinal
median of the transitional region to which it belongs, c' is the
distance between the z'-th pixel in the q-th sub-region and the
longitudinal median of the m '-th transitional region, d' is the
distance between the z'-th pixel in the q-th sub-region and the
longitudinal median of the transitional region to which it belongs,
g is the distance between the pixel to be calculated and the
horizontal median of the m-th transitional region, h is the
distance between the pixel to be calculated and the horizontal
median of the transitional region to which it belongs, T.sub.pz is
a middle mapping restriction parameter of the pixel to be
calculated, T.sub.qz' is a middle mapping restriction parameter of
the z'-th pixel in the q-th sub-region, and W.sub.pz is a mapping
restriction parameter of the pixel to be calculated.
18. The image processing device according to claim 15, wherein the
grayscale adjustor is further configured to adjust a grayscale
value of each pixel in the grayscale image by the following
formula: i y ' = .lamda. y .times. S y + i y .lamda. y + 1
##EQU00024## Wherein, y is the serial number of a pixel, i.sub.y is
the grayscale value of the y-th pixel in the grayscale image,
i.sub.y' is the adjusted grayscale value of the y-th pixel in the
grayscale image, .lamda..sub.y is a mapping restriction parameter
of the y-th pixel, and S.sub.y is a mapping value of the y-th
pixel.
19. A computer readable storage medium, which stores computer
readable instructions that cause a computer to perform a method
according to claim 1 when executed by the computer.
20. A computing device, comprising: a memory configured to store
computer executable instructions; and a processor configured to
execute the computer executable instructions so as to perform a
method according to claim 1.
Description
RELATED APPLICATIONS
[0001] The present application claims the benefit of Chinese Patent
Application No. 201710085931.X, filed on Feb. 17, 2017, the entire
disclosure of which is incorporated herein by reference.
TECHNICAL FIELD
[0002] The present invention relates to the field of video image
processing, and more particular to an image processing method and
device.
BACKGROUND ART
[0003] In order to enhance image contrast and dynamic range, the
histogram equalization algorithm is usually used for image
processing, wherein the histogram equalization algorithm mainly has
two implementations: one is the global histogram equalization
algorithm, i.e., an image to be processed is holistically adjusted
by an equilibrium mapping curve and a mapping restriction parameter
that relates to information abundance of the image, in such a way
to not only avoid image deterioration while enhancing contrast, but
also reduce calculation amount as much as possible; however, in
order to prevent such an issue as the short board effect, the
details of the processed image usually cannot be enhanced most
properly; and the other is the local histogram equalization
algorithm, i.e., an image is divided into several areas, the image
to be processed in each area is adjusted by an equilibrium mapping
curve and a mapping restriction parameter that relates to
information abundance of the area, and the equilibrium mapping
curve in each area is decided by its surrounding areas. The
greatest advantage of this method is that the details of an image
can be enhanced most properly; however, it tends to result in a
huge amount of calculation for perfectly highlighting the
details.
SUMMARY
[0004] In view of the problems in the prior art, how to perfectly
highlight image details while achieving high-speed and effective
calculation is a technical problem that needs to be solved urgently
by those skilled in the art.
[0005] To solve or alleviate at least one defect in the prior art,
the present disclosure provides an image processing method, an
image processing device, a computer readable storage medium and a
calculation apparatus, so as to solve the problem in the prior art
of how to perfectly highlight image details while achieving
high-speed and effective calculation by means of the global
histogram equalization algorithm and the local histogram
equalization algorithm.
[0006] According to one aspect, there is provided an image
processing method, comprising the steps of: determining an
equilibrium mapping curve of a whole grayscale image according to
the grayscale image in a YUV mode image; dividing the whole
grayscale image into a plurality of sub-regions, and determining a
mapping restriction parameter for each pixel in each of the
sub-regions; and adjusting a grayscale value of each pixel in the
grayscale image according to the determined equilibrium mapping
curve of the whole grayscale image and the mapping restriction
parameter of each pixel in each of the sub-regions.
[0007] In an embodiment, the image processing method further
comprises the steps of: converting an image to be processed into a
grayscale chrominance YUV mode image; and converting the adjusted
grayscale image into an image of original mode.
[0008] In an embodiment, the step of determining an equilibrium
mapping curve of a whole grayscale image according to a grayscale
image in a YUV mode image further comprises the steps of:
[0009] determining a pixel depth and a grayscale histogram of the
grayscale image in the YUV mode image, and a grayscale value of
each pixel in the grayscale image; and
[0010] calculating the equilibrium mapping curve of the whole
grayscale image by the following formula:
S k = D .times. i = 0 k H ( i ) SUM , 0 .ltoreq. k .ltoreq. D
##EQU00001##
[0011] Wherein, k is the grayscale value of a pixel in the
grayscale image, S.sub.k is the mapping value of a pixel with a
grayscale value of k in the grayscale image, SUM is the total
number of the pixels in the grayscale image, H(i) is the number of
the pixels with a grayscale value of i in the grayscale image, and
D is the pixel depth of the grayscale image.
[0012] In an embodiment, the step of dividing the whole grayscale
image into a plurality of sub-regions, and determining a mapping
restriction parameter for each pixel in each of the sub-regions
further comprises the steps of:
[0013] dividing the whole grayscale image into a plurality of
transitional regions, and determining a transitional mapping
restriction parameter of each of the transitional regions; and
[0014] dividing each of the transitional regions into a plurality
of sub-regions, and determining a mapping restriction parameter for
each pixel in each of the sub-regions according to the determined
transitional mapping restriction parameter of each of the
transitional regions and a set linear interpolation calculation
rule.
[0015] In an embodiment, the step of determining a transitional
mapping restriction parameter of each of the transitional regions
specifically comprises the steps of:
[0016] determining a grayscale mean value and a grayscale standard
deviation of each of the transitional regions; and
[0017] calculating the transitional mapping restriction parameter
of each of the transitional regions by the following formula:
L.sub.1x=[M.sub.x.times.N.sub.min1+(T.sub.1-M.sub.x).times.N.sub.max1]/D
L.sub.2x=[S.sub.x.times.N.sub.min2+(T.sub.2-S.sub.x).times.N.sub.max2]/D
L.sub.x= {square root over (L.sub.1x.times.L.sub.2x)}
[0018] Wherein, x is the serial number of a transitional region,
M.sub.x is the grayscale mean value of the x-th transitional
region, S.sub.x is the grayscale standard deviation of the x-th
transitional region, N.sub.min1 and N.sub.max1 are respectively the
preset minimum limit value and maximum limit value corresponding to
the grayscale mean value of each of the transitional regions,
N.sub.min2 and N.sub.max2 are respectively the preset minimum limit
value and maximum limit value corresponding to the grayscale
standard deviation of each of the transitional regions, T.sub.1 is
a preset limit threshold corresponding to the grayscale mean value
of each of the transitional regions, T.sub.2 is a preset limit
threshold corresponding to the grayscale standard deviation of each
of the transitional regions, D is the pixel depth of the grayscale
image, L.sub.1x is a transitional mapping restriction parameter
corresponding to the grayscale mean value M.sub.x of the x-th
transitional region, L.sub.2x is a transitional mapping restriction
parameter corresponding to the grayscale standard deviation S.sub.x
of the x-th transitional region, and L.sub.x is the transitional
mapping restriction parameter of the x-th transitional region.
[0019] In an embodiment, the step of determining a mapping
restriction parameter for each pixel in each of the sub-regions
according to the determined transitional mapping restriction
parameter of each of the transitional regions and a set linear
interpolation calculation rule further comprises the steps of:
[0020] determining a category of each of the sub-regions according
to the position of each of the sub-regions in the grayscale image,
the category comprising: sub-regions located in four corners of the
grayscale image, sub-regions located on the borders, except the
four corners, of the grayscale image, and sub-regions located in
other space, except on the borders, of the grayscale image;
[0021] determining a mapping restriction parameter for each pixel
in the sub-regions located in the four corners of the grayscale
image as the transitional mapping restriction parameter of the
transitional region it belongs to according to the determined
transitional mapping restriction parameter of each of the
transitional regions;
[0022] determining a mapping restriction parameter for each pixel
in the sub-regions located on the borders, except the four corners,
of the grayscale image according to the determined transitional
mapping restriction parameter of each of the transitional regions
and according to a preset uni-linear interpolation calculation
rule; and
[0023] determining a mapping restriction parameter for each pixel
in the sub-regions located in other space, except on the borders,
of the grayscale image according to the determined transitional
mapping restriction parameter of each of the transitional regions
and according to a preset bi-linear interpolation calculation
rule.
[0024] In an embodiment, the step of determining a mapping
restriction parameter for each pixel in the sub-regions located on
the borders, except the four corners, of the grayscale image
according to the determined transitional mapping restriction
parameter of each of the transitional regions and according to a
preset uni-linear interpolation calculation rule further comprises
the step of:
[0025] calculating a mapping restriction parameter for each pixel
in the sub-regions located on the borders, except the four corners,
of the grayscale image by the following formula:
.lamda. tr = a .times. L n + b .times. L n ' a + b ##EQU00002##
[0026] Wherein, n is the serial number of the transitional region
to which the pixel to be calculated belongs, t is the serial number
of the sub-region to which the pixel to be calculated belongs, r is
the serial number of the pixel to be calculated in the t-th
sub-region, L.sub.n is the transitional mapping restriction
parameter of the n-th transitional region, n' is the serial number
of the transitional region located on the borders of the grayscale
image and closest to the t-th sub-region, Ln' is the transitional
mapping restriction parameter of the n'-th transitional region, a
is the distance between the pixel to be calculated and the median
of the n'-th transitional region, b is the distance between the
pixel to be calculated and the median of the transitional region to
which it belongs, and .lamda..sub.tr is the mapping restriction
parameter of the pixel to be calculated.
[0027] In an embodiment, the step of determining a mapping
restriction parameter for each pixel in the sub-regions located in
other space, except on the borders, of the grayscale image
according to the determined transitional mapping restriction
parameter of each of the transitional regions and according to a
preset bi-linear interpolation calculation rule further comprises
the step of:
[0028] calculating a mapping restriction parameter for each pixel
in the sub-regions located in other space, except on the borders,
of the grayscale image by the following formula:
T pz = c .times. L x + d .times. L x ' c + d ##EQU00003## T qz ' =
c ' .times. L m + d ' .times. L m ' c ' + d ' ##EQU00003.2## W pz =
g .times. T pz + h .times. T qz ' g + h ##EQU00003.3##
[0029] Wherein, x is the serial number of the transitional region
to which the pixel to be calculated belongs, p is the serial number
of the sub-region to which the pixel to be calculated belongs, z is
the serial number of the pixel to be calculated in the p-th
sub-region, m is the serial number of the transitional region
longitudinally adjacent to the x-th transitional region and closest
to the p-th sub-region, q is the serial number of the sub-region
adjacent to the p-th sub-region longitudinally and located in the
m-th transitional region, z' is the serial number of a pixel
located in the same column as the pixel to be calculated in the
q-th sub-region, L.sub.x is the transitional mapping restriction
parameter of the x-th transitional region, x' is the serial number
of the transitional region horizontally adjacent to the x-th
transitional region and closest to the p-th sub-region, L.sub.x' is
the transitional mapping restriction parameter of the x'-th
transitional region, L.sub.m is the transitional mapping
restriction parameter of the m-th transitional region, m' is the
serial number of the transitional region horizontally adjacent to
the m-th transitional region and closest to the q-th sub-region,
L.sub.m' is the transitional mapping restriction parameter of the
m'-th transitional region, c is the distance between the pixel to
be calculated and the longitudinal median of the x'-th transitional
region, d is the distance between the pixel to be calculated and
the longitudinal median of the transitional region to which it
belongs, c' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the m'-th transitional
region, d' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the transitional region
to which it belongs, g is the distance between the pixel to be
calculated and the horizontal median of the m-th transitional
region, h is the distance between the pixel to be calculated and
the horizontal median of the transitional region to which it
belongs, T.sub.pz is a middle mapping restriction parameter of the
pixel to be calculated, T.sub.qz' is a middle mapping restriction
parameter of the z'-th pixel in the q-th sub-region, and W.sub.pz
is a mapping restriction parameter of the pixel to be
calculated.
[0030] In an embodiment, the step of adjusting a grayscale value of
each pixel in the grayscale image according to the determined
equilibrium mapping curve of the whole grayscale image and the
mapping restriction parameter for each pixel in each of the
sub-regions further comprises the step of:
[0031] adjusting a grayscale value of each pixel in the grayscale
image by the following formula:
i y ' = .lamda. y .times. S y + i y .lamda. y + 1 ##EQU00004##
[0032] Wherein, y is the serial number of a pixel, i.sub.y is the
original grayscale value of the y-th pixel in the grayscale image,
i.sub.y' is the adjusted grayscale value of the y-th pixel in the
grayscale image, .lamda..sub.y is a mapping restriction parameter
of the y-th pixel, and S.sub.y is a mapping value of the y-th
pixel.
[0033] According to another aspect, there is provided an image
processing device, comprising an equilibrium mapping curve
determiner configured to determine an equilibrium mapping curve of
a whole grayscale image according to the grayscale image in a YUV
mode image; a mapping restriction parameter determiner configured
to divide the whole grayscale image into a plurality of
sub-regions, and determine a mapping restriction parameter for each
pixel in each of the sub-regions; and a grayscale adjustor
configured to adjust a grayscale value of each pixel in the
grayscale image according to the determined equilibrium mapping
curve of the whole grayscale image and the mapping restriction
parameter for each pixel in each of the sub-regions.
[0034] In an embodiment, the image processing device further
comprises a first image converter configured to convert an obtained
image to be processed into a grayscale chrominance YUV mode image;
and a second image converter configured to convert the adjusted
grayscale image into an image of original mode.
[0035] In an embodiment, the equilibrium mapping curve determiner
is further configured to determine a pixel depth and a grayscale
histogram of the grayscale image in the YUV mode image, and the
grayscale value of each pixel in the grayscale image; and calculate
the equilibrium mapping curve of the whole grayscale image by the
following formula:
S k = D .times. i = 0 k H ( i ) SUM , 0 .ltoreq. k .ltoreq. D
##EQU00005##
[0036] Wherein, k is the grayscale value of a pixel in the
grayscale image, S.sub.k is the mapping value of a pixel with a
grayscale value of k in the grayscale image, SUM is the total
number of the pixels in the grayscale image, H(i) is the number of
the pixels with a grayscale value of i in the grayscale image, and
D is the pixel depth of the grayscale image.
[0037] In an embodiment, the mapping restriction parameter
determiner is further configured to divide the whole grayscale
image into a plurality of transitional regions, and determine a
transitional mapping restriction parameter of each of the
transitional regions; and divide each of the transitional regions
into a plurality of sub-regions, and determine a mapping
restriction parameter for each pixel in each of the sub-regions
according to the determined transitional mapping restriction
parameter of each of the transitional regions and a set linear
interpolation calculation rule.
[0038] In an embodiment, the mapping restriction parameter
determiner is further configured to determine a grayscale mean
value and a grayscale standard deviation of each of the
transitional regions; and calculate the transitional mapping
restriction parameter of each of the transitional regions by the
following formula:
L.sub.1x=[M.sub.x.times.N.sub.min1+(T.sub.1-M.sub.x).times.N.sub.max1]/D
L.sub.2x=[S.sub.x.times.N.sub.min2+(T.sub.2-S.sub.x).times.N.sub.max2]/D
L.sub.x= {square root over (L.sub.1x.times.L.sub.2x)}
[0039] Wherein, x is the serial number of a transitional region,
M.sub.x is the grayscale mean value of the x-th transitional
region, S.sub.x is the grayscale standard deviation of the x-th
transitional region, N.sub.min1 and N.sub.max1 are respectively the
preset minimum limit value and maximum limit value corresponding to
the grayscale mean value of each of the transitional regions,
N.sub.min2 and N.sub.max2 are respectively the preset minimum limit
value and maximum limit value corresponding to the grayscale
standard deviation of each of the transitional regions, T.sub.1 is
a preset limit threshold corresponding to the grayscale mean value
of each of the transitional regions, T.sub.2 is a preset limit
threshold corresponding to the grayscale standard deviation of each
of the transitional regions, D is the pixel depth of the grayscale
image, L.sub.1x is a transitional mapping restriction parameter
corresponding to the grayscale mean value M.sub.x of the x-th
transitional region, L.sub.2x is a transitional mapping restriction
parameter corresponding to the grayscale standard deviation S.sub.x
of the x-th transitional region, and L.sub.x is the transitional
mapping restriction parameter of the x-th transitional region.
[0040] In an embodiment, the mapping restriction parameter
determiner is further configured to determine a category of each of
the sub-regions according to the position of each of the
sub-regions in the grayscale image, the category comprising:
sub-regions located in four corners of the grayscale image,
sub-regions located on the borders, except the four corners, of the
grayscale image, and sub-regions located in other space, except on
the borders, of the grayscale image; determine a mapping
restriction parameter of each pixel in the sub-regions located in
the four corners of the grayscale image as the transitional mapping
restriction parameter of the transitional region it belongs to
according to the determined transitional mapping restriction
parameter of each of the transitional regions; determine a mapping
restriction parameter of each pixel in the sub-regions located on
the borders, except the four corners, of the grayscale image
according to the determined transitional mapping restriction
parameter of each of the transitional regions and according to a
preset uni-linear interpolation calculation rule; and determine a
mapping restriction parameter of each pixel in the sub-regions
located in other space, except on the borders, of the grayscale
image according to the determined transitional mapping restriction
parameter of each of the transitional regions and according to a
preset bi-linear interpolation calculation rule.
[0041] In an embodiment, the mapping restriction parameter
determiner is further configured to calculate a mapping restriction
parameter of each pixel in the sub-regions located on the borders,
except the four corners, of the grayscale image by the following
formula:
.lamda. tr = a .times. L n + b .times. L n ' a + b ##EQU00006##
[0042] Wherein, n is the serial number of the transitional region
to which the pixel to be calculated belongs, t is the serial number
of the sub-region to which the pixel to be calculated belongs, r is
the serial number of the pixel to be calculated in the t-th
sub-region, L.sub.n is the transitional mapping restriction
parameter of the n-th transitional region, n' is the serial number
of the transitional region located on the borders of the grayscale
image and closest to the t-th sub-region, Ln' is the transitional
mapping restriction parameter of the n'-th transitional region, a
is the distance between the pixel to be calculated and the median
of the n'-th transitional region, b is the distance between the
pixel to be calculated and the median of the transitional region to
which it belongs, and .lamda..sub.tr is the mapping restriction
parameter of the pixel to be calculated.
[0043] In an embodiment, the mapping restriction parameter
determiner is further configured to calculate a mapping restriction
parameter of each pixel in the sub-regions located in other space,
except on the borders, of the grayscale image by the following
formula:
T pz = c .times. L x + d .times. L x ' c + d ##EQU00007## T qz ' =
c ' .times. L m + d ' .times. L m ' c ' + d ' ##EQU00007.2## W pz =
g .times. T pz + h .times. T qz ' g + h ##EQU00007.3##
[0044] Wherein, x is the serial number of the transitional region
to which the pixel to be calculated belongs, p is the serial number
of the sub-region to which the pixel to be calculated belongs, z is
the serial number of the pixel to be calculated in the p-th
sub-region, m is the serial number of the transitional region
longitudinally adjacent to the x-th transitional region and closest
to the p-th sub-region, q is the serial number of the sub-region
adjacent to the p-th sub-region longitudinally and located in the
m-th transitional region, z' is the serial number of a pixel
located in the same column as the pixel to be calculated in the
q-th sub-region, L.sub.x is the transitional mapping restriction
parameter of the x-th transitional region, x' is the serial number
of the transitional region horizontally adjacent to the x-th
transitional region and closest to the p-th sub-region, L.sub.x' is
the transitional mapping restriction parameter of the x'-th
transitional region, L.sub.m is the transitional mapping
restriction parameter of the m-th transitional region, m' is the
serial number of the transitional region horizontally adjacent to
the m-th transitional region and closest to the q-th sub-region,
L.sub.m' is the transitional mapping restriction parameter of the
m'-th transitional region, c is the distance between the pixel to
be calculated and the longitudinal median of the x'-th transitional
region, d is the distance between the pixel to be calculated and
the longitudinal median of the transitional region to which it
belongs, c' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the m'-th transitional
region, d' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the transitional region
to which it belongs, g is the distance between the pixel to be
calculated and the horizontal median of the m-th transitional
region, h is the distance between the pixel to be calculated and
the horizontal median of the transitional region to which it
belongs, T.sub.pz is a middle mapping restriction parameter of the
pixel to be calculated, T.sub.qz' is a middle mapping restriction
parameter of the z'-th pixel in the q-th sub-region, and W.sub.pz
is a mapping restriction parameter of the pixel to be
calculated.
[0045] In an embodiment, the grayscale adjustor is further
configured to adjust a grayscale value of each pixel in the
grayscale image by the following formula:
i y ' = .lamda. y .times. S y + i y .lamda. y + 1 ##EQU00008##
[0046] Wherein, y is the serial number of a pixel, i.sub.y is the
grayscale value of the y-th pixel in the grayscale image, i.sub.y'
is the adjusted grayscale value of the y-th pixel in the grayscale
image, .lamda..sub.y is a mapping restriction parameter of the y-th
pixel, and S.sub.y is a mapping value of the y-th pixel.
[0047] According to another aspect, there is provided a computer
readable storage medium, which stores computer readable
instructions that cause a computer to perform any method as stated
above when executed by a computer.
[0048] According to another aspect, there is provided a computing
device comprising a memory configured to store computer executable
instructions; and a processor configured to execute the computer
executable instructions so as to perform any method as stated
above.
[0049] Some embodiments of the present disclosure can realize at
least one of the following advantageous effects and/or other
advantageous effects:
[0050] some embodiments provided by the present disclosure can
first convert an obtained image to be processed into a grayscale
chrominance YUV mode image; determine an equilibrium mapping curve
of a whole grayscale image according to the grayscale image in a
YUV mode image; divide the whole grayscale image into a plurality
of sub-regions, and determine a mapping restriction parameter for
each pixel in each of the sub-regions; adjust a grayscale value of
each pixel in the grayscale image according to the determined
equilibrium mapping curve of the whole grayscale image and the
mapping restriction parameter for each pixel in each of the
sub-regions; and convert the adjusted grayscale image into an image
of original mode. When an image is processed in conjunction with a
global histogram equalization algorithm and a local histogram
equalization algorithm, the details of the image can be better
presented after the grayscale of the grayscale image is adjusted
using an equilibrium mapping curve and a plurality of mapping
restriction parameters. Meanwhile, since the method uses an
equilibrium mapping curve and a plurality of mapping restriction
parameters, it greatly reduces the calculation amount as compared
with the conventional local histogram equalization algorithm, and
the image of the display is effectively enhanced at a high speed
with less resource consumption and the image details remain.
BRIEF DESCRIPTION OF DRAWINGS
[0051] To explain some embodiments of the present disclosure more
clearly, the present disclosure provides the following drawings
used for describing the embodiments. It should be realized that the
following drawings are only related to some embodiments. Those
skilled in the art can obtain other drawings according to these
drawings without making inventive effort, and the other drawings
also fall within the scope of the present invention.
[0052] FIG. 1 is a flowchart of an image processing method
according to an embodiment of the present invention;
[0053] FIGS. 2a to 2c are schematic views showing the division of a
grayscale image according to some embodiments of the present
invention;
[0054] FIG. 3 is a flowchart of an image processing method
according to an embodiment of the present invention; and
[0055] FIG. 4 is a structural schematic view of an image processing
device according to an embodiment of the present invention.
DETAILED DESCRIPTION
[0056] To understand the objects, technical solutions and
advantages of some embodiments more clearly, the embodiments will
be described in detail with reference to the drawings and
implementations. It needs to be explained that the embodiments
described herein are merely a part, not the whole, of the
embodiments of the present invention. On the basis of the
embodiments in the present disclosure, other embodiments can be
obtained by those ordinarily skilled in the art without making
inventive labour, and all the obtained other embodiments fall
within the scope of the present invention.
[0057] There is provided an image processing method according to an
embodiment of the present invention. As shown in FIG. 1, the image
processing method can comprise the steps of:
[0058] S101: converting an obtained image to be processed into a
YUV mode image;
[0059] S102: determining an equilibrium mapping curve of a whole
grayscale image according to the grayscale image in the YUV mode
image;
[0060] S103: dividing the whole grayscale image into a plurality of
sub-regions, and determining a mapping restriction parameter for
each pixel in each of the sub-regions;
[0061] S104: adjusting a grayscale value of each pixel in the
grayscale image according to the determined equilibrium mapping
curve of the whole grayscale image and the mapping restriction
parameter of each pixel in each of the sub-regions; and
[0062] S105: converting the adjusted grayscale image into an image
of original mode.
[0063] It shall be pointed out that if the obtained image to be
processed itself is a YUV mode image, it is unnecessary to execute
the image converting step, and the steps S101 and S105 can be
omitted from the image processing method. Additionally, it shall be
pointed out that in the step S103, the whole grayscale image can be
divided according to a preset rule, which will be described
hereinafter.
[0064] In the image processing method according to an embodiment of
the present invention, when an image is processed in conjunction
with a global histogram equalization algorithm and a local
histogram equalization algorithm, the details of the image can be
better presented after the grayscale of the grayscale image is
adjusted using an equilibrium mapping curve and a plurality of
mapping restriction parameters. Meanwhile, since the method uses an
equilibrium mapping curve and a plurality of mapping restriction
parameters, it greatly reduces the calculation amount as compared
with the conventional local histogram equalization algorithm, and
the image of the display is effectively enhanced at a high speed
with less resource consumption and the image details remain.
[0065] In an implementation, the YUV mode image refers to a
grayscale chrominance image, wherein "Y" indicates the grayscale of
an image, and "U" and "V" both indicate the chrominance of an image
for describing colour and saturation of an image. In an embodiment,
when the obtained image to be processed is converted into a YUV
mode image, the image to be processed may be either an RGB mode
image or other mode image, which will not be limited. However,
despite of the mode of the image to be processed, the image when
being processed is first converted into the YUV mode image.
[0066] In order to obtain the equilibrium mapping curve of the
whole grayscale image, the step S102 of the image processing method
determines the equilibrium mapping curve of the whole grayscale
image according to the grayscale image in the YUV mode image. In an
embodiment, the step S102 can further specifically comprise the
steps of:
[0067] determining a pixel depth and a grayscale histogram of the
grayscale image in the YUV mode image, and the pixel value or
grayscale value of each pixel in the grayscale image; and
[0068] calculating the equilibrium mapping curve of the whole
grayscale image by the following formula:
S k = D .times. i = 0 k H ( i ) SUM , 0 .ltoreq. k .ltoreq. D
##EQU00009##
[0069] Wherein, k is the grayscale value of each pixel in the
grayscale image, S.sub.k is the mapping value of a pixel with a
grayscale value of k in the grayscale image, SUM is the total
number of the pixels in the grayscale image, H(i) is a grayscale
histogram of the grayscale image in the YUV mode image, to be
specific, H(i) is the number of the pixels with a grayscale value
of i in the grayscale image, and D is the pixel depth of the
grayscale image. i is an internal index in a summation formula for
indexing the grayscale value of the pixel in the grayscale
image.
[0070] To be specific, the image processing method mainly processes
the grayscale image, so it is first required to obtain the
grayscale image in the YUV image before processing the YUV image.
By scanning the obtained grayscale image it is possible to obtain a
series of parameters of the grayscale image, comprising a pixel
depth of the grayscale image and a grayscale histogram statistical
result, and the pixel value or grayscale value of each pixel in the
grayscale image, as well as the total number of the pixels in the
grayscale image, thereby determining the equilibrium mapping curve
of the whole grayscale image.
[0071] Furthermore, in the process of calculating the equilibrium
mapping curve of the whole grayscale image, it is required to
obtain the pixel depth of the grayscale image, and the pixel depth
is related to the number of gray levels. For instance, when the
grayscale image has 256 gray levels, the pixel depth of the
grayscale image is 255; and when the grayscale image has 1024 gray
levels, the pixel depth of the grayscale image is 1023. Hence, the
pixel depth shall be selected according to the number of gray
levels of the grayscale image, which is not limited herein.
[0072] In order to obtain the mapping restriction parameter of each
pixel in each of the sub-regions, the step S103 of the image
processing method divides the whole grayscale image into a
plurality of sub-regions, and determines a mapping restriction
parameter of each pixel in each of the sub-regions. In an
embodiment, the step S103 can further specifically comprise the
steps of:
[0073] dividing the whole grayscale image into a plurality of
transitional regions, and determining a transitional mapping
restriction parameter of each of the transitional regions; and
[0074] dividing each of the transitional regions into a plurality
of sub-regions, and determining a mapping restriction parameter of
each pixel in each of the sub-regions according to the determined
transitional mapping restriction parameter of each of the
transitional regions and a set linear interpolation calculation
rule.
[0075] In an implementation, the whole grayscale image can be
divided into a plurality of sub-regions according to the preset
rule. In an implementation, the whole grayscale image can be
divided into a plurality of transitional regions according to the
preset rule or each of the transitional regions can be divided into
a plurality of sub-regions according to the preset rule. The preset
rule to be followed can be dividing equally or unequally. For
instance, as shown in FIG. 2a, the whole grayscale image is equally
divided into 64 transitional regions. Taking the transitional
regions 210, 220, 230 and 240 for example, the four transitional
regions have equal size.
[0076] In an embodiment, the step of determining a transitional
mapping restriction parameter of each of the transitional regions
in the image processing method can further specifically comprise
the steps of:
[0077] determining a grayscale mean value and a grayscale standard
deviation of each of the transitional regions; and
[0078] calculating the transitional mapping restriction parameter
of each of the transitional regions by the following formula:
L.sub.1x=[M.sub.x.times.N.sub.min1+(T.sub.1-M.sub.x).times.N.sub.max1]/D
L.sub.2x=[S.sub.x.times.N.sub.min2+(T.sub.2-S.sub.x).times.N.sub.max2]/D
L.sub.x= {square root over (L.sub.1x.times.L.sub.2x)}
[0079] Wherein, x is the serial number of the transitional region
of which the transitional mapping restriction parameter needs to be
calculated, M.sub.x is the grayscale mean value of the x-th
transitional region, S.sub.x is the grayscale standard deviation of
the x-th transitional region, N.sub.min1 and N.sub.max1 are
respectively the preset minimum limit value and maximum limit value
corresponding to the grayscale mean value of each of the
transitional regions, N.sub.min2 and N.sub.max2 are respectively
the preset minimum limit value and maximum limit value
corresponding to the grayscale standard deviation of each of the
transitional regions, T.sub.1 is a preset limit threshold
corresponding to the grayscale mean value of each of the
transitional regions, T.sub.2 is a preset limit threshold
corresponding to the grayscale standard deviation of each of the
transitional regions, D is the pixel depth of the grayscale image,
L.sub.1x is the transitional mapping restriction parameter
corresponding to the grayscale mean value M.sub.x of the x-th
transitional region, L.sub.2x is the transitional mapping
restriction parameter corresponding to the grayscale standard
deviation S.sub.x of the x-th transitional region, and L.sub.x is
the transitional mapping restriction parameter of the x-th
transitional region.
[0080] Any method for obtaining a grayscale mean value and a
grayscale standard deviation in the prior art can be used to
determine the grayscale mean value and the grayscale standard
deviation of each of the transitional regions, as long as the
grayscale mean value and the grayscale standard deviation can be
obtained, which will not be limited herein. There are multiple
calculating and determining manners in the prior art, which will
not be reiterated herein.
[0081] In an embodiment, in the calculation of the transitional
mapping restriction parameter of each of the transitional regions,
the minimum limit value N.sub.min1 and the maximum limit value
N.sub.max1 corresponding to the grayscale mean value of each of the
transitional regions, and the minimum limit value N.sub.min2 and
the maximum limit value N.sub.max2 corresponding to the grayscale
standard deviation of each of the transitional regions may be
respectively empirical values preset according to the image
confusion. The values may be an integer or a non-integer. The
minimum limit value N.sub.min1 corresponding to the grayscale mean
value of each of the transitional regions can be equal or unequal
to the minimum limit value N.sub.min2 corresponding to the
grayscale standard deviation of each of the transitional regions.
The maximum limit value N.sub.max1 corresponding to the grayscale
mean value of each of the transitional regions can be equal or
unequal to the maximum limit value N.sub.max2 corresponding to the
grayscale standard deviation of each of the transitional regions.
Moreover, a limit threshold T.sub.1 corresponding to the grayscale
mean value of each of the transitional regions and a limit
threshold T.sub.2 corresponding to the grayscale standard deviation
of each of the transitional regions can also be preset empirical
values. For instance, when the grayscale mean value M.sub.x is
greater than its corresponding limit threshold T.sub.1 or the
grayscale deviation standard S.sub.x is greater than its
corresponding limit threshold T.sub.2, it is determined that the
grayscale mean value M.sub.x is the corresponding limit threshold
T.sub.1 or the grayscale deviation standard S.sub.x is the
corresponding limit threshold T.sub.2; and when the grayscale mean
value M.sub.x is less than or equal to its corresponding limit
threshold T.sub.1 or the grayscale deviation standard S.sub.x is
less than or equal to its corresponding limit threshold T.sub.2, it
is determined that the grayscale mean value M.sub.x or the
grayscale deviation standard S.sub.x is its own value. Furthermore,
the limit threshold T.sub.1 corresponding to the grayscale mean
value of each of the transitional regions can be equal or unequal
to the limit threshold T.sub.2 corresponding to the grayscale
standard deviation of each of the transitional regions. Therefore,
the values of the above six parameters can be determined according
to a specific grayscale image, which will not be limited
herein.
[0082] In order to determine a mapping restriction parameter for
each pixel in each of the sub-regions and eliminate the blocking
effect between transitional regions, in the image processing method
according to an embodiment of the present invention, a mapping
restriction parameter for each pixel in each of the sub-regions can
be determined according to the determined transitional mapping
restriction parameter of each of the transitional regions and a set
linear interpolation calculation rule, wherein the step of
determining a mapping restriction parameter for each pixel in each
of the sub-regions can further specifically comprise the steps
of:
[0083] determining a category of each of the sub-regions according
to the position of each of the sub-regions in the grayscale image,
the category comprising: sub-regions located in four corners of the
grayscale image, sub-regions located on the borders, except the
four corners, of the grayscale image, and sub-regions located in
other space, except on the borders, of the grayscale image;
[0084] determining a mapping restriction parameter for each pixel
in the sub-regions located in the four corners of the grayscale
image as the transitional mapping restriction parameter of the
transitional region it belongs to according to the determined
transitional mapping restriction parameter of each of the
transitional regions;
[0085] determining a mapping restriction parameter for each pixel
in the sub-regions located on the borders, except the four corners,
of the grayscale image according to the determined transitional
mapping restriction parameter of each of the transitional regions
and according to a preset uni-linear interpolation calculation
rule; and determining a mapping restriction parameter for each
pixel in the sub-regions located in other space, except on the
borders, of the grayscale image according to the determined
transitional mapping restriction parameter of each of the
transitional regions and according to a preset bi-linear
interpolation calculation rule.
[0086] FIG. 2b is a partial enlarged view of FIG. 2a. As shown in
FIG. 2b, sub-regions 211, 212, 213, 214 constitute a sub-region
210; sub-regions 221, 222, 223, 224 constitute a sub-region 220;
and sub-regions 231, 232, 233, 234 constitute a sub-region 230. The
sub-region 211 is located in the corner of the grayscale image, so
the mapping restriction parameter for each pixel in the sub-region
211 is the transitional mapping restriction parameter of the
transitional region 210 to which the sub-region 211 belongs. The
sub-regions 212 and 213 are located in the borders, except the four
corners, of the grayscale image, so the mapping restriction
parameter for each pixel in the sub-regions 212 and 213 can be
determined according to the preset uni-linear interpolation
calculation rule. The sub-region 214 is located in other space,
except on the borders, of the grayscale image, so the mapping
restriction parameter for each pixel in the sub-region 214 can be
determined according to the preset bi-linear interpolation
calculation rule.
[0087] In order to obtain a mapping restriction parameter for each
pixel in the sub-regions located on the borders, except the four
corners, of the grayscale image, in the image processing method
according to an embodiment of the present invention, a mapping
restriction parameter for each pixel in the sub-regions located on
the borders, except the four corners, of the grayscale image can be
determined according to the determined transitional mapping
restriction parameter of each of the transitional regions and
according to a preset uni-linear interpolation calculation rule. In
an embodiment, the step of determining a mapping restriction
parameter for each pixel in the sub-regions located on the borders,
except the four corners, of the grayscale image further comprises
the step of:
[0088] calculating a mapping restriction parameter for each pixel
in the sub-regions located on the borders, except the four corners,
of the grayscale image by the following formula:
.lamda. tr = a .times. L n + b .times. L n ' a + b ##EQU00010##
[0089] Wherein, n is the serial number of the transitional region
to which the pixel to be calculated belongs, and the transitional
region is located on the borders of the grayscale image, t is the
serial number of the sub-region to which the pixel to be calculated
belongs, and the sub-region is located in the n-th transitional
region and on the borders, except the four corners, of the
grayscale image, r is the serial number of the pixel to be
calculated in the t-th sub-region, so the pixel to be calculated is
the r-th pixel in the t-th sub-region, L.sub.n is the transitional
mapping restriction parameter of the n-th transitional region, n'
is the serial number of the transitional region adjacent to the
n-th transitional-region and located on the borders of the
grayscale region, and the transitional region is the one located on
the border sof the grayscale region and closest to the t-th
sub-region, Ln' is the transitional mapping restriction parameter
of the n'-th transitional region, a is the distance between the
pixel to be calculated and the median of the n'-th transitional
region, b is the distance between the pixel to be calculated and
the median of the transitional region to which it belongs, and
.lamda..sub.tr is the mapping restriction parameter of the pixel to
be calculated.
[0090] The linear interpolation calculation comprises horizontal
interpolation calculation and longitudinal interpolation
calculation. In the horizontal interpolation calculation, a is the
distance between the r-th pixel in the t-th sub-region and the
longitudinal median of the transitional region horizontally
adjacent to the t-th sub-region, and b is the distance between the
r-th pixel in the t-th sub-region and the longitudinal median of
the transitional region to which it belongs; and in the
longitudinal interpolation calculation, a is the distance between
the r-th pixel in the t-th sub-region and the horizontal median of
the transitional region longitudinally adjacent to the t-th
sub-region, and b is the distance between the r-th pixel in the
t-th sub-region and the horizontal median of the transitional
region to which it belongs
[0091] For instance, in FIG. 2b, take for example the determination
of a mapping restriction parameter .lamda..sub.212r of the r-th
pixel in the sub-region 212 located on the borders, except the four
corners, of the grayscale image, the horizontal interpolation
calculation is required. According to the interpolation calculation
formula:
.lamda..sub.212r=(a.times.L.sub.210+b.times.L.sub.220)/(a+b),
L.sub.210 is the transitional mapping restriction parameter of the
transitional region 210, L.sub.220 is the transitional mapping
restriction parameter of the transitional region 220, a is the
distance between the r-th pixel in the sub-region 212 and the
longitudinal median of the transitional region 220, b is the
distance between the r-th pixel in the sub-region 212 and the
longitudinal median of the transitional region 210, and
.lamda..sub.212r is the mapping restriction parameter of the r-th
pixel in the sub-region 212.
[0092] Longitudinal interpolation calculation is required for
determining a mapping restriction parameter of the r'-th pixel in
the sub-region 213. According to the interpolation calculation
formula:
.lamda..sub.213r'=(a'.times.L.sub.210+b'.times.L.sub.230)/(a'+b'),
L.sub.210 is a transitional mapping restriction parameter of the
transitional region 210, L.sub.230 is a transitional mapping
restriction parameter of the transitional region 230, a is the
distance between the r'-th pixel in the sub-region 213 and the
horizontal median of the transitional region 230, b is the distance
between the r'-th pixel in the sub-region 213 and the horizontal
median of the transitional region 210, and .lamda..sub.213r' is a
mapping restriction parameter of the r'-th pixel in the sub-region
213.
[0093] In order to obtain a mapping restriction parameter for each
pixel in the sub-regions located in other space, except on the
borders, of the grayscale image, in the image processing method
according to an embodiment of the present invention, a mapping
restriction parameter for each pixel in the sub-regions located in
other space, except on the borders, of the grayscale image can be
determined according to the determined transitional mapping
restriction parameter of each of the transitional regions and
according to a preset bi-linear interpolation calculation rule. In
an embodiment, the step of determining a mapping restriction
parameter for each pixel in the sub-regions located in other space,
except on the borders, of the grayscale image can further
specifically comprise the step of:
[0094] calculating a mapping restriction parameter for each pixel
in the sub-regions located in other space, except on the borders,
of the grayscale image by the following formula:
T pz = c .times. L x + d .times. L x ' c + d ##EQU00011## T qz ' =
c ' .times. L m + d ' .times. L m ' c ' + d ' ##EQU00011.2## W pz =
g .times. T pz + h .times. T qz ' g + h ##EQU00011.3##
[0095] Wherein, x is the serial number of the transitional region
to which the pixel to be calculated belongs, p is the serial number
of the sub-region to which the pixel to be calculated belongs, and
the sub-region is located in the x-th transitional region and in a
non-border position in the grayscale image, z is the serial number
of the pixel to be calculated in the p-th sub-region, that is to
say, the pixel to be calculated is the z-th pixel in the p-th
sub-region, m is the serial number of the transitional region
longitudinally adjacent to the x-th transitional region and closest
to the p-th sub-region, q is the serial number of the sub-region
adjacent to the p-th sub-region longitudinally and located in the
m-th transitional region, z' is the serial number of a pixel
located in the same column as the pixel to be calculated in the
q-th sub-region, L.sub.x is the transitional mapping restriction
parameter of the x-th transitional region, x' is the serial number
of the transitional region horizontally adjacent to the x-th
transitional region and closest to the p-th sub-region, L.sub.x' is
the transitional mapping restriction parameter of the x'-th
transitional region, L.sub.m is the transitional mapping
restriction parameter of the m-th transitional region, m' is the
serial number of the transitional region horizontally adjacent to
the m-th transitional region and closest to the q-th sub-region,
L.sub.m' is the transitional mapping restriction parameter of the
m'-th transitional region, c is the distance between the pixel to
be calculated and the longitudinal median of the x'-th transitional
region, d is the distance between the pixel to be calculated and
the longitudinal median of the transitional region to which it
belongs, c' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the m'-th transitional
region, d' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the transitional region
to which it belongs, g is the distance between the pixel to be
calculated and the horizontal median of the m-th transitional
region, h is the distance between the pixel to be calculated and
the horizontal median of the transitional region to which it
belongs, T.sub.pz is a middle mapping restriction parameter of the
pixel to be calculated, T.sub.qz' is a middle mapping restriction
parameter of the z'-th pixel in the q-th sub-region, and W.sub.pz
is a mapping restriction parameter of the pixel to be calculated.
It shall be pointed out that z', in a strict sense, only represents
a projection of the z pixel in an adjacent sub-region, but not a
real pixel, and is only characterized by being in the same column
as z, so c and c' are actually equal, so do d and d'. Hence, the
middle mapping restriction parameter T.sub.qz' of the z'-th pixel
in the q-th sub-region is only a median value, and cannot be used
as an actual mapping restriction parameter of an actual
parameter.
[0096] In an embodiment, two interpolation calculations are
required for determining a mapping restriction parameter for each
pixel in the sub-regions located in other space, except on the
borders, of the grayscale image according to a preset bi-linear
interpolation calculation rule, wherein the first interpolation
calculation is horizontal interpolation calculation, and after two
middle mapping restriction parameters are obtained, the second
interpolation calculation is done using the two middle mapping
restriction parameters, and the second interpolation calculation is
longitudinal interpolation calculation.
[0097] FIG. 2c is a partial enlarged view of FIG. 2a. For instance,
as shown in FIG. 2c, the sub-region 214 belongs to the transitional
region 210, the sub-region 223 belongs to the transitional region
220, the sub-region 232 belongs to the transitional region 230, and
the sub-region 241 belongs to the transitional region 240. The
bi-linear interpolation calculation rule as stated above will be
explained by taking the calculation of the mapping restriction
parameter of the z-th pixel in the sub-region 214 for example.
First, do the horizontal interpolation calculation. According to
the interpolation formulae:
T.sub.214z=(c.times.L.sub.210+d.times.L.sub.220)/(c+d) and
T.sub.232z'=(c'.times.L.sub.230+d'.times.L.sub.240)/(c'+d'),
L.sub.210 is a transitional mapping restriction parameter of the
transitional region 210, L.sub.220 is a transitional mapping
restriction parameter of the transitional region 220, L.sub.230 is
a transitional mapping restriction parameter of the transitional
region 230, L.sub.240 is a transitional mapping restriction
parameter of the transitional region 240, c is the distance between
the z-th pixel in the sub-region 214 and the longitudinal median of
the transitional region 220, d is the distance between the z-th
pixel in the sub-region 214 and the longitudinal median of the
transitional region 210, c' is the distance between the z'-th pixel
located in the sub-region 232 and in the same column as the z-th
pixel and the longitudinal median of the transitional region 240,
d' is the distance between the z'-th pixel located in the
sub-region 232 and in the same column as the z-th pixel and the
longitudinal median of the transitional region 230. The middle
mapping restriction parameter T.sub.214z of the z-th pixel in the
sub-region 214 and the middle mapping restriction parameter
T.sub.232z' of the z'-th pixel in the sub-region 232 can be
obtained by the above formulae.
[0098] Then, according to the middle mapping restriction parameter
T.sub.214z of the z-th pixel in the sub-region 214 and the middle
mapping restriction parameter T.sub.232z' of the z'-th pixel in the
sub-region 232, do the longitudinal interpolation calculation.
According to the interpolation formula:
W.sub.214z=(g.times.T.sub.214z+h.times.T.sub.232z')/(g+h), g is the
distance between the z-th pixel in the sub-region 214 and the
horizontal median of the transitional region 230, h is the distance
between the z-th pixel in the sub-region 214 and the horizontal
median of the transitional region 210, and finally the mapping
restriction parameter W.sub.214z of the z-th pixel in the
sub-region 214 can be obtained. Of course, .lamda..sub.214z can
also be used to represent the mapping restriction parameter of the
z-th pixel in the sub-region 214, and W.sub.214z and
.lamda..sub.214z have the same meaning, indicative of the mapping
restriction parameter of the z-th pixel in the sub-region 214.
[0099] As stated above, in order to adjust a grayscale value of
each pixel in the grayscale image, the step S104 in the image
processing method according to an embodiment of the present
invention can adjust a grayscale value of each pixel in the
grayscale image according to the determined equilibrium mapping
curve of the whole grayscale image and the mapping restriction
parameter for each pixel in each of the sub-regions. In an
embodiment, the step S104 can further specifically comprise the
step of:
[0100] adjusting a grayscale value of each pixel in the grayscale
image by the following formula:
i y ' = .lamda. y .times. S y + i y .lamda. y + 1 ##EQU00012##
[0101] Wherein, y is the serial number of a pixel, i.sub.y is the
original grayscale value of the y-th pixel in the grayscale image,
i.sub.y' is the adjusted grayscale value of the y-th pixel in the
grayscale image, .lamda..sub.y is a mapping restriction parameter
of the y-th pixel, and S.sub.y is a mapping value of the y-th
pixel.
[0102] It can be known according to the above calculation that the
grayscale value i.sub.y' of the y-th pixel in the adjusted
grayscale image is between the original grayscale value i.sub.y of
the y-th pixel and the mapping value S.sub.y of the grayscale
image. When the mapping restriction parameter .lamda..sub.y of the
y-th pixel gets bigger, the adjusted grayscale value i.sub.y' of
the y-th pixel becomes closer to the mapping value S.sub.y of the
y-th pixel in the grayscale image.
[0103] The image processing method according to an embodiment of
the present invention will be explained in detail in conjunction
with an embodiment.
[0104] FIG. 3 is a flowchart of an image processing method
according to an embodiment of the present invention. As shown in
FIG. 3, the image processing method comprises the following method
steps S301 to S310:
[0105] S301: converting an obtained image to be processed into a
YUV mode image;
[0106] S302: obtaining a grayscale image in the YUV mode image;
[0107] S303: determining an equilibrium mapping curve of a whole
grayscale image according to the obtained grayscale image;
[0108] S304: dividing the whole grayscale image into a plurality of
transitional regions;
[0109] S305: determining a transitional mapping restriction
parameter of each of the transitional regions;
[0110] S306: dividing each of the transitional regions into a
plurality of sub-regions;
[0111] S307: determining the category to which each of the
sub-regions belongs according to the position of each of the
sub-regions in the grayscale image;
[0112] S308: determining a mapping restriction parameter for each
pixel in each of the sub-regions according to the determined
transitional mapping restriction parameter of each of the
transitional regions, the category to which each of the sub-regions
belongs, and a set linear interpolation calculation rule;
[0113] S309: adjusting a grayscale value of a pixel in the
grayscale image according to the determined equilibrium mapping
curve of the whole grayscale image and the mapping restriction
parameter of each pixel in each of the sub-regions; and
[0114] S310: converting the adjusted grayscale image into an image
of original mode.
[0115] As pointed out previously, if the obtained image to be
processed itself is a YUV mode image, it is unnecessary to execute
the image converting step, and the steps S301 and S310 can be
omitted from the image processing method. It shall also be pointed
out that the whole grayscale image can be divided into a plurality
of transitional regions according to a preset rule, or each of the
transitional regions can be divided into a plurality of sub-regions
according to a preset rule, which has been stated previously.
[0116] According to another aspect of the present invention, there
is also provided an image processing device. Since the
problem-solving principle of the device is similar to that of the
image processing method as stated above, reference can be made to
the implementation of the method for the implementation of the
device, which will not be reiterated herein.
[0117] FIG. 4 is a structural schematic view of an image processing
device according to an embodiment of the present invention. As
shown in FIG. 4, the image processing device can comprise:
[0118] a first image converter 401 configured to convert an
obtained image to be processed into a grayscale chrominance YUV
mode image;
[0119] an equilibrium mapping curve determiner 402 configured to
determine an equilibrium mapping curve of a whole grayscale image
according to the grayscale image in the YUV mode image;
[0120] a mapping restriction parameter determiner 403 configured to
divide the whole grayscale image into a plurality of sub-regions,
and determine a mapping restriction parameter for each pixel in
each of the sub-regions;
[0121] a grayscale adjustor 404 configured to adjust a grayscale
value of each pixel in the grayscale image according to the
determined equilibrium mapping curve of the whole grayscale image
and the mapping restriction parameter of each pixel in each of the
sub-regions; and
[0122] a second image converter 405 configured to convert the
adjusted grayscale image into an image of original mode.
[0123] As pointed out previously, if the obtained image to be
processed itself is a YUV mode image, it is unnecessary to execute
the image conversion, and the first image converter 401 and the
second image converter 405 can be omitted from the image processing
device. As stated above, the mapping restriction parameter
determiner 403 can also be configured to divide the whole grayscale
image into a plurality of sub-regions according to a preset
rule.
[0124] In an embodiment, the equilibrium mapping curve determiner
402 in the image processing device can be further configured to
determine a pixel depth and a grayscale histogram of the grayscale
image in the YUV mode image, and the pixel value or grayscale value
of each pixel in the grayscale image; and calculate the equilibrium
mapping curve of the whole grayscale image by the following
formula:
S k = D .times. i = 0 k H ( i ) SUM , 0 .ltoreq. k .ltoreq. D
##EQU00013##
[0125] Wherein, k is the grayscale value of each pixel in the
grayscale image, S.sub.k is the mapping value of a pixel with a
grayscale value of k in the grayscale image, SUM is the total
number of the pixels in the grayscale image, H(i) is the number of
the pixels with a grayscale value of i in the grayscale image, and
D is the pixel depth of the grayscale image.
[0126] In an embodiment, the mapping restriction parameter
determiner 403 in the image processing device can be further
configured to divide the whole grayscale image into a plurality of
transitional regions, and determine a transitional mapping
restriction parameter of each of the transitional regions; and
divide each of the transitional regions into a plurality of
sub-regions, and determine a mapping restriction parameter for each
pixel in each of the sub-regions according to the determined
transitional mapping restriction parameter of each of the
transitional regions and a set linear interpolation calculation
rule. As stated above, the mapping restriction parameter determiner
403 can also be configured to divide the whole grayscale image and
each of the transitional regions according to a preset rule.
[0127] In an embodiment, the mapping restriction parameter
determiner 403 in the image processing device can be further
configured to determine a grayscale mean value and a grayscale
standard deviation of each of the transitional regions; and
calculate the transitional mapping restriction parameter of each of
the transitional regions by the following formula:
L.sub.1x=[M.sub.x.times.N.sub.min1+(T.sub.1-M.sub.x).times.N.sub.max1]/D
L.sub.2x=[S.sub.x.times.N.sub.min2+(T.sub.2-S.sub.x).times.N.sub.max2]/D
L.sub.x= {square root over (L.sub.1x.times.L.sub.2x)}
[0128] Wherein, x is the serial number of a transitional region,
M.sub.x is the grayscale mean value of the x-th transitional
region, S.sub.x is the grayscale standard deviation of the x-th
transitional region, N.sub.min1 and N.sub.max1 are respectively the
preset minimum limit value and maximum limit value corresponding to
the grayscale mean value of each of the transitional regions,
N.sub.min2 and N.sub.max2 are respectively the preset minimum limit
value and maximum limit value corresponding to the grayscale
standard deviation of each of the transitional regions, T.sub.1 is
a preset limit threshold corresponding to the grayscale mean value
of each of the transitional regions, T.sub.2 is a preset limit
threshold corresponding to the grayscale standard deviation of each
of the transitional regions, D is the pixel depth of the grayscale
image, L.sub.1x is the transitional mapping restriction parameter
corresponding to the grayscale mean value M.sub.x of the x-th
transitional region, L.sub.2x is the transitional mapping
restriction parameter corresponding to the grayscale standard
deviation S.sub.x of the x-th transitional region, and L.sub.x is
the transitional mapping restriction parameter of the x-th
transitional region.
[0129] In an embodiment, the mapping restriction parameter
determiner 403 in the image processing device can be further
configured to determine a category of each of the sub-regions
according to the position of each of the sub-regions in the
grayscale image, the category comprising: sub-regions located in
four corners of the grayscale image, sub-regions located on the
borders, except the four corners, of the grayscale image, and
sub-regions located in other space, except on the borders, of the
grayscale image; determine a mapping restriction parameter for each
pixel in the sub-regions located in the four corners of the
grayscale image as the transitional mapping restriction parameter
of the transitional region it belongs to according to the
determined transitional mapping restriction parameter of each of
the transitional regions; determine a mapping restriction parameter
for each pixel in the sub-regions located on the borders, except
the four corners, of the grayscale image according to the
determined transitional mapping restriction parameter of each of
the transitional regions and according to a preset uni-linear
interpolation calculation rule; and determine a mapping restriction
parameter for each pixel in the sub-regions located in other space,
except on the borders, of the grayscale image according to the
determined transitional mapping restriction parameter of each of
the transitional regions and according to a preset bi-linear
interpolation calculation rule.
[0130] In an embodiment, the mapping restriction parameter
determiner 403 in the image processing device can be further
configured to calculate a mapping restriction parameter for each
pixel in the sub-regions located on the borders, except the four
corners, of the grayscale image by the following formula:
.lamda. tr = a .times. L n + b .times. L n ' a + b ##EQU00014##
[0131] Wherein, n is the serial number of the transitional region
to which the pixel to be calculated belongs, t is the serial number
of the sub-region to which the pixel to be calculated belongs, r is
the serial number of the pixel to be calculated in the t-th
sub-region, L.sub.n is the transitional mapping restriction
parameter of the n-th transitional region, n' is the serial number
of the transitional region located on the borders of the grayscale
region and closest to the t-th sub-region, Ln' is the transitional
mapping restriction parameter of the n'-th transitional region, a
is the distance between the pixel to be calculated and the median
of the n'-th transitional region, b is the distance between the
pixel to be calculated and the median of the transitional region to
which it belongs, and .lamda..sub.tr is the mapping restriction
parameter of the pixel to be calculated.
[0132] In an embodiment, the mapping restriction parameter
determiner 403 in the image processing device can be further
configured to calculate a mapping restriction parameter for each
pixel in the sub-regions located in other space, except on the
borders, of the grayscale image by the following formula:
T pz = c .times. L x + d .times. L x ' c + d ##EQU00015## T qz ' =
c ' .times. L m + d ' .times. L m ' c ' + d ' ##EQU00015.2## W pz =
g .times. T pz + h .times. T qz ' g + h ##EQU00015.3##
[0133] Wherein, x is the serial number of the transitional region
to which the pixel to be calculated belongs, p is the serial number
of the sub-region to which the pixel to be calculated belongs, z is
the serial number of the pixel to be calculated in the p-th
sub-region, m is the serial number of the transitional region
longitudinally adjacent to the x-th transitional region and closest
to the p-th sub-region, q is the serial number of the sub-region
adjacent to the p-th sub-region longitudinally and located in the
m-th transitional region, z' is the serial number of a pixel
located in the same column as the pixel to be calculated in the
q-th sub-region, L.sub.x is the transitional mapping restriction
parameter of the x-th transitional region, x' is the serial number
of the transitional region horizontally adjacent to the x-th
transitional region and closest to the p-th sub-region, L.sub.x' is
the transitional mapping restriction parameter of the x'-th
transitional region, L.sub.m is the transitional mapping
restriction parameter of the m-th transitional region, m' is the
serial number of the transitional region horizontally adjacent to
the m-th transitional region and closest to the q-th sub-region,
L.sub.m' is the transitional mapping restriction parameter of the
m'-th transitional region, c is the distance between the pixel to
be calculated and the longitudinal median of the x'-th transitional
region, d is the distance between the pixel to be calculated and
the longitudinal median of the transitional region to which it
belongs, c' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the m'-th transitional
region, d' is the distance between the z'-th pixel in the q-th
sub-region and the longitudinal median of the transitional region
to which it belongs, g is the distance between the pixel to be
calculated and the horizontal median of the m-th transitional
region, h is the distance between the pixel to be calculated and
the horizontal median of the transitional region to which it
belongs, T.sub.pz is a middle mapping restriction parameter of the
pixel to be calculated, T.sub.qz' is a middle mapping restriction
parameter of the z'-th pixel in the q-th sub-region, and W.sub.pz
is a mapping restriction parameter of the pixel to be
calculated.
[0134] In an embodiment, the grayscale adjustor 404 in the image
processing device can be further configured to adjust a grayscale
value of each pixel in the grayscale image by the following
formula:
i y ' = .lamda. y .times. S y + i y .lamda. y + 1 ##EQU00016##
[0135] Wherein, y is the serial number of a pixel, i.sub.y is the
grayscale value of the y-th pixel in the grayscale image, i.sub.y'
is the adjusted grayscale value of the y-th pixel in the grayscale
image, is a mapping restriction parameter of the y-th pixel, and
S.sub.y is a mapping value of the y-th pixel.
[0136] According to another aspect, there is provided a computer
readable storage medium, which stores computer readable
instructions that cause a computer to perform any method according
to the present disclosure when executed by a computer.
[0137] According to another aspect, there is provided a computing
device. The computing device comprises a memory configured to store
computer executable instructions; and a processor configured to
execute the computer executable instructions so as to perform any
method according to the present disclosure.
[0138] Some embodiments provided by the present disclosure can
first convert an obtained image to be processed into a grayscale
chrominance YUV mode image; determine an equilibrium mapping curve
of a whole grayscale image according to the grayscale image in a
YUV mode image; divide the whole grayscale image into a plurality
of sub-regions, and determine a mapping restriction parameter for
each pixel in each of the sub-regions; adjust a grayscale value of
each pixel in the grayscale image according to the determined
equilibrium mapping curve of the whole grayscale image and the
mapping restriction parameter of each pixel in each of the
sub-regions; and convert the adjusted grayscale image into an image
of original mode. When an image is processed in conjunction with a
global histogram equalization algorithm and a local histogram
equalization algorithm, the details of the image can be better
presented after the grayscale of the grayscale image is adjusted
using an equilibrium mapping curve and a plurality of mapping
restriction parameters. Meanwhile, since the method uses an
equilibrium mapping curve and a plurality of mapping restriction
parameters, it greatly reduces the calculation amount as compared
with the conventional local histogram equalization algorithm, and
the image of the display is effectively enhanced at a high speed
with less resource consumption and the image details remain.
[0139] It can be understood that the above depictions are merely
exemplary embodiments of the present invention, but the protection
scope of the present invention is not limited thereto. It shall be
noted that without departing from the spirit and principle of the
present invention, those ordinarily skilled in the art can conceive
of various modifications and variations, which shall fall within
the protection scope of the present invention. Thus, the protection
scope of the present invention shall be based on the protection
scope of the appended claims.
[0140] What needs to be explained is that the above embodiments are
only illustrated by way of the individual function modules
division. In actual application, the above functions can be
allocated to different functional modules as desired. The internal
structure of the device can be divided into different functional
modules so as to accomplish all or part of the functions as stated
above. In addition, function(s) of the above one module can be
achieved by a plurality of modules, and functions of the plurality
of modules can be integrated into one module.
[0141] In the claims, any reference sign in parentheses should not
be interpreted as a limitation to the claims. The terms
"comprise/include" do not exclude the presence of elements or steps
other than those listed in the claims. The word "a" or "an" in
front of elements does not exclude the presence of a plurality of
such elements. The present invention can be realized by hardware
comprising several separate elements, or suitably programmed
software or firmware, or by any combination thereof.
[0142] In an apparatus or system claim enumerating several devices,
one or more devices can be embodied in the same hardware project.
The fact that only some measures are recited in mutually different
dependent claims does not mean that the combination of those
measures cannot be utilized advantageously.
* * * * *