CN109996017B - Image adjusting method and terminal thereof - Google Patents

Image adjusting method and terminal thereof Download PDF

Info

Publication number
CN109996017B
CN109996017B CN201711488395.4A CN201711488395A CN109996017B CN 109996017 B CN109996017 B CN 109996017B CN 201711488395 A CN201711488395 A CN 201711488395A CN 109996017 B CN109996017 B CN 109996017B
Authority
CN
China
Prior art keywords
pixel point
image
pixel
value
equal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711488395.4A
Other languages
Chinese (zh)
Other versions
CN109996017A (en
Inventor
唐卫东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TCL Technology Group Co Ltd
Original Assignee
TCL Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TCL Technology Group Co Ltd filed Critical TCL Technology Group Co Ltd
Priority to CN201711488395.4A priority Critical patent/CN109996017B/en
Publication of CN109996017A publication Critical patent/CN109996017A/en
Application granted granted Critical
Publication of CN109996017B publication Critical patent/CN109996017B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/14Picture signal circuitry for video frequency region
    • H04N5/20Circuitry for controlling amplitude response
    • H04N5/205Circuitry for controlling amplitude response for correcting amplitude versus frequency characteristic
    • H04N5/208Circuitry for controlling amplitude response for correcting amplitude versus frequency characteristic for compensating for attenuation of high frequency components, e.g. crispening, aperture distortion correction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/44Receiver circuitry for the reception of television signals according to analogue transmission standards
    • H04N5/57Control of contrast or brightness

Abstract

The invention is suitable for the technical field of image processing, and provides an image adjusting method and a terminal thereof, wherein the image adjusting method comprises the following steps: acquiring the brightness value of each pixel point in the image to be adjusted; importing the brightness value into a preset bilateral filter function, and calculating the filter output value of each pixel point; determining a contrast adjustment coefficient of each pixel point based on the filtering output value; and adjusting the pixel value of each pixel point according to the contrast adjustment coefficient to generate an adjusted image. The method can determine the contrast adjustment coefficient corresponding to each pixel point, weight processing is not carried out on the pixel value of the whole image through a uniform gamma coefficient, the purpose of accurately adjusting the pixel points contained in the image can be realized even if a plurality of bright and dark regions exist, the contrast of the whole image is improved, the image is clear and visible, and the display effect of the image is improved.

Description

Image adjusting method and terminal thereof
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to an image adjusting method and a terminal thereof.
Background
Images are widely used in various fields as one of the most commonly used types of documents, and particularly in the field of presentation such as advertising, the level of image display quality is closely related to the contrast of the image. In the conventional image contrast adjustment technology, each pixel point in an image is generally linearly adjusted through a gamma curve. However, in the above adjustment method, all the pixel points in the image are adjusted by a uniform coefficient, and for the case that the image includes a plurality of regions with large brightness differences, although the contrast of a part of the region in the adjusted image meets the expected effect, the contrast of a part of the region is still low or high, which causes the overall contrast imbalance, reduces the image display quality, and affects the viewing experience of the user.
Disclosure of Invention
In view of this, embodiments of the present invention provide an image adjusting method and a terminal thereof, so as to solve the problem that, in the case that an image includes a plurality of regions with a large brightness difference, although the contrast of a part of the regions in the adjusted image meets an expected effect, the contrast of a part of the regions is still low or high, which causes an overall contrast imbalance, reduces image display quality, and affects viewing experience of a user in the conventional image contrast adjusting technology.
A first aspect of an embodiment of the present invention provides an image adjusting method, where the image adjusting method includes:
acquiring the brightness value of each pixel point in the image to be adjusted;
importing the brightness value into a preset bilateral filter function, and calculating the filter output value of each pixel point;
determining a contrast adjustment coefficient of each pixel point based on the filtering output value;
and adjusting the pixel value of each pixel point according to the contrast adjustment coefficient to generate an adjusted image.
A second aspect of an embodiment of the present invention provides an image adjusting terminal, where the image adjusting terminal includes:
the brightness value obtaining unit is used for obtaining the brightness value of each pixel point in the image to be adjusted;
the filtering output value calculating unit is used for leading the brightness value into a preset bilateral filtering function and calculating the filtering output value of each pixel point;
a contrast adjustment coefficient determining unit, configured to determine a contrast adjustment coefficient of each pixel point based on the filter output value;
and the image adjusting unit is used for adjusting the pixel value of each pixel point according to the contrast adjusting coefficient to generate an adjusted image.
A third aspect of the embodiments of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the following steps when executing the computer program:
acquiring the brightness value of each pixel point in the image to be adjusted;
importing the brightness value into a preset bilateral filter function, and calculating the filter output value of each pixel point;
determining a contrast adjustment coefficient of each pixel point based on the filtering output value;
and adjusting the pixel value of each pixel point according to the contrast adjustment coefficient to generate an adjusted image.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of:
acquiring the brightness value of each pixel point in the image to be adjusted;
importing the brightness value into a preset bilateral filter function, and calculating the filter output value of each pixel point;
determining a contrast adjustment coefficient of each pixel point based on the filtering output value;
and adjusting the pixel value of each pixel point according to the contrast adjustment coefficient to generate an adjusted image.
The image adjusting method and the terminal thereof provided by the embodiment of the invention have the following beneficial effects:
according to the embodiment of the invention, the brightness value of each pixel point in the image to be adjusted is led into the bilateral filter function, so that the filter output value corresponding to each pixel point is determined, as the bilateral filter function can still keep the boundary value in the image in the process of smoothing the image, the pixel points at the boundary have better display effect, the pixel points in other areas except the boundary can also determine a filter output value matched with the smooth processed image according to the smooth processed image, then the contrast adjustment coefficient of each pixel point is determined according to the filter output value, and the pixel value of each pixel point is adjusted, so that the adjusted image is obtained, the integral contrast of the image is improved, and the image is clear and visible. Compared with the prior art of image contrast adjustment, the embodiment of the invention determines the contrast adjustment coefficient corresponding to each pixel point, and does not perform weighting processing on the pixel value of the whole image through a uniform gamma coefficient, so that the aim of accurately adjusting the pixel points contained in the image can be fulfilled even if a plurality of bright and dark regions exist, the contrast of the whole image is improved, the image is clear and visible, and the display effect of the image is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an implementation of an image adjustment method according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating an implementation of the image adjustment method S102 according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating an implementation of an image adjustment method S101 according to a third embodiment of the present invention;
fig. 4 is a flowchart illustrating an implementation of the image adjustment method S103 according to a fourth embodiment of the present invention;
fig. 5 is a block diagram of an image adjusting terminal according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the embodiment of the present invention, the main execution body of the process is a terminal device installed with an image adjustment program, the terminal device includes a computer device, a tablet computer, a smart phone, a smart television, and the like, preferably, the terminal device is an image display device, and by the image adjustment method provided in this embodiment, contrast adjustment is performed before image display, so as to obtain a better display effect. Fig. 1 shows a flowchart of an implementation of an image adjustment method according to a first embodiment of the present invention, which is detailed as follows:
in S101, the brightness value of each pixel point in the image to be adjusted is obtained.
In this embodiment, the timing for executing the image adjustment includes two triggering manners, namely manual triggering and automatic triggering. The manual triggering mode is specifically as follows: the user generates an image adjustment instruction through the interactive device of the terminal device, the instruction includes an image identifier to be adjusted, and after receiving the image adjustment instruction, the terminal device executes the relevant operation of S101 to respond to the adjustment request initiated by the user. The automatic triggering mode specifically comprises the following steps: and detecting whether the current time accords with a preset adjusting opportunity, and if so, executing the relevant operation of S101.
The preset adjusting time can be as follows: and when receiving the image file of the user, the terminal equipment stores the image file in the cache region, executes the relevant operation of S101, and stores the adjusted image in the file storage region after the adjustment is finished. The preset adjusting time can also be as follows: when receiving an image file display request initiated by a user, the terminal device executes the relevant operation of S101, and outputs the adjusted image after the adjustment is completed.
In this embodiment, the image to be adjusted may be a single image file, or may be each frame image in a video file. In this case, the terminal device first parses the video file, obtains image data corresponding to each frame, adjusts the image data of each frame, and then generates an adjusted video file according to the playing sequence of the image data.
In this embodiment, the type of the image file to be adjusted may be an image file of an LUV color space type, and in this case, the terminal device directly obtains the value of the luminance L channel, so that the luminance value of each pixel point in the image may be determined. If the type of the file to be adjusted is a Red Green Blue (RGB) image, the brightness value of each pixel point can be determined according to the respective corresponding pixel values of the pixel points in three channels through a brightness conversion algorithm.
In S102, the brightness value is imported into a preset bilateral filter function, and a filter output value of each pixel point is calculated.
In this embodiment, after obtaining the brightness value of each pixel point in the image, the terminal device obtains a preset bilateral filter function, introduces each brightness value in the image into the bilateral filter function, and calculates a filter output value corresponding to each pixel point. The bilateral filter function is used for carrying out smoothing processing on the image and reserving the existing boundary in the image.
In this embodiment, the filtering output value of each pixel point is related to the brightness value of the pixel point within the preset range, in addition to the brightness value of the pixel point. Therefore, when calculating the filtering output value of each pixel point, the luminance value of the pixel point in the preset range needs to be imported to the bilateral filter function in addition to the luminance value of the pixel point.
In this embodiment, the bilateral filter function may be stored in a storage unit of the terminal device, and in this case, the terminal device may directly read the storage unit to obtain the bilateral filter function. The terminal equipment can also obtain the bilateral filter function through the server, under the condition, the terminal equipment sends a filter function obtaining request to the server, then the server encapsulates the bilateral filter function in the request response information, and returns the request response information to the terminal equipment.
Optionally, in order to improve the adjustment effect of the bilateral filter function and adapt to differences between different devices, the server may update the relevant parameter values in the bilateral filter function at regular time, and send the updated bilateral filter function to each terminal device, where the specific implementation process is as follows: when the server receives the version update file related to the terminal equipment, the server adjusts the bilateral filter function according to the image display parameters in the version update file, and sends the adjusted bilateral filter function to the terminal equipment provided with the version update file, so that the bilateral filter function is matched with the version of the terminal equipment.
In S103, based on the filter output value, a contrast adjustment coefficient of each pixel point is determined.
In this embodiment, in order to avoid that a partial region of an image including a plurality of light and dark regions still has a low contrast after adjustment due to the adoption of a uniform contrast adjustment coefficient, the terminal device needs to determine a contrast adjustment coefficient corresponding to each pixel point, and therefore, the terminal device determines the contrast adjustment coefficient of the pixel point according to the calculated filter output value.
In this embodiment, the terminal device may directly use the filter output value as the contrast adjustment coefficient, or may import the filter output value into a preset contrast adjustment coefficient conversion algorithm through the conversion algorithm, so as to calculate the contrast adjustment coefficient corresponding to the pixel point.
In S104, the pixel value of each pixel point is adjusted according to the contrast adjustment coefficient, and an adjusted image is generated.
In this embodiment, the terminal device adjusts the pixel value of each pixel point according to the contrast adjustment coefficient, so that each pixel point in the image is subjected to contrast optimization, that is, an image formed by all the adjusted pixel points is an adjusted image. After the adjustment is completed, the terminal equipment can perform related operations of display output, storage or forwarding on the image.
In this embodiment, the terminal device may also be a server for image adjustment. In this case, the user terminal may send the image to be adjusted to the terminal device provided in this embodiment, and after receiving the image to be adjusted, execute the operations from S101 to S104, and return the adjusted image to the user terminal, thereby achieving the purpose of responding to the user adjustment request.
It can be seen from the above that, in the image adjusting method provided in the embodiment of the present invention, the brightness value of each pixel point in the image to be adjusted is introduced into the bilateral filter function, so as to determine the filter output value corresponding to each pixel point, and because the bilateral filter function can still retain the boundary value in the image during the process of smoothing the image, the pixel points at the boundary have a better display effect, and the pixel points in other regions except the boundary can also determine a filter output value matched with the smoothed image according to the smoothed image, so as to improve the overall contrast of the image, so that the image is clearly visible, and then determine the contrast adjustment coefficient of each pixel point according to the filter output value, and adjust the pixel value of each pixel point, so as to obtain the adjusted image. Compared with the prior art of image contrast adjustment, the embodiment of the invention determines the contrast adjustment coefficient corresponding to each pixel point, and does not perform weighting processing on the pixel value of the whole image through a uniform gamma coefficient, so that the aim of accurately adjusting the pixel points contained in the image can be fulfilled even if a plurality of bright and dark regions exist, the contrast of the whole image is improved, the image is clear and visible, and the display effect of the image is improved.
Fig. 2 shows a flowchart of a specific implementation of the image adjusting method S102 according to the second embodiment of the present invention. Referring to fig. 2, with respect to the embodiment shown in fig. 1, the image adjusting method S102 provided in this embodiment includes S1021 and S1022, which are detailed as follows:
further, the step of introducing the brightness value into a preset bilateral filter function and calculating a filter output value of each pixel point includes:
in S1021, the luminance value of any pixel point within a preset range, centered on the pixel point, is imported into the gray scale factor conversion model and the spatial domain factor conversion model, and the gray scale factor and the spatial domain factor of the pixel point are determined.
In this embodiment, since the bilateral filter function is a compromise process combining the spatial proximity and the pixel value similarity of the image, not only the spatial information but also the gray level similarity are considered, thereby achieving the purpose of edge-preserving and denoising. Therefore, when determining the filtering output value of a pixel, the spatial domain factor and the gray scale factor of the pixel are first determined, and then the filtering output value corresponding to the pixel is obtained through the two factors.
In this embodiment, the terminal device uses any pixel point as a center, and the pixel point included in the preset range is used as a neighboring domain corresponding to the center pixel point, that is, the pixel value of the pixel point included in the range will affect the filtering output value corresponding to the center pixel point. Of course, the larger the area of the selected preset range is, the higher the obtained image smoothing effect is, but the relatively longer the convergence time is, the larger the calculation amount is; and the area of the preset range is smaller, the calculated filtering output value considers fewer pixel points, the image smoothing effect is lower, but relatively, the convergence time is shorter, and the calculation amount is less. Therefore, the user can adjust the size of the preset range according to the actual requirement.
Optionally, in this embodiment, the terminal device may determine, by using an image recognition algorithm, the number of regions with a large difference in brightness in the image to be adjusted, and adjust the size of the preset range according to the number of the regions. Specifically, the terminal device is provided with a conversion relation table of the number of light and dark regions and a preset range, and after the number of the light and dark regions in the image is determined, the terminal device queries the conversion relation table and determines the preset range matched with the conversion relation table. The larger the number of the regions with larger light and shade difference is, the larger the preset range is; conversely, if the number of regions with large brightness difference is small, the preset range is smaller.
In this embodiment, the terminal device imports the included pixel points in the preset range into the gray scale factor conversion model and the spatial domain factor conversion model to determine the gray scale factor and the spatial domain factor corresponding to the central point of the preset range.
In S1022, the ratio between the gray scale factor and the spatial domain factor is used as the filtering output value of the pixel point.
In this embodiment, the filter output value is specifically a ratio between the gray scale factor and the spatial domain factor. Specifically, the calculation process is as follows:
Figure BDA0001535159350000081
wherein, F (x, y) is the filtering output value of the pixel point of the coordinate (x, y), a (x, y) is the gray scale factor of the pixel point of the coordinate (x, y), and B (x, y) is the space domain factor of the pixel point of the coordinate (x, y).
In the embodiment of the invention, the filtering output value of the pixel point is determined by calculating the airspace factor and the gray factor of the pixel point, and the pixel values of other pixel points in the range of the area where the pixel point is located are considered when the filtering output value is determined, so that the adjustment accuracy is improved.
Further, as another embodiment of the present invention, the image is a three primary color RGB image; the gray scale factor conversion model specifically comprises the following steps:
Figure BDA0001535159350000082
wherein the content of the first and second substances,
-m is equal to or greater than i and equal to or greater than 0 and equal to x-i;
-n is j.ltoreq.n and 0 is y-j;
Figure BDA0001535159350000091
the A (x, y) is a gray scale factor of the pixel point; x is an abscissa of the position of the pixel point, Y is an ordinate of the position of the pixel point, X is a positive integer which is greater than or equal to 1 and less than or equal to X, X is the number of pixels included in the abscissa in the image, Y is a positive integer which is greater than or equal to 1 and less than or equal to Y, and Y is the number of pixels included in the ordinate in the image; the I (x, y) is the brightness value of the pixel point; said Ir(x, y) is the pixel value of the pixel point corresponding to the red channel; said Ib(x, y) is the pixel value of the pixel point corresponding to the blue channel; said Ig(x, y) is the pixel value corresponding to the pixel point in the green channel; the sigmacAnd σdIs a positive number and is a preset adjustment coefficient; the preset range is a rectangular area formed by taking the pixel point as a center and taking m and n as side lengths, wherein m and n are positive integers and satisfy the conditions that m is larger than or equal to 1 and smaller than or equal to X/2 and n is larger than or equal to 1 and smaller than or equal to Y/2;
the space domain factor conversion model specifically comprises the following steps:
Figure BDA0001535159350000092
and B (x, y) is a gray scale factor of the pixel point.
In this embodiment, the image to be adjusted is an image in RGB format, that is, each pixel point is composed of pixel values of three channels, namely a red R channel, a green G channel, and a blue B channel, and the pixel value corresponding to each pixel point in each channel is obtained.
In the present embodiment, the side lengths m and n of the preset range are input by the user in advance, and the actual sizes thereof may be different for different images, so that the values of X and Y are also different. For the partial image, the value of m may be greater than X/2, and/or the value of n is greater than Y/2, in which case the terminal device adjusts the value of m from the value preset by the user to X/2, and/or adjusts the value of n from the preset value to Y/2, so as to meet the value requirement of the requirement parameter.
In the present embodiment, σcAnd σdThe preset adjustment factor, as described in S1021, may be determined according to the device system version and the terminal model.
Fig. 3 shows a flowchart of a specific implementation of the image adjusting method S101 according to the third embodiment of the present invention. Referring to fig. 3, with respect to the embodiment described in fig. 2, in the image adjustment method provided in this embodiment, S101 is specifically S1011:
further, the obtaining the brightness value of each pixel point in the image to be adjusted includes:
in S1011, importing the pixel values of the pixel point in the red channel, the green channel, and the blue channel into a preset luminance value conversion model, and determining the luminance value of the pixel point; wherein, the luminance value conversion model is:
Figure BDA0001535159350000101
in this embodiment, since the luminance value of each pixel point in the image may be regarded as converting the image into a gray-scale image, a pixel value corresponding to the pixel point in the gray-scale image is a luminance value, and the process of converting the image into the gray-scale image is an image generated based on an average value of the pixel values of all the pixel points in the three RGB channels, the process of converting the luminance value may refer to a process of converting the RGB image into the gray-scale image.
In this embodiment, the terminal device obtains respective corresponding pixel values of a certain pixel point in a red R channel, a green G channel, and a blue B channel, where each pixel value is an integer in a range of 0 to 255, and then introduces the three pixel values into a luminance value conversion model to calculate a luminance value corresponding to the pixel point. The brightness value conversion model is as follows:
Figure BDA0001535159350000102
wherein, I (x, y) is the brightness value of the pixel point of the coordinate (x, y); said Ir(x, y) is the pixel value of the coordinate (x, y) pixel point corresponding to the red channel; said Ib(x, y) is the pixel value corresponding to the pixel point of the coordinate (x, y) in the blue channel; said IgAnd (x, y) is the pixel value of the pixel point of the coordinate (x, y) corresponding to the green channel.
In the embodiment of the invention, the average value of the pixel values of the three channels is calculated to be used as the brightness value of the pixel point, so that the calculation amount is small, and the speed of image adjustment is increased.
Fig. 4 shows a flowchart of a specific implementation of the image adjusting method S103 according to the fourth embodiment of the present invention. Referring to fig. 4, with respect to the embodiments shown in fig. 1 to fig. 3, in the image adjustment method provided in this embodiment, the determining a contrast adjustment coefficient of each pixel point based on the filter output value specifically includes: s1031, detailed as follows:
in S1031, importing the filter output value into a gamma coefficient conversion model, and determining a contrast adjustment coefficient of the pixel point; the gamma coefficient conversion model specifically comprises:
Figure BDA0001535159350000111
wherein, the T (x, y) is a contrast adjustment coefficient of the pixel point; the I (x, y) is the brightness value of the pixel point; and F (x, y) is the filtering output value of the pixel point.
In this embodiment, after calculating the filter output value of each pixel, the terminal device imports the filter output value into a preset gamma coefficient conversion model, calculates the gamma coefficient of each pixel, and uses the gamma coefficient as a contrast adjustment coefficient.
In this embodiment, after determining the contrast adjustment coefficient, the terminal device adjusts each pixel point by using the contrast adjustment coefficient. The specific operation of the adjustment may be:
I0(x,y)=T(x,y)I(x,y)
Ir 0(x,y)=T(x,y)Ir(x,y)
Ig 0(x,y)=T(x,y)Ig(x,y)
Ib 0(x,y)=T(x,y)Ib(xx,y)
wherein, I0(x, y) is the brightness value of the pixel point after coordinate (x, y) adjustment; i isr 0(x, y) is the pixel value of the red channel after the pixel point of the coordinate (x, y) is adjusted; i isg 0(x, y) is the pixel value of the green channel after the pixel point of the coordinate (x, y) is adjusted; i isb 0And (x, y) is the pixel value of the blue channel after the pixel point of the coordinate (x, y) is adjusted.
In the embodiment of the invention, the terminal equipment can determine the gamma coefficient of each pixel point through the filtering output value and identify the gamma coefficient as the contrast adjustment coefficient, so that each pixel point of the image is configured with an independent adjustment weight, and the adjustment accuracy is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 5 is a block diagram illustrating a configuration of an image adjusting terminal according to an embodiment of the present invention, where the image adjusting terminal includes units for performing the steps in the embodiments corresponding to fig. 1 to 4. Please refer to the related descriptions of the embodiments corresponding to fig. 1 to 4. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 5, the image adjusting terminal includes:
a brightness value obtaining unit 51, configured to obtain a brightness value of each pixel point in the image to be adjusted;
a filtering output value calculating unit 52, configured to introduce the brightness value into a preset bilateral filtering function, and calculate a filtering output value of each pixel point;
a contrast adjustment coefficient determining unit 53, configured to determine a contrast adjustment coefficient of each pixel point based on the filter output value;
and an image adjusting unit 54, configured to adjust the pixel value of each pixel according to the contrast adjustment coefficient, and generate an adjusted image.
Optionally, the filter output value calculating unit 52 includes:
the adjustment factor conversion unit is used for leading the brightness value of any pixel point which is taken as the center and contains the pixel point in a preset range into the gray scale factor conversion model and the airspace factor conversion model, and determining the gray scale factor and the airspace factor of the pixel point;
and the adjusting factor calculating unit is used for taking the ratio of the gray scale factor to the space domain factor as the filtering output value of the pixel point.
Optionally, the image is a three primary color RGB image; the gray scale factor conversion model specifically comprises the following steps:
Figure BDA0001535159350000121
wherein the content of the first and second substances,
-m is equal to or greater than i and equal to or greater than 0 and equal to x-i;
-n is j.ltoreq.n and 0 is y-j;
Figure BDA0001535159350000131
the A (x, y) is a gray scale factor of the pixel point; x is an abscissa of the position of the pixel point, Y is an ordinate of the position of the pixel point, X is a positive integer which is greater than or equal to 1 and less than or equal to X, X is the total number of the pixel points contained in the abscissa in the image, Y is a positive integer which is greater than or equal to 1 and less than or equal to Y, and Y is the total number of the pixel points contained in the ordinate in the image; the I (x, y) is the brightness value of the pixel point; said Ir(x, y) is the pixel value of the pixel point corresponding to the red channel; said Ib(x, y) is the pixel value of the pixel point corresponding to the blue channel; said Ig(x, y) is the pixel value corresponding to the pixel point in the green channel; the sigmacAnd σdIs a positive number and is a preset adjustment coefficient; the preset range is a rectangular area formed by taking the pixel point as a center and taking m and n as side lengths, wherein m and n are positive integers and satisfy the conditions that m is larger than or equal to 1 and smaller than or equal to X/2 and n is larger than or equal to 1 and smaller than or equal to Y/2;
the space domain factor conversion model specifically comprises the following steps:
Figure BDA0001535159350000132
and B (x, y) is a gray scale factor of the pixel point.
Optionally, the brightness value obtaining unit 51 is specifically configured to:
importing the pixel values of the pixel points in the red channel, the green channel and the blue channel into a preset brightness value conversion model to determine the brightness value of the pixel points; wherein, the luminance value conversion model is:
Figure BDA0001535159350000133
optionally, the adjustment factor calculating unit 54 is specifically configured to:
importing the filtering output value into a gamma coefficient conversion model, and determining a contrast adjustment coefficient of the pixel point; the gamma coefficient conversion model specifically comprises:
Figure BDA0001535159350000134
wherein, the T (x, y) is a contrast adjustment coefficient of the pixel point; the I (x, y) is the brightness value of the pixel point; and F (x, y) is the filtering output value of the pixel point.
Therefore, the image adjustment terminal provided by the embodiment of the invention can also determine the contrast adjustment coefficient corresponding to each pixel point, rather than weighting the pixel values of the whole image through a uniform gamma coefficient, so that even if a plurality of bright and dark regions exist, the purpose of accurately adjusting the pixel points included in the image can be realized, the contrast of the whole image is improved, the image is clear and visible, and the display effect of the image is improved.
Fig. 6 is a schematic diagram of a terminal device according to another embodiment of the present invention. As shown in fig. 6, the terminal device 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62, such as an image adjustment program, stored in said memory 61 and executable on said processor 60. The processor 60 executes the computer program 62 to implement the steps in the above-mentioned embodiments of the image adjusting method, such as S101 to S104 shown in fig. 1. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the units in the above-described device embodiments, such as the functions of the modules 51 to 54 shown in fig. 5.
Illustratively, the computer program 62 may be divided into one or more units, which are stored in the memory 61 and executed by the processor 60 to accomplish the present invention. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 62 in the terminal device 6. For example, the computer program 62 may be divided into a luminance value acquisition unit, a filter output value calculation unit, a contrast adjustment coefficient determination unit, and an image adjustment unit, each unit functioning specifically as follows:
the brightness value obtaining unit is used for obtaining the brightness value of each pixel point in the image to be adjusted;
the filtering output value calculating unit is used for leading the brightness value into a preset bilateral filtering function and calculating the filtering output value of each pixel point;
a contrast adjustment coefficient determining unit, configured to determine a contrast adjustment coefficient of each pixel point based on the filter output value;
and the image adjusting unit is used for adjusting the pixel value of each pixel point according to the contrast adjusting coefficient to generate an adjusted image.
The terminal device 6 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a terminal device 6 and does not constitute a limitation of terminal device 6 and may include more or less components than those shown, or some components in combination, or different components, for example, the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. The memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used for storing the computer program and other programs and data required by the terminal device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. An image adjustment method, comprising:
acquiring the brightness value of each pixel point in the image to be adjusted;
importing the brightness value into a preset bilateral filter function, and calculating the filter output value of each pixel point; the bilateral filter function is a processing function combining the spatial proximity and the pixel value similarity of the image;
determining a contrast adjustment coefficient of each pixel point based on the filtering output value;
adjusting the pixel value of each pixel point according to the contrast adjustment coefficient to generate an adjusted image;
the step of introducing the brightness value into a preset bilateral filter function and calculating a filter output value of each pixel point comprises:
leading the brightness value of any pixel point which is taken as the center and contains the pixel point in a preset range into a gray scale factor conversion model and a space domain factor conversion model, and determining the gray scale factor and the space domain factor of the pixel point;
taking the ratio of the gray scale factor to the spatial domain factor as the filtering output value of the pixel point;
the space domain factor conversion model specifically comprises the following steps:
Figure FDA0003115492690000011
wherein the content of the first and second substances,
-m is equal to or greater than i and equal to or greater than 0 and equal to x-i;
-n is j.ltoreq.n and 0 is y-j;
Figure FDA0003115492690000012
x is an abscissa of the position of the pixel point, Y is an ordinate of the position of the pixel point, X is a positive integer which is greater than or equal to 1 and less than or equal to X, X is the number of pixels included in the abscissa in the image, Y is a positive integer which is greater than or equal to 1 and less than or equal to Y, and Y is the number of pixels included in the ordinate in the image; said Ir(x, y) is the pixel value of the pixel point corresponding to the red channel; said Ib(x, y) is the pixel value of the pixel point corresponding to the blue channel; said Ig(x, y) is the pixel value corresponding to the pixel point in the green channel; the sigmacAnd σdIs a positive number and is a preset adjustment coefficient; the preset range is a rectangular area formed by taking the pixel point as a center and taking m and n as side lengths, wherein m and n are positive integers and satisfy the conditions that m is larger than or equal to 1 and smaller than or equal to X/2 and n is larger than or equal to 1 and smaller than or equal to Y/2; and B (x, y) is a space domain factor of the pixel point.
2. The adjustment method according to claim 1, characterized in that the image is a three primary RGB image; the gray scale factor conversion model specifically comprises the following steps:
Figure FDA0003115492690000021
the I (x, y) is the brightness value of the pixel point; and A (x, y) is the gray scale factor of the pixel point.
3. The adjusting method according to claim 2, wherein the obtaining the brightness value of each pixel point in the image to be adjusted includes:
importing the pixel values of the pixel points in the red channel, the green channel and the blue channel into a preset brightness value conversion model to determine the brightness value of the pixel points; wherein, the luminance value conversion model is:
Figure FDA0003115492690000022
4. the method according to any one of claims 1 to 3, wherein the determining a contrast adjustment coefficient for each of the pixels based on the filter output value comprises:
importing the filtering output value into a gamma coefficient conversion model, and determining a contrast adjustment coefficient of the pixel point; the gamma coefficient conversion model specifically comprises:
Figure FDA0003115492690000023
wherein, the T (x, y) is a contrast adjustment coefficient of the pixel point; the I (x, y) is the brightness value of the pixel point; and F (x, y) is the filtering output value of the pixel point.
5. An image adjustment terminal, comprising:
the brightness value obtaining unit is used for obtaining the brightness value of each pixel point in the image to be adjusted;
the filtering output value calculating unit is used for leading the brightness value into a preset bilateral filtering function and calculating the filtering output value of each pixel point; the bilateral filter function is a processing function combining the spatial proximity and the pixel value similarity of the image;
a contrast adjustment coefficient determining unit, configured to determine a contrast adjustment coefficient of each pixel point based on the filter output value;
the image adjusting unit is used for adjusting the pixel value of each pixel point according to the contrast adjusting coefficient to generate an adjusted image;
the filtering output value calculating unit includes:
the adjustment factor conversion unit is used for leading the brightness value of any pixel point which is taken as the center and contains the pixel point in a preset range into the gray scale factor conversion model and the airspace factor conversion model, and determining the gray scale factor and the airspace factor of the pixel point;
the adjusting factor calculating unit is used for taking the ratio of the gray scale factor to the airspace factor as the filtering output value of the pixel point;
the space domain factor conversion model specifically comprises the following steps:
Figure FDA0003115492690000031
wherein the content of the first and second substances,
-m is equal to or greater than i and equal to or greater than 0 and equal to x-i;
-n is j.ltoreq.n and 0 is y-j;
Figure FDA0003115492690000032
x is the horizontal line of the position of the pixel pointY is a vertical coordinate of the position of the pixel point, X is a positive integer which is greater than or equal to 1 and less than or equal to X, X is the number of pixels contained in the horizontal coordinate in the image, Y is a positive integer which is greater than or equal to 1 and less than or equal to Y, and Y is the number of pixels contained in the vertical coordinate in the image; said Ir(x, y) is the pixel value of the pixel point corresponding to the red channel; said Ib(x, y) is the pixel value of the pixel point corresponding to the blue channel; said Ig(x, y) is the pixel value corresponding to the pixel point in the green channel; the sigmacAnd σdIs a positive number and is a preset adjustment coefficient; the preset range is a rectangular area formed by taking the pixel point as a center and taking m and n as side lengths, wherein m and n are positive integers and satisfy the conditions that m is larger than or equal to 1 and smaller than or equal to X/2 and n is larger than or equal to 1 and smaller than or equal to Y/2; and B (x, y) is a space domain factor of the pixel point.
6. The adjustment terminal according to claim 5, characterized in that said image is a three primary RGB image; the gray scale factor conversion model specifically comprises the following steps:
Figure FDA0003115492690000041
the I (x, y) is the brightness value of the pixel point; and A (x, y) is the gray scale factor of the pixel point.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 4 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN201711488395.4A 2017-12-29 2017-12-29 Image adjusting method and terminal thereof Active CN109996017B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711488395.4A CN109996017B (en) 2017-12-29 2017-12-29 Image adjusting method and terminal thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711488395.4A CN109996017B (en) 2017-12-29 2017-12-29 Image adjusting method and terminal thereof

Publications (2)

Publication Number Publication Date
CN109996017A CN109996017A (en) 2019-07-09
CN109996017B true CN109996017B (en) 2021-08-06

Family

ID=67111405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711488395.4A Active CN109996017B (en) 2017-12-29 2017-12-29 Image adjusting method and terminal thereof

Country Status (1)

Country Link
CN (1) CN109996017B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101324722A (en) * 2007-06-13 2008-12-17 深圳Tcl新技术有限公司 Method for adjusting liquid crystal display device backlight lightness and contrast
CN104182947A (en) * 2014-09-10 2014-12-03 安科智慧城市技术(中国)有限公司 Low-illumination image enhancement method and system
CN104504648A (en) * 2014-12-02 2015-04-08 小米科技有限责任公司 Image contrast adjustment method and image contrast adjustment device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101324722A (en) * 2007-06-13 2008-12-17 深圳Tcl新技术有限公司 Method for adjusting liquid crystal display device backlight lightness and contrast
CN104182947A (en) * 2014-09-10 2014-12-03 安科智慧城市技术(中国)有限公司 Low-illumination image enhancement method and system
CN104504648A (en) * 2014-12-02 2015-04-08 小米科技有限责任公司 Image contrast adjustment method and image contrast adjustment device

Also Published As

Publication number Publication date
CN109996017A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
CN109191395B (en) Image contrast enhancement method, device, equipment and storage medium
US10818269B2 (en) Method for adjusting display image contrast, display and readable storage medium
CN109309826B (en) Image color balancing method and device, terminal equipment and readable storage medium
CN108009997B (en) Method and device for adjusting image contrast
CN110996174B (en) Video image quality enhancement method and related equipment thereof
CN107993189B (en) Image tone dynamic adjustment method and device based on local blocking
CN108806638B (en) Image display method and device
CN113507598B (en) Video picture display method, device, terminal and storage medium
CN101621704A (en) Color enhancement for graphic images
JP2018517993A (en) Real-time video enhancement method, terminal, and non-transitory computer-readable storage medium
CN109686342B (en) Image processing method and device
CN115496668A (en) Image processing method, image processing device, electronic equipment and storage medium
US11962917B2 (en) Color adjustment method, color adjustment device, electronic device and computer-readable storage medium
CN114998122A (en) Low-illumination image enhancement method
WO2022120799A9 (en) Image processing method and apparatus, electronic device, and storage medium
WO2019090580A1 (en) System and method for image dynamic range adjusting
US20170310872A1 (en) Image dynamic range adjustment method, terminal, and storage medium
CN116453470B (en) Image display method, device, electronic equipment and computer readable storage medium
CN109308690B (en) Image brightness balancing method and terminal
CN109996017B (en) Image adjusting method and terminal thereof
CN103685972A (en) Image optimizing method and system employing same
CN109391855B (en) Method for determining display brightness value and set top box
WO2023284528A1 (en) Image enhancement method and apparatus, computer device, and storage medium
CN113391779B (en) Parameter adjusting method, device and equipment for paper-like screen
CN109644257B (en) Display apparatus and method for displaying image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 516006 TCL science and technology building, No. 17, Huifeng Third Road, Zhongkai high tech Zone, Huizhou City, Guangdong Province

Applicant after: TCL Technology Group Co.,Ltd.

Address before: 516006 Guangdong province Huizhou Zhongkai hi tech Development Zone No. nineteen District

Applicant before: TCL RESEARCH AMERICA Inc.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant