LSC data detection method, device, terminal equipment and medium
By performing validity detection of the image channel data of lens shadow correction LSC data, the problem of inability to determine the validity of data in the prior art is solved, efficient and convenient data detection is achieved, and business processing efficiency is improved.
Patent Information
- Application Number
- CN202111217855.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-19
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-10-19
AI Technical Summary
The prior art cannot effectively determine the effectiveness of lens shading correction LSC data, resulting in waste of computing resources and reduced service processing efficiency.
By acquiring LSC data, image channel data (R channel data, Gr channel data, Gb channel data and B channel data) are parsed, and the validity of these data is detected to determine whether the preset valid detection conditions are met, and whether the data is determined. for valid data.
It realizes convenient and fast and effective detection of LSC data, improves detection efficiency and convenience, and solves the problems of wasted computing resources and reduced business processing efficiency.
Smart Images

Figure CN114051132B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, terminal equipment and medium for detecting lens shading correction (LSC) data. Background Art
[0002] Currently, camera module suppliers are required to burn lens shading correction (LSC) data into terminal platforms, such as the tool platform of Taiwan MediaTek (MTK), a multimedia chip provider, for subsequent image processing.
[0003] However, during the LSC data burning or transmission process, some image content is lost due to transmission stability or other special circumstances. Due to the limited image processing algorithm, image processing is currently supported for valid data of large-scale business, and it is impossible to determine whether it is invalid data.
[0004] However, if valid data and invalid data are not distinguished, and the same high-complexity calculations are performed on both invalid data and valid data, it will lead to a waste of computing resources and reduce business processing efficiency.
[0005] Therefore, it is urgent to propose a validity detection scheme for LSC data. Summary of the invention
[0006] The embodiment of the present application solves technical problems in the prior art such as waste of computing resources and reduction of business processing efficiency due to inability to determine the validity of LSC data by providing a method for detecting lens shading correction (LSC) data.
[0007] On the one hand, the present application provides a method for detecting lens shading correction (LSC) data through an embodiment of the present application, the method comprising:
[0008] Get LSC data;
[0009] Parsing the LSC data to obtain image channel data, wherein the image channel data includes R channel data, Gr channel data, Gb channel data and B channel data;
[0010] Perform validity check on the image channel data to determine whether the LSC data is valid data.
[0011] Optionally, performing validity detection on the image channel data to determine whether the LSC data is valid data includes:
[0012] Determining whether the image channel data meets a preset valid detection condition;
[0013] If yes, it is determined that the LSC data is valid data;
[0014] If not, determining that the LSC data is invalid data;
[0015] Among them, the effective detection conditions at least include: the edge processing data is less than a first threshold, and the internal processing data is less than a second threshold; the edge processing data is data obtained by processing the data located in a preset edge area in the image channel data, and the internal processing data is data obtained by processing the data in other areas of the image channel data except the preset edge area.
[0016] Optionally, the edge processing data is the maximum value of data in the image channel data located in a preset edge area, and the internal processing data is the maximum value of data in the image channel data located in other areas except the preset edge area.
[0017] Optionally, before determining whether the image channel data meets a preset valid detection condition, the method further includes:
[0018] Calculating an average value of the image channel data to obtain average channel data, wherein the image channel data and the average channel data have the same data dimension;
[0019] Calculating a difference value on the average channel data to obtain difference channel data, wherein the difference channel data and the average channel data have the same data dimension;
[0020] Performing maximum value calculation on the data located in the preset edge area in the difference channel data to obtain the edge processing data;
[0021] The maximum value of the data in the difference channel data located in other areas except the preset edge area is calculated to obtain the internal processing data.
[0022] Optionally, the effective detection condition further includes: a difference value between the Gr channel data and the Gb channel data is less than a third threshold.
[0023] Optionally, before determining whether the image channel data meets a preset valid detection condition, the method further includes:
[0024] Calculating the difference value of the Gr channel data and the Gb channel data to obtain difference image data;
[0025] The maximum value in the difference image data is determined as the difference value between the Gr channel data and the Gb channel data.
[0026] Optionally, the effective detection condition also includes: taking a preset central pixel point as a reference point in the image channel data, pixel values of pixels diffused around it increase in sequence.
[0027] On the other hand, the present application provides a device for detecting lens shading correction (LSC) data through an embodiment of the present application, the device comprising: an acquisition module, a parsing module and a detection module, wherein:
[0028] The acquisition module is used to acquire LSC data;
[0029] The analysis module is used to analyze the LSC data to obtain image channel data, wherein the image channel data includes R channel data, Gr channel data, Gb channel data and B channel data;
[0030] The detection module is used to perform validity detection on the image channel data to determine whether the LSC data is valid data.
[0031] For the contents not introduced or described in the embodiments of the present application, please refer to the relevant introduction in the aforementioned method embodiments, which will not be repeated here.
[0032] On the other hand, the present application provides a terminal device through an embodiment of the present application, and the terminal device includes: a processor, a memory, a communication interface and a bus; the processor, the memory and the communication interface are connected through the bus and complete mutual communication; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the lens shading correction LSC data detection method as described above.
[0033] On the other hand, the present application provides a computer-readable storage medium through an embodiment of the present application, wherein the computer-readable storage medium stores a program, and when the program is run on a terminal device, the method for detecting lens shading correction LSC data as described above is executed.
[0034] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: the present application obtains LSC data, then parses the LSC data to obtain image channel data, and finally performs validity detection on the image channel data to determine whether the LSC data is valid data. This can conveniently and quickly implement the validity detection of the LSC data, thereby improving the efficiency and convenience of the validity detection of the LSC data, and also solves the technical problems in the prior art such as waste of computing resources and reduced business processing efficiency due to the inability to determine the validity of the LSC data. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 It is a flowchart of a method for detecting lens shading correction (LSC) data provided in an embodiment of the present application.
[0037] Figure 2 It is a flowchart of another method for detecting lens shading correction (LSC) data provided in an embodiment of the present application.
[0038] Figure 3 It is a structural schematic diagram of a detection device for lens shading correction (LSC) data provided in an embodiment of the present application.
[0039] Figure 4 It is a structural diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The embodiment of the present application solves technical problems in the prior art such as waste of computing resources and reduced business processing efficiency caused by the inability to determine the validity of LSC data by providing a method for detecting lens shading correction (LSC) data.
[0041] The technical solution of the embodiment of the present application is to solve the above-mentioned technical problems, and the overall idea is as follows: obtain LSC data; parse the LSC data to obtain image channel data, wherein the image channel data includes R channel data, Gr channel data, Gb channel data and B channel data; perform validity detection on the image channel data to determine whether the LSC data is valid data.
[0042] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0043] First of all, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0044] See also Figure 1 , is a flow chart of a method for detecting lens shading correction (LSC) data provided by an embodiment of the present application. Figure 1The method shown includes the following implementation steps:
[0045] S101, obtaining LSC data.
[0046] The LSC data described in this application is the data burned into the terminal platform by the camera module supplier, such as the data in the MTK tool platform, which may include but is not limited to image channel data and image platform data. Among them, the image channel data includes but is not limited to red (Red) channel data, also known as R channel data, green-red (Green-red) Gr channel data, also known as Gr channel data, green-blue (Green-blue) channel data, also known as Gb channel data and blue (Blue) channel data, also known as B channel data. The image platform data includes but is not limited to the version information of the terminal platform, the chip information included in the terminal platform, such as the version of the MTK platform, the chip information in the MTK platform, such as the power management chip, the radio frequency chip and the baseband chip, etc.
[0047] S102, parsing the LSC data to obtain image channel data, where the image channel data includes R channel data, Gr channel data, Gb channel data, and B channel data.
[0048] The present application can parse the LSC data to obtain image channel data and image platform data. The data length of the image channel data and the image platform data is not limited, and can be set according to actual needs. For example, the image channel data and the image platform data occupy a total of 1868 data lengths. The image platform data can also be called header information, which includes 68 data, such as the version of the MTK platform, etc. The image channel data includes 450 R channel data, 450 Gr channel data, 450 Gb channel data, and 450 B channel data.
[0049] It should be noted that when burning LSC data, the image screen will be divided into areas of fixed size A×B for burning test, for example, divided into areas of 15×15. Correspondingly, the size / data dimension of the image channel data obtained by the analysis of this application is A×B. Taking the 15×15 area division as an example, this application can parse the LSC data and parse and arrange it according to the header information, R channel data, Gr channel data, Gb channel data and B channel number, wherein the R channel data, the Gr channel data, the Gb channel data and the B channel data are expanded and arranged into a 15×15 single-channel matrix.
[0050] S103: Perform validity detection on the image channel data to determine whether the LSC data is valid data.
[0051] The present application can determine / determine whether the LSC data is valid data by judging whether the image channel data meets the preset valid detection conditions. Specifically, if the image channel data meets the valid detection conditions, the LSC data can be determined to be valid data, and the image channel data in the LSC data can be subsequently subjected to image processing such as coloring and rendering. Conversely, if the image channel data does not meet the valid detection conditions, the LSC data can be determined to be invalid data, and the process can be terminated.
[0052] The effective detection conditions are customized by the system, for example, they may at least include edge processing data being less than a first threshold and internal processing data being less than a second threshold; optionally, they may also include but are not limited to any one or more of the following combinations: the difference between the Gr channel data and the Gb channel data is less than a third threshold, and the image channel data satisfies the variation rule of being large around and small in the center (i.e., in the image channel data, the preset center pixel point is used as the reference point, and the pixel values of the pixels diffused around are increased successively).
[0053] The edge processing data is data obtained by processing the data in the preset edge region of the image channel data, that is, data obtained by processing the edge channel data in the image channel data by methods such as maximum value, average value, etc. The internal processing data is data obtained by processing the data in other regions of the image channel data except the preset edge region, that is, data obtained by processing the internal channel data in the image channel data except the edge channel data by methods such as maximum value, average value, etc.
[0054] Optionally, the edge processing data may be the maximum value of the data in the image channel data located in a preset edge area, that is, the maximum value of the edge channel data; the internal processing data may be the maximum value of the data in the image channel data located in other areas except the preset edge area, that is, the maximum value of the internal channel data, etc., which is not limited in this application. The preset edge area is an area customized by the system. The first threshold, the second threshold and the third threshold are customized by the system or the user, such as an experience value set according to user experience or a threshold set according to actual system needs.
[0055] By implementing the present application, the present application obtains LSC data, then parses the LSC data to obtain image channel data, and finally performs validity detection on the image channel data to determine whether the LSC data is valid data. This can conveniently and quickly realize the validity detection of LSC data, thereby improving the efficiency and convenience of LSC data validity detection, and also solves the technical problems in the prior art such as waste of computing resources and reduced business processing efficiency due to the inability to determine the validity of LSC data.
[0056] Please also see Figure 2 , is a flow chart of another method for detecting lens shading correction (LSC) data provided by an embodiment of the present application. Figure 2 The method shown includes the following implementation steps:
[0057] S201, obtaining LSC data.
[0058] S202, parsing the LSC data to obtain image channel data, where the image channel data includes R channel data, Gr channel data, Gb channel data, and B channel data.
[0059] The present application may perform validity detection on each image channel data, specifically on R channel data, Gr channel data, Gb channel data and B channel data, and the specific implementation method thereof is described in the following steps S203 to S213.
[0060] S203, calculating an average value of the image channel data to obtain average channel data, wherein the image channel data and the average channel data have the same data dimension.
[0061] The present application may use a preset frame to perform sliding average calculation on the image channel data to obtain corresponding average channel data, and the image channel data and the average channel data have the same data dimension, for example, a matrix of dimensions A×B. The size of the preset frame may be set according to the actual needs of the system, and the present application does not limit it.
[0062] For example, taking the image channel data as R channel data, it can be represented as a 15×15 single channel matrix as shown in Table 1 below.
[0063] Table 1
[0064]
[0065] As shown in Table 1 above, the present application can select preset frames of appropriate sizes according to the positions of the image channel data to calculate the average value of the corresponding image channel data. For example, in the figure, the average value of the R channel data in the 8th column is calculated according to the preset frame of 2×1, the average value of the R channel data in the 8th row is calculated according to the preset frame of 1×2, and the average value of the R channel data in the remaining rows / columns is calculated according to the preset frame of 2×2. Specifically, as shown in the black box in Table 1 above, the average value of 14587 and 13123 is used as the result data of the 1st row and 8th column, the average value of 19644 and 16591 is used as the result data of the 8th row and 1st column, and the average value of 31081, 24684, 27259 and 22144 is used as the result data of the 1st row and 1st column for the R channel data of the remaining rows / columns. In principle, the average channel data of size 15×15 can be calculated in this way.
[0066] S204 , calculating a difference value of the average channel data to obtain difference channel data, wherein the difference channel data and the average channel data have the same data dimension.
[0067] The present application may use the following formula (1) to calculate the difference value of the average channel data to obtain difference channel data having the same data dimension as the average channel data, such as a matrix with dimensions A×B.
[0068]
[0069] Among them, C mn is the data in the mth row and nth column of the difference channel data, i mn is the data in the mth row and nth column of the average channel data, the dimension of the average channel data is A×B, i (A+1-m)n is the data of the (A+1-m)th row and the nth column in the average channel data, i m(B+1-n) is the data in the mth row and (B+1-n)th column of the average channel data, i (A+1-m)(B+1-n) is the data in the (A+1-m)th row and the (B+1-n)th column in the average channel data, m is a positive integer less than or equal to A, n is a positive integer less than or equal to B, and || is an absolute value ABS operation.
[0070] For example, taking the R channel matrix of the average channel data of 15×15 as an example, it can be specifically expressed as shown in the following Table 2.
[0071] Table 2
[0072]
[0073] When calculating the difference channel data, C 11 For example, this application can use the following formula (2) to calculate C11 .
[0074]
[0075] From Table 2 above, we can see that 11 is 26292, i 15,1 is 26731, i 1,15 is 26537, i 15,15 It is 27157, specifically as shown in the black box in Table 2. According to the principle, the present application can calculate and obtain the difference channel data shown in Table 3 below.
[0076] Table 3
[0077]
[0078] S205 , performing maximum value calculation on the data located in the preset edge area in the difference channel data to obtain the edge processed data.
[0079] The preset edge area described in the present application is an edge area customized by the system or user, for example, the data located in the 1st row, 1st column, 15th row and 15th column in the difference channel data shown in Table 3 above is set as data located in the preset edge area, etc.
[0080] The present application can process the data in the difference channel data located in the preset edge area, such as maximum value processing, average value processing, mode selection processing, etc. to obtain the edge processing data. Preferably, the edge processing data is obtained by performing maximum value calculation / selection on the data in the edge area. For example, taking the difference channel data shown in Table 3 above as an example, the preset edge area is the area where the data in the difference channel data is located in the 1st row, 1st column, 15th row and 15th column. At this time, the present application can use the following formula (3) to calculate and obtain the edge processing data.
[0081] Edge processing data = max(C 1行 ,C 1列 ,C 15行 ,C 15列 ) Formula (3)
[0082] The above formula (3) indicates that the maximum value of the data located at the 1st row, the 1st column, the 15th row and the 15th column in the difference channel data is selected and determined as the edge processing data.
[0083] S206 , performing maximum value calculation on the data in the difference channel data located in other areas except the preset edge area to obtain the internal processing data.
[0084] In the present application, the other regions in the difference channel data except the preset edge region may be referred to as internal regions, and the data in the internal region may be referred to as internal region data. Furthermore, the present application may perform maximum value calculation / selection on the internal region data to obtain the internal processing data.
[0085] For example, referring to the example of step S205, the present application may use the following formula (4) to calculate and obtain the internal processing data:
[0086] max{divided by (C 1行 ,C 1列 ,C 15行 ,C 15列 ) row data and column data outside the formula (4)
[0087] S207: Determine whether the edge-processed data is less than a first threshold, and whether the internal-processed data is less than a second threshold.
[0088] After calculating and obtaining the edge processing data and the internal processing data, the present application can further determine whether the edge processing data is less than a first threshold value and whether the internal processing data is less than a second threshold value. If the edge processing data is less than the first threshold value and the internal processing data is less than the second threshold value, continue to execute step S208 or execute step S212; otherwise, execute step S213 and end the process.
[0089] The first threshold and the second threshold are thresholds customized by the system, and they may be the same or different, and this application does not limit them. For example, the first threshold is 10% of the preset maximum threshold, the second threshold is 5% of the preset maximum threshold, and so on.
[0090] S208 , calculating a difference value between the Gr channel data and the Gb channel data to obtain difference image data.
[0091] The present application may use the following formula (5) to calculate the difference between the Gr channel data and the Gb channel data, namely the difference image data. The difference image data has the same data dimension as the Gr channel data and the Gb channel data, for example, the data dimension is A×B.
[0092]
[0093] Among them, H mn Gr is the data of the mth row and nth column in the difference image data. mn Gb is the data in the mth row and nth column of the Gr channel data. mnis the data in the mth row and nth column of the Gb channel data. m is a positive integer less than or equal to A, and n is a positive integer less than or equal to B. Min() is a minimum value operation. || is an absolute value ABS operation.
[0094] S209: Determine the maximum value in the difference image data as the difference value between the Gr channel data and the Gb channel data.
[0095] The present application may determine the difference value between the Gr channel data and the Gb channel data according to the difference image data, for example, selecting the maximum value, average value, or mode in the difference image data as the difference value between the Gr channel data and the Gb channel data. Preferably, the present application may determine the maximum value in the difference image data as the difference value between the Gr channel data and the Gb channel data.
[0096] S210: Determine whether the difference between the Gr channel data and the Gb channel data is less than a third threshold.
[0097] After calculating and obtaining the difference value, the present application can further determine whether the difference value between the Gr channel data and the Gb channel data is less than a third threshold value. If it is less than the third threshold value, continue to execute step S211 or continue to execute step S212, otherwise execute step S213 and end the process.
[0098] The third threshold is a threshold set by the system, such as an experience value set according to user experience, or a threshold set according to actual system requirements, etc. For example, the third threshold can be set to 5% of the preset maximum difference value, etc.
[0099] S211, determining whether the image channel data satisfies a rule that the pixel values of the pixels diffused around the preset central pixel point are increased in sequence.
[0100] The present application can further determine the regularity of changes in the image data channel, such as whether it satisfies the change rule of "large around and small in the center". Specifically, the present application can determine whether the image channel data satisfies the rule that the pixel values of the pixels diffused around the preset center pixel point are increased in sequence. If so, continue to execute step S212, otherwise execute step S213 and end the process. For example, the present application can use the following formula (6) to determine whether the image data channel satisfies the rule that the pixel values of the pixels diffused around the preset center pixel point are increased in sequence.
[0101]
[0102] Among them, X mnis the data of the mth row and nth column in the image channel data. m(n-1) is the data of the mth row and (n-1th column in the image channel data. m(n+1) is the data of the mth row and (n+1)th column in the image channel data. (m-1)n is the data of the (m-1)th row and nth column in the image channel data. (m+1)n is the data of the (m+1)th row and nth column in the image channel data, where m is less than or equal to A positive integer, n is less than or equal to A positive integer, where This is a round-up operation.
[0103] For example, the image channel data shown in Table 1 is taken as R channel data, and the preset center pixel point is the pixel point located at the preset center position in the image channel data, for example, the preset center pixel point in Table 1 is the pixel point at the 8th row and the 8th column. It can be judged from Table 1 that the R channel data satisfies the rule that the pixel values of the pixels diffused around the preset center pixel point are increased in sequence, that is, X 88 <X 87 <X 86 <X 85 <X 84 <X 83 <X 82 <X 81 , X 88 <X 89 <X 8,10 <X 8,11 <X 8,12 <X 8,13 <X 8,14 <X 8,15 (horizontal); X 88 <X 78 <X 68 <X 58 <X 48 <X 38 <X 28 <X 18 , X 88 <X 98 <X 10,8 <X 11,8 <X 12,8 <X 13,8 <X 14,8 <X 15,8 (vertical). Among them, X ij is the data in the i-th row and j-th column of the R channel data, where i and j are both positive integers not exceeding 9. For example, X 88 It is the data in the 8th row and 8th column of the R channel data, etc.
[0104] S212: Determine that the LSC data is valid data.
[0105] S213: Determine that the LSC data is invalid data.
[0106] It should be noted that the present application can also use charts to visualize the image channel data, the average channel data and the difference channel data, for example, the table corresponding to the image channel data is shown in Table 1 above, the table corresponding to the average channel data is shown in Table 2 above, the table corresponding to the difference channel data is shown in Table 3 above, and so on.
[0107] By implementing the present application, the present application obtains LSC data, then parses the LSC data to obtain image channel data, and finally performs validity detection on the image channel data to determine whether the LSC data is valid data. This can conveniently and quickly realize the validity detection of LSC data, thereby improving the efficiency and convenience of LSC data validity detection, and also solves the technical problems in the prior art such as waste of computing resources and reduced business processing efficiency due to the inability to determine the validity of LSC data.
[0108] Based on the same inventive concept, another embodiment of the present application provides a device and a terminal device corresponding to the method for detecting lens shading correction LSC data described in the embodiment of the present application.
[0109] See also Figure 3 , is a schematic diagram of the structure of a detection device for lens shading correction LSC data provided by an embodiment of the present application. Figure 3 The device 30 shown includes: an acquisition module 301, a parsing module 302 and a detection module 303, wherein:
[0110] The acquisition module 301 is used to acquire LSC data;
[0111] The analysis module 302 is used to analyze the LSC data to obtain image channel data, wherein the image channel data includes R channel data, Gr channel data, Gb channel data and B channel data;
[0112] The detection module 303 is used to perform validity detection on the image channel data to determine whether the LSC data is valid data.
[0113] Optionally, the detection module 303 is specifically used to:
[0114] Determining whether the image channel data meets a preset valid detection condition;
[0115] If yes, it is determined that the LSC data is valid data;
[0116] If not, determining that the LSC data is invalid data;
[0117] Among them, the effective detection conditions at least include: the edge processing data is less than a first threshold, and the internal processing data is less than a second threshold; the edge processing data is data obtained by processing the data located in a preset edge area in the image channel data, and the internal processing data is data obtained by processing the data in other areas of the image channel data except the preset edge area.
[0118] Optionally, the edge processing data is the maximum value of data in the image channel data located in a preset edge area, and the internal processing data is the maximum value of data in the image channel data located in other areas except the preset edge area.
[0119] Optionally, the device further includes a calculation module 304, and the calculation module 304 is used to:
[0120] Calculating an average value of the image channel data to obtain average channel data, wherein the image channel data and the average channel data have the same data dimension;
[0121] Calculating a difference value on the average channel data to obtain difference channel data, wherein the difference channel data and the average channel data have the same data dimension;
[0122] Performing maximum value calculation on the data located in the preset edge area in the difference channel data to obtain the edge processing data;
[0123] The maximum value of the data in the difference channel data located in other areas except the preset edge area is calculated to obtain the internal processing data.
[0124] Optionally, the effective detection condition further includes: a difference value between the Gr channel data and the Gb channel data is less than a third threshold.
[0125] Optionally, the calculation module 304 is further configured to:
[0126] Calculating the difference value of the Gr channel data and the Gb channel data to obtain difference image data;
[0127] The maximum value in the difference image data is determined as the difference value between the Gr channel data and the Gb channel data.
[0128] Optionally, the effective detection condition also includes: taking a preset central pixel point as a reference point in the image channel data, pixel values of pixels diffused around it increase in sequence.
[0129] Please refer to Figure 4, which is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. The terminal device 40 shown in Figure 4 includes: at least one processor 401, a communication interface 402, a user interface 403 and a memory 404. The processor 401, the communication interface 402, the user interface 403 and the memory 404 can be connected via a bus or other means. The embodiment of the present invention takes the connection via a bus 405 as an example. Among them,
[0130] The processor 401 may be a general-purpose processor, such as a central processing unit (CPU).
[0131] The communication interface 402 may be a wired interface (eg, an Ethernet interface) or a wireless interface (eg, a cellular network interface or a wireless LAN interface) for communicating with other terminals or websites. In the embodiment of the present invention, the communication interface 402 is specifically used to obtain LSC data, etc.
[0132] The user interface 403 may be a touch panel, including a touch screen and a touch screen, for detecting operation instructions on the touch panel, a physical button or a mouse, or a display screen for outputting and displaying images or data.
[0133] The memory 404 may include a volatile memory, such as a random access memory (RAM); the memory may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 404 may also include a combination of the above-mentioned types of memory. The memory 404 is used to store a set of program codes, and the processor 401 is used to call the program codes stored in the memory 404 to perform the following operations:
[0134] Get LSC data;
[0135] Parsing the LSC data to obtain image channel data, wherein the image channel data includes R channel data, Gr channel data, Gb channel data and B channel data;
[0136] Perform validity check on the image channel data to determine whether the LSC data is valid data.
[0137] Optionally, performing validity detection on the image channel data to determine whether the LSC data is valid data includes:
[0138] Determining whether the image channel data meets a preset valid detection condition;
[0139] If yes, it is determined that the LSC data is valid data;
[0140] If not, determining that the LSC data is invalid data;
[0141] Among them, the effective detection conditions at least include: the edge processing data is less than a first threshold, and the internal processing data is less than a second threshold; the edge processing data is data obtained by processing the data located in a preset edge area in the image channel data, and the internal processing data is data obtained by processing the data in other areas of the image channel data except the preset edge area.
[0142] Optionally, the edge processing data is the maximum value of data in the image channel data located in a preset edge area, and the internal processing data is the maximum value of data in the image channel data located in other areas except the preset edge area.
[0143] Optionally, before determining whether the image channel data meets a preset valid detection condition, the processor 401 is further configured to:
[0144] Calculating an average value of the image channel data to obtain average channel data, wherein the image channel data and the average channel data have the same data dimension;
[0145] Calculating a difference value on the average channel data to obtain difference channel data, wherein the difference channel data and the average channel data have the same data dimension;
[0146] Performing maximum value calculation on the data located in the preset edge area in the difference channel data to obtain the edge processing data;
[0147] The maximum value of the data in the difference channel data located in other areas except the preset edge area is calculated to obtain the internal processing data.
[0148] Optionally, the effective detection condition further includes: a difference value between the Gr channel data and the Gb channel data is less than a third threshold.
[0149] Optionally, before determining whether the image channel data meets a preset valid detection condition, the processor 401 is further configured to:
[0150] Calculating the difference value of the Gr channel data and the Gb channel data to obtain difference image data;
[0151] The maximum value in the difference image data is determined as the difference value between the Gr channel data and the Gb channel data.
[0152] Optionally, the effective detection condition also includes: taking a preset central pixel point as a reference point in the image channel data, pixel values of pixels diffused around it increase in sequence.
[0153] Since the terminal device introduced in this embodiment is a terminal device used to implement the detection method of lens shading correction LSC data in the embodiment of this application, based on the method introduced in the embodiment of this application, the technical personnel of this field can understand the specific implementation of the terminal device of this embodiment and its various variations, so how the terminal device implements the method in the embodiment of this application is not described in detail here. As long as the terminal device used by the technical personnel of this field to implement the information processing method in the embodiment of this application is within the scope of protection of this application.
[0154] The technical solution in the above-mentioned embodiment of the present application has at least the following technical effects or advantages: the present application obtains LSC data, then parses the LSC data to obtain image channel data, and finally performs validity detection on the image channel data to determine whether the LSC data is valid data. This can conveniently and quickly realize the validity detection of LSC data, thereby improving the efficiency and convenience of LSC data validity detection, and also solves the technical problems in the prior art such as waste of computing resources and reduced business processing efficiency due to the inability to determine the validity of LSC data.
[0155] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0156] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0157] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0158] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0159] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0160] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for detecting lens shading correction (LSC) data, characterized in that: The method comprises: Get LSC data; Parsing the LSC data to obtain image channel data, wherein the image channel data includes R channel data, Gr channel data, Gb channel data and B channel data; Performing validity detection on the image channel data to determine whether the LSC data is valid data includes: Determining whether the image channel data meets a preset valid detection condition; If yes, it is determined that the LSC data is valid data; If not, determining that the LSC data is invalid data; Among them, the effective detection conditions at least include: the edge processing data is less than a first threshold, and the internal processing data is less than a second threshold; the edge processing data is data obtained by processing the data located in a preset edge area in the image channel data, and the internal processing data is data obtained by processing the data in other areas of the image channel data except the preset edge area.
2. The method according to claim 1, characterized in that The edge processing data is the maximum value of data in the image channel data located in a preset edge area, and the internal processing data is the maximum value of data in the image channel data located in other areas except the preset edge area.
3. The method according to claim 1, characterized in that Before determining whether the image channel data meets a preset valid detection condition, the method further includes: Calculating an average value of the image channel data to obtain average channel data, wherein the image channel data and the average channel data have the same data dimension; Calculating a difference value on the average channel data to obtain difference channel data, wherein the difference channel data and the average channel data have the same data dimension; Performing maximum value calculation on the data located in the preset edge area in the difference channel data to obtain the edge processing data; The maximum value of the data in the difference channel data located in other areas except the preset edge area is calculated to obtain the internal processing data.
4. The method according to claim 1, characterized in that: The effective detection condition also includes: a difference value between the Gr channel data and the Gb channel data is less than a third threshold.
5. The method according to claim 4, characterized in that Before determining whether the image channel data meets a preset valid detection condition, the method further includes: Calculating the difference value of the Gr channel data and the Gb channel data to obtain difference image data; The maximum value in the difference image data is determined as the difference value between the Gr channel data and the Gb channel data.
6. The method according to claim 1, characterized in that The effective detection condition also includes: in the image channel data, the pixel values of the pixels diffused around the preset central pixel point as the reference point are increased in sequence.
7. A device for detecting lens shading correction (LSC) data, characterized in that: The device comprises: an acquisition module, an analysis module and a detection module, wherein: The acquisition module is used to acquire LSC data; The analysis module is used to analyze the LSC data to obtain image channel data, wherein the image channel data includes R channel data, Gr channel data, Gb channel data and B channel data; The detection module is used to perform validity detection on the image channel data to determine whether the LSC data is valid data; The detection module is specifically used for: Determining whether the image channel data meets a preset valid detection condition; If yes, it is determined that the LSC data is valid data; If not, determining that the LSC data is invalid data; Among them, the effective detection conditions at least include: the edge processing data is less than a first threshold, and the internal processing data is less than a second threshold; the edge processing data is data obtained by processing the data located in a preset edge area in the image channel data, and the internal processing data is data obtained by processing the data in other areas of the image channel data except the preset edge area.
8. A terminal device, characterized in that: The terminal device includes: a processor, a memory, a communication interface and a bus; the processor, the memory and the communication interface are connected through the bus and communicate with each other; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the lens shading correction (LSC) data detection method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is run on a terminal device, the method for detecting lens shading correction (LSC) data as described in any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Method for correcting color lens shadow of digital camera with adaptive light source
CN105933686A
LSC compensation method and device of fish-eye camera
CN106170065A