CN117119161A - Picture adjustment method and device, storage medium and electronic equipment - Google Patents

Picture adjustment method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117119161A
CN117119161A CN202211600535.3A CN202211600535A CN117119161A CN 117119161 A CN117119161 A CN 117119161A CN 202211600535 A CN202211600535 A CN 202211600535A CN 117119161 A CN117119161 A CN 117119161A
Authority
CN
China
Prior art keywords
index
histogram
target
preset
picture
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.)
Pending
Application number
CN202211600535.3A
Other languages
Chinese (zh)
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.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology 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 Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202211600535.3A priority Critical patent/CN117119161A/en
Publication of CN117119161A publication Critical patent/CN117119161A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/646Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/67Circuits for processing colour signals for matrixing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

The application discloses a picture adjusting method, a device, a storage medium and electronic equipment, and relates to the technical field of Internet of things, wherein the method comprises the following steps: obtaining a to-be-processed gallery, wherein the to-be-processed gallery comprises a preset number of preset images; acquiring a reference picture of playing each preset image in a reference terminal, and acquiring a target picture of playing each preset image in a target terminal; calculating a reference histogram based on each of the reference pictures, and calculating a target histogram based on each of the target pictures; and obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image, wherein the color style migration table is used for picture adjustment in the target terminal. The method and the device can improve the picture adjusting effect of the terminal and improve the user experience.

Description

Picture adjustment method and device, storage medium and electronic equipment
Technical Field
The application relates to the technical field of the internet of things, in particular to a picture adjusting method, a picture adjusting device, a storage medium and electronic equipment.
Background
In the color adjustment of a picture of a terminal, for example, a television, an engineer typically determines a set of optimal adjustment parameters for adjusting the picture of the target terminal by comparing the difference between the target terminal to be adjusted and a reference terminal according to the difference.
In the current mode, the adjustment of the picture of the terminal depends on the working experience of engineers, so that the stability and the adaptability of the optimal adjustment parameters are generally poor, the adjustment effect of the picture of the terminal is poor, and the user experience is poor.
Disclosure of Invention
The embodiment of the application provides a scheme which can improve the picture adjusting effect of the terminal and improve the user experience.
The embodiment of the application provides the following technical scheme:
according to an embodiment of the present application, a picture adjustment method includes: obtaining a to-be-processed gallery, wherein the to-be-processed gallery comprises a preset number of preset images; acquiring a reference picture of playing each preset image in a reference terminal, and acquiring a target picture of playing each preset image in a target terminal; calculating a reference histogram based on each of the reference pictures, and calculating a target histogram based on each of the target pictures; and obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image, wherein the color style migration table is used for picture adjustment in the target terminal.
In some embodiments of the present application, the obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image includes: calculating an accumulated density function based on a target histogram corresponding to each preset image respectively to obtain target density data; calculating an accumulated density function based on a reference histogram corresponding to each preset image respectively to obtain reference density data; respectively performing migration and copy on each target density data to obtain a migration density table with a preset size; respectively calculating absolute differences between each column of the migration density table corresponding to each preset image and the reference density data to obtain a difference table with a preset size corresponding to each preset image; obtaining initial index mapping data corresponding to each preset image based on a row index and a column index corresponding to a preset element in a difference value table corresponding to each preset image; and obtaining a color style migration table based on the initial index mapping data corresponding to each preset image.
In some embodiments of the present application, the obtaining a color style migration table based on the initial index mapping data corresponding to each preset image includes: extracting a target number of preset images from the preset number of preset images to obtain a target number of test images; respectively applying initial index mapping data corresponding to each preset image to the target terminal, and acquiring a test picture of playing each test image in the target terminal; calculating a test histogram of each test picture under each initial index mapping data application; performing histogram cross kernel calculation processing on the two test histogram sets to obtain the histogram similarity between the test histogram sets, wherein each test histogram set comprises a test histogram under the application of the initial index mapping data; obtaining a candidate index mapping table based on the initial index mapping data corresponding to the test histogram set with the similarity meeting the preset condition; and obtaining the color style migration table based on the candidate index mapping table.
In some embodiments of the present application, the obtaining the color style migration table based on the candidate index mapping table includes: acquiring a screen display matrix of the target terminal, wherein the screen display matrix comprises factors which have influence on the color of a screen display picture in a machine core and a backlight; and obtaining the color style migration table based on the screen display matrix and the candidate index mapping table.
In some embodiments of the application, the predetermined element comprises a minimum value in each column, and the initial index map data comprises an index array; the obtaining initial index mapping data corresponding to each preset image based on the row index and the column index corresponding to the predetermined element in the difference value table corresponding to each preset image includes: acquiring a row index and a column index corresponding to a minimum value in each column of a difference table corresponding to each preset image, and acquiring an index set corresponding to each difference table; and respectively taking the column index in the index set as an array index and the row index as an array median for the index set corresponding to each difference table to obtain an index array corresponding to each preset image.
In some embodiments of the application, the initial index map data comprises an index array; the obtaining the candidate index mapping table based on the initial index mapping data corresponding to the test histogram set with the similarity meeting the preset condition comprises the following steps: averaging the index arrays corresponding to the test histogram sets with the similarity meeting the preset condition to obtain an average index array; and taking the array index in the average index array as the original gray level and taking the array median corresponding to the array index as the target gray level to be regulated, so as to obtain the candidate index mapping table comprising the mapping relation between the original gray level and the corresponding target gray level.
In some embodiments of the present application, the obtaining the color style migration table based on the screen display matrix and the candidate index mapping table includes: calculating an inverse matrix corresponding to the screen display matrix; and obtaining the color style migration table based on the inverse matrix and the candidate index mapping table.
According to an embodiment of the present application, a picture adjustment apparatus includes: the drawing library acquisition module is used for acquiring a drawing library to be processed, wherein the drawing library to be processed comprises a preset number of preset images; the picture acquisition module is used for acquiring a reference picture of playing each preset image in the reference terminal and acquiring a target picture of playing each preset image in the target terminal; a histogram calculation module for calculating a reference histogram based on each of the reference pictures and calculating a target histogram based on each of the target pictures; the table generation module is used for obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image, and the color style migration table is used for picture adjustment in the target terminal.
In some embodiments of the application, the table generation module is configured to: calculating an accumulated density function based on a target histogram corresponding to each preset image respectively to obtain target density data; calculating an accumulated density function based on a reference histogram corresponding to each preset image respectively to obtain reference density data; respectively performing migration and copy on each target density data to obtain a migration density table with a preset size; respectively calculating absolute differences between each column of the migration density table corresponding to each preset image and the reference density data to obtain a difference table with a preset size corresponding to each preset image; obtaining initial index mapping data corresponding to each preset image based on a row index and a column index corresponding to a preset element in a difference value table corresponding to each preset image; and obtaining a color style migration table based on the initial index mapping data corresponding to each preset image.
In some embodiments of the application, the table generation module is configured to: extracting a target number of preset images from the preset number of preset images to obtain a target number of test images; respectively applying initial index mapping data corresponding to each preset image to the target terminal, and acquiring a test picture of playing each test image in the target terminal; calculating a test histogram of each test picture under each initial index mapping data application; performing histogram cross kernel calculation processing on the two test histogram sets to obtain the histogram similarity between the test histogram sets, wherein each test histogram set comprises a test histogram under the application of the initial index mapping data; obtaining a candidate index mapping table based on the initial index mapping data corresponding to the test histogram set with the similarity meeting the preset condition; and obtaining the color style migration table based on the candidate index mapping table.
In some embodiments of the application, the table generation module is configured to: acquiring a screen display matrix of the target terminal, wherein the screen display matrix comprises factors which have influence on the color of a screen display picture in a machine core and a backlight; and obtaining the color style migration table based on the screen display matrix and the candidate index mapping table.
In some embodiments of the application, the predetermined element comprises a minimum value in each column, and the initial index map data comprises an index array; the table generation module is used for: acquiring a row index and a column index corresponding to a minimum value in each column of a difference table corresponding to each preset image, and acquiring an index set corresponding to each difference table; and respectively taking the column index in the index set as an array index and the row index as an array median for the index set corresponding to each difference table to obtain an index array corresponding to each preset image.
In some embodiments of the application, the initial index map data comprises an index array; the table generation module is used for: averaging the index arrays corresponding to the test histogram sets with the similarity meeting the preset condition to obtain an average index array; and taking the array index in the average index array as the original gray level and taking the array median corresponding to the array index as the target gray level to be regulated, so as to obtain the candidate index mapping table comprising the mapping relation between the original gray level and the corresponding target gray level.
In some embodiments of the application, the table generation module is configured to: calculating an inverse matrix corresponding to the screen display matrix; and obtaining the color style migration table based on the inverse matrix and the candidate index mapping table.
According to another embodiment of the present application, a storage medium has a computer program stored thereon, which when executed by a processor of a computer, causes the computer to perform the method according to the embodiment of the present application.
According to another embodiment of the present application, an electronic device may include: a memory storing a computer program; and the processor reads the computer program stored in the memory to execute the method according to the embodiment of the application.
According to another embodiment of the application, a computer program product or computer program includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the computer device to perform the methods provided in the various alternative implementations described in the embodiments of the present application.
In the embodiment of the application, a to-be-processed gallery is obtained, wherein the to-be-processed gallery comprises a preset number of preset images; acquiring a reference picture of playing each preset image in a reference terminal, and acquiring a target picture of playing each preset image in a target terminal; calculating a reference histogram based on each of the reference pictures, and calculating a target histogram based on each of the target pictures; and obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image, wherein the color style migration table is used for picture adjustment in the target terminal.
In this way, the reference histogram of the reference picture of each preset image played in the reference terminal is calculated, the target histogram of the target picture of each preset image played in the target terminal is calculated, the difference between the played images in the reference terminal and the target terminal can be reflected based on the reference histogram and the target histogram corresponding to each preset image, and then a color style migration table can be obtained.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a flowchart of a picture adjustment method according to an embodiment of the present application.
Fig. 2 shows a histogram according to an embodiment of the application.
FIG. 3 shows a graph of cumulative density function according to one embodiment of the application.
Fig. 4 shows a histogram according to another embodiment of the application.
Fig. 5 shows a graph of cumulative density function according to another embodiment of the application.
Fig. 6 shows a mapping graph according to an embodiment of the application.
Fig. 7 shows a block diagram of a picture adjustment device according to an embodiment of the application.
Fig. 8 shows a block diagram of an electronic device according to an embodiment of the application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
Fig. 1 schematically shows a flow chart of a picture adjustment method according to an embodiment of the application. The main execution body of the picture adjustment method can be any picture adjustment equipment, such as a computer, a mobile phone, a smart watch, a cloud server, a household appliance and the like.
As shown in fig. 1, the picture adjustment method may include steps S110 to S140.
Step S110, a to-be-processed gallery is obtained, wherein the to-be-processed gallery comprises a preset number of preset images; step S120, obtaining a reference picture of playing each preset image in a reference terminal, and obtaining a target picture of playing each preset image in a target terminal; step S130, calculating a reference histogram based on each reference picture, and calculating a target histogram based on each target picture; step S140, obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image, where the color style migration table is used for adjusting the picture in the target terminal.
The reference pictures in the reference terminal for playing each preset image may be: and shooting a screen display picture obtained by a screen when each preset image is played in the reference terminal through a camera. The target picture of playing each preset image in the target terminal may be: and shooting a screen display picture obtained by a screen when each preset image is played in the target terminal through a camera. Each preset image can correspondingly acquire a reference picture, and each preset image can correspondingly acquire a target picture.
The histogram of each reference picture, that is, the reference histogram corresponding to each reference picture, is calculated by a histogram calculation function (for example, a histogram calculation function in OpenCV), and the reference histogram may include a reference histogram of each of R, G and B channels. The histogram of each target picture is calculated by a histogram calculation function (for example, a histogram calculation function in OpenCV), and the histogram of each target picture, that is, the target histogram corresponding to each target picture, may include the target histogram of each of R, G and B channels.
Based on the reference histogram and the target histogram corresponding to each preset image, the picture display condition of the same preset image played in the reference terminal and the target terminal can be reflected respectively, and accordingly, a color style migration table can be obtained based on the reference histogram and the target histogram, can be used in the target terminal for picture adjustment, and can realize migration of the color style of pictures in the reference terminal to the target terminal.
In this way, based on the steps S110 to S140, by calculating the reference histogram of the reference picture of each preset image played in the reference terminal and calculating the target histogram of the target picture of each preset image played in the target terminal, the difference between the played images in the reference terminal and the target terminal can be reflected based on the reference histogram and the target histogram corresponding to each preset image, so as to obtain the color style migration table, and the color style migration table is used in the target terminal to realize the migration of the color style of the picture in the reference terminal to the target terminal, so as to realize picture adjustment, avoid the problem of poor stability and adaptability of the adjustment parameters caused by depending on the experience of engineers, promote the picture adjustment effect of the terminal, and promote the user experience.
In one mode of this example, the reference terminal is a reference television, and the target terminal is a target television.
Further alternative embodiments of the steps performed when performing the picture adjustment in the embodiment of fig. 1 are described below.
In one embodiment, the obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image includes:
calculating an accumulated density function based on a target histogram corresponding to each preset image respectively to obtain target density data; calculating an accumulated density function based on a reference histogram corresponding to each preset image respectively to obtain reference density data; respectively performing migration and copy on each target density data to obtain a migration density table with a preset size; respectively calculating absolute differences between each column of the migration density table corresponding to each preset image and the reference density data to obtain a difference table with a preset size corresponding to each preset image; obtaining initial index mapping data of a preset number of groups based on row indexes and column indexes corresponding to preset elements in a difference value table corresponding to each preset image; and obtaining the color style migration table based on the initial index mapping data of the preset groups.
Calculating the cumulative density function for the target histogram of each channel may obtain target density data for the corresponding channel, for example, referring to fig. 2 and 3, an example target histogram of R channels with a size of (256, 1) is shown in fig. 2, and calculating the cumulative density function for the target histogram of fig. 2 may obtain target density data of R channels with a size of (1, 256) corresponding to the cumulative density function shown in fig. 3.
Calculating the cumulative density function for the reference histogram of each channel may obtain reference density data for the corresponding channel, referring to fig. 4 and 5, an example reference histogram of the R channel having a size of (256, 1) is shown in fig. 4, and calculating the cumulative density function for the reference histogram of fig. 4 may obtain reference density data of the R channel having a size of (1, 256) corresponding to the cumulative density function shown in fig. 5.
The migration copy is performed on the target density data of each channel to obtain a migration density table with a predetermined size of each channel, for example, the migration copy is performed on the target density data of the R channel as shown in fig. 3, 255 data in each column of the target density data with a size of (1, 256) may be copied, so as to generate a migration density table of the R channel with a size of (256 ), where each column of the migration density table includes the same 256 data, and the predetermined size of the migration density table is (256 ).
Calculating absolute differences of each column of the migration density table corresponding to each preset image and the reference density data respectively to obtain a difference table with preset size corresponding to each preset image, for example, the A migration density table and the A reference density data corresponding to the A preset image under the R channel, subtracting the A reference density data from the 1 st column data in the A migration density table to obtain the absolute differences of the 1 st column, subtracting the A reference density data from the i th column data in the A migration density table to obtain the absolute differences of the i th column to obtain the absolute differences of the 256 th column, and forming a difference table A with the size (256 ) corresponding to the A preset image under the R channel by the absolute differences of the 256 columns. Similarly, the difference value table of the three channels corresponding to other preset images can be obtained.
And obtaining initial index mapping data corresponding to each preset image based on a row index and a column index corresponding to a preset element in a difference table corresponding to each preset image, wherein the preset element can be a minimum value or an intermediate value in each column of the difference table. For example, a row index and a column index corresponding to the minimum value in each column of the difference table a may be determined, and 256 index pairs corresponding to the row index and the column index corresponding to the row index may be used. For example, one index pair is (1, 3), where 1 is a row index, 3 is a column index, the predetermined element corresponding to (1, 3) is the minimum value in the 3 rd column in the difference table a, and the initial index mapping data corresponding to the preset image a in the R channel can be formed by the 256 row indexes and the index pair corresponding to the column index corresponding to the row index, and similarly, the initial index mapping data corresponding to the preset image a in the G and B channels can be obtained, for example, as shown in fig. 6, the initial index mapping data (three mapping curves) of the preset image a in the R (red), G (green) and B (blue) channels can be obtained. Similarly, a set of corresponding initial index mapping data can be obtained by the difference tables corresponding to different channels for different preset images, namely, the initial index mapping data corresponding to three channels for each preset image.
And processing the initial index mapping data based on the three channels corresponding to each preset image to obtain a color style migration table. The color style migration table can comprise the original gray level and the target gray level to be regulated corresponding to the original gray level, the color style migration table is applied to the target terminal, and the original gray level can be regulated to the target gray level when the picture is played in the target terminal, so that picture regulation is realized.
In one embodiment, the predetermined element comprises a minimum value in each column, and the initial index map data comprises an index array; the obtaining initial index mapping data corresponding to each preset image based on the row index and the column index corresponding to the predetermined element in the difference value table corresponding to each preset image includes: acquiring a row index and a column index corresponding to a minimum value in each column of a difference table corresponding to each preset image, and acquiring an index set corresponding to each difference table; and respectively taking the column index in the index set as an array index and the row index as an array median for the index set corresponding to each difference table to obtain an index array corresponding to each preset image.
For example, a preset image corresponds to a three-channel difference table, a row index and a column index corresponding to a minimum value in each column of the difference table of each channel may be determined, and the row index and the column index determined in the difference table of each channel may form an index set corresponding to the difference table of each channel. Further, for example, the size of the difference table a is (256 ), the index set a corresponding to the difference table a includes 256 row indexes and column indexes corresponding to the row indexes, the column indexes in the index set a are used as array indexes, the row indexes are used as values in the array, and the index array corresponding to the index set a is obtained, and the index array size is (1, 256). Accordingly, index arrays corresponding to the three-channel difference value tables corresponding to the preset images can be obtained.
In one embodiment, the obtaining a color style migration table based on the initial index mapping data corresponding to each preset image includes: averaging the initial index mapping data corresponding to a preset number of preset images to obtain average index mapping data; and obtaining a color style migration table based on the average index mapping data.
Averaging the initial index mapping data of the R channels corresponding to the preset images to obtain average index mapping data of the R channels, averaging the initial index mapping data of the G channels corresponding to the preset images to obtain average index mapping data of the G channels, and averaging the initial index mapping data of the B channels corresponding to the preset images to obtain average index mapping data of the B channels. The average index map data includes an average column index and an average row index corresponding to the average column index.
The migration index table is formed based on the average index mapping data of the three channels and can be used as a color style migration table, and the color style migration table can comprise migration index tables of the three channels, wherein each average column index in the migration index table can be used as the original gray level of a picture, and each average row index corresponding to each average column index can be the target gray level to be regulated corresponding to the original gray level of the picture.
In one embodiment, the obtaining a color style migration table based on the initial index mapping data corresponding to each preset image includes:
extracting a target number of preset images from the preset number of preset images to obtain a target number of test images; respectively applying initial index mapping data corresponding to each preset image to the target terminal, and acquiring a test picture of playing each test image in the target terminal; calculating a test histogram of each test picture under each initial index mapping data application; performing histogram cross kernel calculation processing on the two test histogram sets to obtain the histogram similarity between the test histogram sets, wherein each test histogram set comprises a test histogram under the application of the initial index mapping data; obtaining a candidate index mapping table based on the initial index mapping data corresponding to the test histogram set with the similarity meeting the preset condition; and obtaining the color style migration table based on the candidate index mapping table.
In this embodiment, a reliable histogram is screened out through a histogram cross-kernel calculation process, and further, reliable initial index mapping data corresponding to a test histogram set with similarity meeting a predetermined condition is screened out, and further, a color style migration table is obtained, and further, a picture adjusting effect is improved.
And sequentially applying the initial index mapping data corresponding to the ith preset image in the N preset images to the target terminal, and then playing M test images in the target terminal and acquiring test pictures for playing the test images to obtain M test pictures under the ith initial index mapping data (including the initial index mapping data of three channels). Each test picture can be calculated to obtain a test histogram of three channels in M test pictures under the application of the ith initial index mapping data.
And respectively carrying out histogram cross kernel calculation processing on the two test histogram sets to obtain the histogram similarity between the test histogram sets, wherein each test histogram set comprises 3 channel x M test histograms corresponding to M test pictures under the application of initial index mapping data. Specifically, the following formula is used for performing the histogram cross kernel calculation processing on the two test histogram sets respectively:
wherein ψ (y), ψ (z) represents the test histograms in the two test histogram sets;representing the weight; n (N) i Represented at iNumber of new matching pairs of levels, N i The definition of (2) is as follows:
N i =I(H i (y),H i (z))-I(H i-1 (y),H i-1 (z));
I in the above formula can be expressed as:
wherein A and B are test histograms with bin number r, A j Represents the number of jth bin in A, B j Representing the number of jth bins in B.
The above formula is integrated to obtain:
after the histogram similarity between every two test histogram sets is calculated, the test histogram set with the similarity meeting the preset condition can be determined, and the test histogram set with the similarity meeting the preset condition can be the test histogram set with the histogram similarity ranking before the preset ranking (for example, the ranking is 30 percent before).
And obtaining a candidate index mapping table based on the initial index mapping data of the three channels corresponding to the test histogram set with the similarity meeting the preset condition. Specifically, the initial index mapping data of the R channel corresponding to the test histogram set meeting the preset condition can be averaged to obtain the average index mapping data of the R channel; the initial index mapping data of the G channel corresponding to the test histogram set meeting the preset condition can be averaged to obtain the average index mapping data of the G channel; the initial index mapping data of the B channel corresponding to the test histogram set meeting the preset condition can be averaged to obtain the average index mapping data of the B channel; the average index mapping data comprises an average column index and an average row index corresponding to the average column index; the candidate index map for the three channels may be formed based on the average index map data for the three channels.
In one embodiment, the initial index map data includes an index array; the obtaining the candidate index mapping table based on the initial index mapping data corresponding to the test histogram set with the similarity meeting the preset condition comprises the following steps: averaging the index arrays corresponding to the test histogram sets with the similarity meeting the preset condition to obtain an average index array; and taking the array index in the average index array as the original gray level and taking the array median corresponding to the array index as the target gray level to be regulated, so as to obtain the candidate index mapping table comprising the mapping relation between the original gray level and the corresponding target gray level.
Specifically, the index arrays of the R channels corresponding to the test histogram set meeting the preset conditions can be averaged to obtain an average index array of the R channels; averaging the index arrays of the G channels corresponding to the test histogram set meeting the preset condition to obtain an average index array of the G channels; averaging the index arrays of the B channels corresponding to the test histogram set meeting the preset condition to obtain an average index array of the B channels; and taking the array index in the average index array of each channel as the original gray level and taking the array median corresponding to the array index as the target gray level to be regulated, so that a candidate index mapping table corresponding to each channel and comprising the mapping relation between the original gray level and the corresponding target gray level can be obtained.
In one embodiment, obtaining the color style migration table based on the candidate index mapping table may specifically include: and taking the candidate index mapping table as a color style migration table, wherein the color style migration table can comprise three candidate index mapping tables of channels, wherein each average column index in the candidate index mapping table can be used as the original gray level of a picture, and each average row index corresponding to each average column index can be the target gray level to be regulated corresponding to the original gray level of the picture. After the color style migration table is applied to the target terminal, when the target terminal displays a picture, the original gray scale can be adjusted to the corresponding target gray scale according to the candidate index mapping tables of the three channels, so that the picture adjustment is realized.
In one embodiment, the obtaining the color style migration table based on the candidate index mapping table includes: acquiring a screen display matrix of the target terminal, wherein the screen display matrix comprises factors which have influence on the color of a screen display picture in a machine core and a backlight; and obtaining the color style migration table based on the screen display matrix and the candidate index mapping table.
Under the embodiment, a screen display matrix of the target terminal is further obtained, wherein the screen display matrix comprises factors which influence the color of a screen display picture in a core and a backlight of the target terminal, and the screen display matrix can be obtained through testing the target terminal in advance. And combining the screen display matrix and the candidate index mapping table to obtain a color style migration table comprising the screen display matrix and the candidate index mapping table. After the color style migration table is applied to the target terminal, when the target terminal displays a picture, the original gray scale can be adjusted to the corresponding target gray scale according to the candidate index mapping tables of the three channels, so that the picture adjustment is realized, the display parameters can be adjusted based on the screen display matrix, and the influence on the color of the screen display picture in the movement and the backlight in the target terminal is avoided.
In one embodiment, the obtaining the color style migration table based on the screen display matrix and the candidate index mapping table includes: calculating an inverse matrix corresponding to the screen display matrix; and obtaining the color style migration table based on the inverse matrix and the candidate index mapping table. And combining the inverse matrix and the candidate index mapping table to obtain a color style migration table comprising the inverse matrix and the candidate index mapping table. After the color style migration table is applied to the target terminal, when a picture is displayed in the target terminal, the original gray level can be adjusted to the corresponding target gray level according to the candidate index mapping tables of the three channels, so that the picture adjustment is realized; the inverse matrix and the display parameters can be directly multiplied or added to obtain the adjusted display parameters, and the picture display is performed based on the adjusted display parameters, so that the influence on the color of the screen display picture in the movement and backlight of the target terminal is avoided.
In order to facilitate better implementation of the picture adjustment method provided by the embodiment of the application, the embodiment of the application also provides a picture adjustment device based on the picture adjustment method. The meaning of the term is the same as that in the picture adjustment method, and specific implementation details can be referred to the description in the method embodiment. Fig. 3 shows a block diagram of a picture adjustment device according to an embodiment of the application.
As shown in fig. 7, the screen adjustment apparatus 200 may include: a gallery acquisition module 210, a picture acquisition module 220, a histogram calculation module 230, and a table generation module 240.
The gallery obtaining module 210 may be configured to obtain a gallery to be processed, where the gallery to be processed includes a predetermined number of preset images; the frame acquisition module 220 may be configured to acquire a reference frame for playing each of the preset images in the reference terminal, and acquire a target frame for playing each of the preset images in the target terminal; the histogram calculation module 230 may be configured to calculate a reference histogram based on each of the reference pictures and calculate a target histogram based on each of the target pictures; the table generating module 240 may be configured to obtain a color style migration table based on the reference histogram and the target histogram corresponding to each of the preset images, where the color style migration table is used for performing picture adjustment in the target terminal.
In some embodiments of the application, the table generation module is configured to: calculating an accumulated density function based on a target histogram corresponding to each preset image respectively to obtain target density data; calculating an accumulated density function based on a reference histogram corresponding to each preset image respectively to obtain reference density data; respectively performing migration and copy on each target density data to obtain a migration density table with a preset size; respectively calculating absolute differences between each column of the migration density table corresponding to each preset image and the reference density data to obtain a difference table with a preset size corresponding to each preset image; obtaining initial index mapping data corresponding to each preset image based on a row index and a column index corresponding to a preset element in a difference value table corresponding to each preset image; and obtaining a color style migration table based on the initial index mapping data corresponding to each preset image.
In some embodiments of the application, the table generation module is configured to: extracting a target number of preset images from the preset number of preset images to obtain a target number of test images; respectively applying initial index mapping data corresponding to each preset image to the target terminal, and acquiring a test picture of playing each test image in the target terminal; calculating a test histogram of each test picture under each initial index mapping data application; performing histogram cross kernel calculation processing on the two test histogram sets to obtain the histogram similarity between the test histogram sets, wherein each test histogram set comprises a test histogram under the application of the initial index mapping data; obtaining a candidate index mapping table based on the initial index mapping data corresponding to the test histogram set with the similarity meeting the preset condition; and obtaining the color style migration table based on the candidate index mapping table.
In some embodiments of the application, the table generation module is configured to: acquiring a screen display matrix of the target terminal, wherein the screen display matrix comprises factors which have influence on the color of a screen display picture in a machine core and a backlight; and obtaining the color style migration table based on the screen display matrix and the candidate index mapping table.
In some embodiments of the application, the predetermined element comprises a minimum value in each column, and the initial index map data comprises an index array; the table generation module is used for: acquiring a row index and a column index corresponding to a minimum value in each column of a difference table corresponding to each preset image, and acquiring an index set corresponding to each difference table; and respectively taking the column index in the index set as an array index and the row index as an array median for the index set corresponding to each difference table to obtain an index array corresponding to each preset image.
In some embodiments of the application, the initial index map data comprises an index array; the table generation module is used for: averaging the index arrays corresponding to the test histogram sets with the similarity meeting the preset condition to obtain an average index array; and taking the array index in the average index array as the original gray level and taking the array median corresponding to the array index as the target gray level to be regulated, so as to obtain the candidate index mapping table comprising the mapping relation between the original gray level and the corresponding target gray level.
In some embodiments of the application, the table generation module is configured to: calculating an inverse matrix corresponding to the screen display matrix; and obtaining the color style migration table based on the inverse matrix and the candidate index mapping table.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
In addition, the embodiment of the present application further provides an electronic device, which may be a terminal or a server, as shown in fig. 8, which shows a schematic structural diagram of the electronic device according to the embodiment of the present application, specifically:
the electronic device may include one or more processing cores 'processors 301, one or more computer-readable storage media's memory 302, power supply 303, and input unit 304, among other components. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 8 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
The processor 301 is the control center of the electronic device, connects the various parts of the overall computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 302, and invoking data stored in the memory 302, thereby performing overall monitoring of the electronic device. Optionally, processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user pages, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 301.
The memory 302 may be used to store software programs and modules, and the processor 301 executes various functional applications and data processing by executing the software programs and modules stored in the memory 302. The memory 302 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
The electronic device further comprises a power supply 303 for powering the various components, preferably the power supply 303 is logically connected to the processor 301 by a power management system, whereby the functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 303 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may further comprise an input unit 304, which input unit 304 may be used for receiving input digital or character information and for generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 301 in the electronic device loads executable files corresponding to the processes of one or more computer programs into the memory 302 according to the following instructions, and the processor 301 executes the computer programs stored in the memory 302, so as to implement the functions in the foregoing embodiments of the present application, for example, the processor 301 may perform the following steps:
Obtaining a to-be-processed gallery, wherein the to-be-processed gallery comprises a preset number of preset images; acquiring a reference picture of playing each preset image in a reference terminal, and acquiring a target picture of playing each preset image in a target terminal; calculating a reference histogram based on each of the reference pictures, and calculating a target histogram based on each of the target pictures; and obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image, wherein the color style migration table is used for picture adjustment in the target terminal.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of the various methods of the above embodiments may be performed by a computer program, or by computer program control related hardware, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application also provides a storage medium in which a computer program is stored, the computer program being capable of being loaded by a processor to perform the steps of any of the methods provided by the embodiments of the present application.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps of any one of the methods provided in the embodiments of the present application may be executed by the computer program stored in the storage medium, so that the beneficial effects that can be achieved by the methods provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It will be understood that the application is not limited to the embodiments which have been described above and shown in the drawings, but that various modifications and changes can be made without departing from the scope thereof.

Claims (10)

1. A picture adjustment method, comprising:
obtaining a to-be-processed gallery, wherein the to-be-processed gallery comprises a preset number of preset images;
acquiring a reference picture of playing each preset image in a reference terminal, and acquiring a target picture of playing each preset image in a target terminal;
Calculating a reference histogram based on each of the reference pictures, and calculating a target histogram based on each of the target pictures;
and obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image, wherein the color style migration table is used for picture adjustment in the target terminal.
2. The method according to claim 1, wherein the obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each of the preset images includes:
calculating an accumulated density function based on a target histogram corresponding to each preset image respectively to obtain target density data; calculating an accumulated density function based on a reference histogram corresponding to each preset image respectively to obtain reference density data;
respectively performing migration and copy on each target density data to obtain a migration density table with a preset size;
respectively calculating absolute differences between each column of the migration density table corresponding to each preset image and the reference density data to obtain a difference table with a preset size corresponding to each preset image;
obtaining initial index mapping data corresponding to each preset image based on a row index and a column index corresponding to a preset element in a difference value table corresponding to each preset image;
And obtaining a color style migration table based on the initial index mapping data corresponding to each preset image.
3. The method according to claim 2, wherein the obtaining a color style migration table based on the initial index mapping data corresponding to each of the preset images includes:
extracting a target number of preset images from the preset number of preset images to obtain a target number of test images;
respectively applying initial index mapping data corresponding to each preset image to the target terminal, and acquiring a test picture of playing each test image in the target terminal;
calculating a test histogram of each test picture under each initial index mapping data application;
performing histogram cross kernel calculation processing on the two test histogram sets to obtain the histogram similarity between the test histogram sets, wherein each test histogram set comprises a test histogram under the application of the initial index mapping data;
obtaining a candidate index mapping table based on the initial index mapping data corresponding to the test histogram set with the similarity meeting the preset condition;
and obtaining the color style migration table based on the candidate index mapping table.
4. The method of claim 3, wherein the deriving the color style migration table based on the candidate index map comprises:
acquiring a screen display matrix of the target terminal, wherein the screen display matrix comprises factors which have influence on the color of a screen display picture in a machine core and a backlight;
and obtaining the color style migration table based on the screen display matrix and the candidate index mapping table.
5. The method of claim 2, wherein the predetermined element comprises a minimum value in each column, and the initial index map data comprises an index array;
the obtaining initial index mapping data corresponding to each preset image based on the row index and the column index corresponding to the predetermined element in the difference value table corresponding to each preset image includes:
acquiring a row index and a column index corresponding to a minimum value in each column of a difference table corresponding to each preset image, and acquiring an index set corresponding to each difference table;
and respectively taking the column index in the index set as an array index and the row index as an array median for the index set corresponding to each difference table to obtain an index array corresponding to each preset image.
6. A method according to claim 3, wherein the initial index map data comprises an index array;
the obtaining the candidate index mapping table based on the initial index mapping data corresponding to the test histogram set with the similarity meeting the preset condition comprises the following steps:
averaging the index arrays corresponding to the test histogram sets with the similarity meeting the preset condition to obtain an average index array;
and taking the array index in the average index array as the original gray level and taking the array median corresponding to the array index as the target gray level to be regulated, so as to obtain the candidate index mapping table comprising the mapping relation between the original gray level and the corresponding target gray level.
7. The method of claim 4, wherein the obtaining the color style migration table based on the display matrix and the candidate index map comprises:
calculating an inverse matrix corresponding to the screen display matrix;
and obtaining the color style migration table based on the inverse matrix and the candidate index mapping table.
8. A picture adjustment apparatus, comprising:
the drawing library acquisition module is used for acquiring a drawing library to be processed, wherein the drawing library to be processed comprises a preset number of preset images;
The picture acquisition module is used for acquiring a reference picture of playing each preset image in the reference terminal and acquiring a target picture of playing each preset image in the target terminal;
a histogram calculation module for calculating a reference histogram based on each of the reference pictures and calculating a target histogram based on each of the target pictures;
the table generation module is used for obtaining a color style migration table based on the reference histogram and the target histogram corresponding to each preset image, and the color style migration table is used for picture adjustment in the target terminal.
9. A storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the method of any of claims 1 to 7.
10. An electronic device, comprising: a memory storing a computer program; a processor reading a computer program stored in a memory to perform the method of any one of claims 1 to 7.
CN202211600535.3A 2022-12-13 2022-12-13 Picture adjustment method and device, storage medium and electronic equipment Pending CN117119161A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211600535.3A CN117119161A (en) 2022-12-13 2022-12-13 Picture adjustment method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211600535.3A CN117119161A (en) 2022-12-13 2022-12-13 Picture adjustment method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117119161A true CN117119161A (en) 2023-11-24

Family

ID=88797190

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211600535.3A Pending CN117119161A (en) 2022-12-13 2022-12-13 Picture adjustment method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117119161A (en)

Similar Documents

Publication Publication Date Title
CN111031346B (en) Method and device for enhancing video image quality
WO2019011195A1 (en) Regulation method, terminal equipment and non-transitory computer-readable storage medium for automatic exposure control of region of interest
CN114374760A (en) Image testing method and device, computer equipment and computer readable storage medium
CN109584175A (en) A kind of image processing method and device
CN117173439A (en) Image processing method and device based on GPU, storage medium and electronic equipment
CN111917986A (en) Image processing method, medium thereof, and electronic device
CN114764821B (en) Moving object detection method, moving object detection device, electronic equipment and storage medium
CN117119161A (en) Picture adjustment method and device, storage medium and electronic equipment
CN115083355B (en) Display control method, electronic paper display device, electronic apparatus, and readable storage medium
CN109672829A (en) Method of adjustment, device, storage medium and the terminal of brightness of image
CN114418848B (en) Video processing method and device, storage medium and electronic equipment
CN115797267A (en) Image quality evaluation method, system, electronic device, and storage medium
CN112416709B (en) Chip dynamic power consumption estimation method and device, processor chip and server
CN113361602B (en) Training method and device for neural network model and electronic equipment
CN117541497A (en) Image processing method, device, storage medium and electronic equipment
CN114374798A (en) Scene recognition method and device, electronic equipment and computer-readable storage medium
CN117082358A (en) Monitoring picture adjusting method and device, storage medium and electronic equipment
CN117412014A (en) Color temperature adjusting method and device, storage medium and electronic equipment
CN115188311A (en) Display panel picture compensation method and device, electronic equipment and storage medium
CN117412135A (en) Channel recommendation method and device, storage medium and electronic equipment
CN117492618A (en) Display processing method and device, storage medium and electronic equipment
CN114650444A (en) Display method, display device, storage medium and electronic equipment
CN117409220A (en) Skin color change detection method, device, electronic equipment and computer storage medium
CN114862741A (en) Image quality debugging method, device and system and electronic equipment
CN118096813A (en) Image processing method, device, storage medium and electronic equipment

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