Image processing method and related products
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2022-06-14
- Publication Date
- 2026-06-19
Smart Images

Figure CN117274403B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to an image processing method and related products. Background Technology
[0002] In the process of image processing, some image processing algorithms may require a lot of repetitive calculations during the initialization process, resulting in low processing speed. Summary of the Invention
[0003] This application provides an image processing method and related products that can reduce the computational load of image processing algorithms and improve image processing speed.
[0004] A first aspect of this application provides an image processing method, wherein the method is applied by a digital signal processing chip to process digital images, the method comprising:
[0005] The algorithmic solution for each of the first batch of multiple calculation points is obtained through image processing algorithms; wherein, the calculation point is used to represent the corresponding position of the color group of the image pixel in the color mapping table;
[0006] Calculate the interpolation solution for one or more calculation points in the second batch between two adjacent calculation points in the first batch of multiple calculation points. The color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution or interpolation solution of the calculation point.
[0007] The digital image is processed at least in part based on the interpolation solution of one or more calculation points in the second batch.
[0008] Optionally, before obtaining the algorithmic solution for each of the first batch of multiple computation points using image processing algorithms, the method further includes:
[0009] The image processing algorithm needs to obtain the first batch of multiple calculation points for solving the algorithm. Two adjacent calculation points in the first batch of multiple calculation points include a first starting calculation point and a first target truncation calculation point. Among the calculation points between the first starting calculation point and the first calculation point, there are calculation points where the interpolation solution does not meet the interpolation requirements. The difference between the point number of the first target truncation calculation point and the point number of the first calculation point is 1. When the difference between the point number of the first target truncation calculation point and the point number of the first starting calculation point is equal to 1, no interpolation calculation is needed between the first target truncation calculation point and the first starting calculation point. When the difference between the point number of the first target truncation calculation point and the point number of the first starting calculation point is greater than or equal to an integer of 2, the interpolation solutions of the calculation points between the first starting calculation point and the first target truncation calculation point all meet the interpolation requirements.
[0010] Optionally, determining two adjacent calculation points among the first batch of multiple calculation points for which the image processing algorithm needs to obtain the algorithm solution includes:
[0011] Set the position number of the first starting calculation point to a, and set the position number of the first initial cutoff calculation point to b, ba = 2;
[0012] Calculate the interpolation solution for the calculation point between a and b;
[0013] If the interpolation solutions for the calculation points between a and b all meet the interpolation requirements, add 1 to b to obtain a new b, and then perform the calculation of the interpolation solutions for the calculation points between a and b.
[0014] If there is an interpolation solution for the calculated point between a and b that does not meet the interpolation requirements, the calculated point with point number b-1 is taken as the first target truncated calculated point.
[0015] Optionally, the interpolation requirement includes: the absolute value of the difference between the algorithm solution and the interpolation solution at the same calculation point is less than a first threshold.
[0016] Optionally, the calculation of the interpolation solution for one or more calculation points in a second batch located between two adjacent calculation points in the first batch of multiple calculation points includes:
[0017] Based on the parallel computing instruction set supported by the digital signal processing chip, the interpolation solution of one or more computing points in the second batch is calculated between two adjacent computing points in the first batch of multiple computing points.
[0018] Optionally, the image processing algorithm includes an image filtering algorithm, and before obtaining the algorithmic solution for each calculation point in the first batch of multiple calculation points through the image processing algorithm, the method further includes:
[0019] During the filtering process of the first image, the number of calculation points required by the image filtering algorithm is determined based on the value range of the pixels in the first image.
[0020] A second aspect of this application provides an image processing apparatus, wherein the apparatus is used by a digital signal processing chip to process digital images, the apparatus comprising:
[0021] The first calculation unit is used to obtain the algorithm solution for each calculation point in the first batch of multiple calculation points through an image processing algorithm; wherein, the calculation point is used to represent the corresponding position of the color group of the image pixel in the color mapping table, and the color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution;
[0022] The second calculation unit is used to calculate the interpolation solution of one or more calculation points in the second batch between two adjacent calculation points in the first batch of multiple calculation points;
[0023] An image processing unit is used to process the digital image based at least in part on the interpolation solution of one or more computation points in the second batch.
[0024] A third aspect of the embodiments of this application provides a terminal device, including a digital signal processing chip and a main processing chip;
[0025] The digital signal processing chip is used to process digital images according to a color mapping table, obtain image processing results, and transmit the image processing results to the main processing chip; the color mapping table is used to represent the correspondence between the position of the color group of image pixels and the algorithm solution or interpolation solution of the calculation point, and the calculation point is used to represent the corresponding position of the color group in the color mapping table;
[0026] The main processing chip is used to perform image post-processing based on the image processing results.
[0027] A fourth aspect of this application provides a digital signal processing chip, including a processor and a memory. The memory is used to store a computer program, the computer program including program instructions, and the processor is configured to call the program instructions to execute the step instructions as described in the first aspect of this application.
[0028] A fifth aspect of this application provides a chip, including a processor, the processor being configured to:
[0029] Acquire digital images;
[0030] The algorithmic solution for each of the first batch of multiple calculation points is obtained through image processing algorithms; wherein, the calculation point is used to represent the corresponding position of the color group of the image pixel in the color mapping table;
[0031] Calculate the interpolation solution for one or more calculation points in the second batch between two adjacent calculation points in the first batch of multiple calculation points. The color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution or interpolation solution of the calculation point.
[0032] The digital image is processed at least in part based on the interpolation solution of one or more calculation points in the second batch.
[0033] A sixth aspect of this application provides a computer-readable storage medium storing a computer program for electronic data interchange, the computer program including program instructions that, when executed by a processor, cause the processor to perform the step instructions as described in the first aspect of this application.
[0034] A seventh aspect of this application provides a computer program product, wherein the computer program product includes a computer program, the computer program including program instructions, and the program instructions, when executed by a processor, cause the processor to perform the step instructions as described in the first aspect of this application.
[0035] In this embodiment, a digital signal processing chip obtains the algorithmic solution for each of the first batch of multiple computational points using an image processing algorithm. The computational points represent the corresponding positions of color groups of image pixels in a color mapping table. An interpolation solution is calculated for one or more second batches of computational points located between two adjacent computational points in the first batch. The color mapping table represents the correspondence between the positions of the color groups and the algorithmic or interpolation solutions of the computational points. The digital image is processed at least partially based on the interpolation solutions of the second batch of one or more computational points. The image processing method of this embodiment processes digital images at least partially based on the interpolation solutions of the second batch of one or more computational points. Since the computational cost of calculating the interpolation solution is less than that of calculating the algorithmic solution, the computational cost of the image processing algorithm can be reduced, thereby increasing the image processing speed. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a schematic diagram of the system architecture of a terminal device provided in an embodiment of this application;
[0038] Figure 2 This is a schematic flowchart of an image processing method provided in an embodiment of this application;
[0039] Figure 3 This is a schematic flowchart of another image processing method provided in an embodiment of this application;
[0040] Figure 4 This is a schematic diagram illustrating the changing trend of the original function of an image filtering algorithm provided in an embodiment of this application;
[0041] Figure 5 This is a schematic diagram illustrating how an iterative method is used to determine precise calculation points, as provided in an embodiment of this application.
[0042] Figure 6 This is a schematic diagram illustrating interpolation calculation using SIMD instructions, provided in an embodiment of this application.
[0043] Figure 7 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application;
[0044] Figure 8 This is a schematic diagram of the structure of a digital signal processing chip provided in an embodiment of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0047] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
[0048] The terminal devices involved in the embodiments of this application are terminals with image processing capabilities. These can be mobile phones, tablets, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), on-board units (OBUs), wearable devices (e.g., watches, bracelets, smart helmets), smart home devices (rice cookers, speakers, home management devices, etc.), augmented reality (AR) / virtual reality (VR) devices, etc.
[0049] To facilitate understanding of the embodiments of this application, a system architecture for a terminal device is first provided. Please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic diagram of the system architecture of a terminal device provided in an embodiment of this application. The system architecture may include: a digital signal processing chip 101 and a main processing chip 102.
[0050] The digital signal processing chip 101 is used to process digital images according to a color mapping table, obtain image processing results, and transmit the image processing results to the main processing chip; the color mapping table is used to represent the correspondence between the position of the color group of image pixels and the algorithm solution or interpolation solution of the calculation point, and the calculation point is used to represent the corresponding position of the color group in the color mapping table;
[0051] The main processing chip 102 is used to perform image post-processing based on the image processing results.
[0052] The digital signal processing chip 101 can be a digital signal processor (DSP) chip. The main processing chip 102 can be a central processing unit (CPU).
[0053] In this embodiment, during the processing of image information by the terminal device, when encountering tasks such as audio signal processing, voice processing, and noise reduction, the main processing chip 102 (e.g., CPU) will distribute these tasks to the digital signal processing chip 101 (e.g., DSP), i.e., load balancing. By transferring these tasks, the main processing chip 102 releases some workloads and gains additional processing power. The main processing chip 102 and the digital signal processing chip 101 can simultaneously execute different tasks, significantly improving operating efficiency. The digital signal processing chip 101 excels at processing tasks with low power consumption, utilizing hardware multithreading technology and maximizing the work completed per clock cycle to operate at low clock frequencies while providing high performance.
[0054] Image post-processing can include image stabilization, image blurring, and other processing.
[0055] The computational cost of calculating the interpolation solution is less than that of calculating the algorithmic solution. For example, if the algorithmic solution for calculating a point involves operations such as power functions or square roots, the computational cost of the algorithmic solution for that point is much greater than that of the interpolation solution for that point.
[0056] The image processing method of this application embodiment uses a color map table to represent the correspondence between the position of the color group of image pixels and the algorithm solution or interpolation solution of the calculation point. When processing digital images according to the color map table, the digital images can be processed at least partially based on the interpolation solution of one or more calculation points. Since the computational amount of calculating the interpolation solution is less than the computational amount of calculating the algorithm solution, the computational amount of the image processing algorithm can be reduced, the image processing speed can be improved, and thus the effect of accelerating image processing can be achieved.
[0057] Please see Figure 2 , Figure 2 This is a schematic flowchart of an image processing method provided in an embodiment of this application. Figure 2 As shown, the method may include the following steps.
[0058] 201. The digital signal processing chip obtains the algorithm solution for each of the first batch of multiple calculation points through image processing algorithms. The calculation points are used to represent the corresponding positions of the color groups of image pixels in the color mapping table.
[0059] In this embodiment, a digital signal processing chip can be used to process digital images. Image processing algorithms are required during digital image processing. These algorithms can be computationally intensive (e.g., requiring a large number of calculation points or repeated calculations) while allowing for a certain margin of error. For example, they can be algorithms that require table lookup calculations. Specifically, they can be any of the following algorithms: algorithms used in the initialization process of image filtering algorithms, algorithms for establishing color mapping tables in 3D LUT color correction (3D lookup table), and algorithms for establishing a mapping function between the gaze point fluctuation speed and the actual display point speed in eye-tracking anti-shake.
[0060] 1. The algorithm used in the initialization process of the image filtering algorithm.
[0061] When a camera on a terminal device captures portraits or other still scenes, a blurring operation is required. This blurring operation relies on the image's depth map information (the depth map is captured by the camera, and each pixel value represents the distance from the object to the camera's xy plane, in mm). The depth map processing involves initialization, requiring the use of a digital signal processing chip to accelerate the algorithm's processing speed.
[0062] During the depth map generation process, there is an initialization process for the image filtering algorithm. This process requires initializing a set of vector tables of length n according to the parameters. Each set of data in the table is as follows:
[0063]
[0064] Here, b is a constant, determined each time the image is output, and n is related to the image size. Since the function f(i) needs to be calculated repeatedly when initializing the vector, the computational efficiency is low. However, the generation of the depth map requires higher efficiency, so it is necessary to improve the running efficiency of this part. When repeatedly calculating the function f(i), the image processing method of this application embodiment can be used to speed up the calculation.
[0065] 2. Algorithm for creating a color mapping table in 3D LUT color adjustment (3D lookup table).
[0066] 3D LUT color grading requires establishing a color mapping table to readjust the image's tone. During post-processing, colors in the image are replaced using preset values, such as red to white and white to green. However, this is complex in practice due to the large number of colors. Manually replacing each color one by one would be inefficient. Therefore, it is recommended to use an interpolation algorithm to approximate this effect. Often, due to differences in the images themselves, the corresponding mapping tables are not entirely consistent (e.g., depending on the actual shooting scene). Therefore, when the scene is fixed, the mapping table needs to be initialized before using interpolation for 3D LUT color grading. During the initialization of the mapping table, the image processing method described in this application can be used to accelerate the calculation speed.
[0067] 3. An algorithm for establishing a mapping function between the gaze point fluctuation speed and the actual display point speed in eye-tracking anti-shake.
[0068] When eye tracking on a terminal device displays the current gaze point position in real time, certain algorithmic recognition errors exist, causing fluctuations in the displayed gaze point position. Therefore, a filtering algorithm is needed to smooth the current display point position. This can be achieved by establishing a mapping function between the gaze point fluctuation speed and the actual display point speed. Since the real-time computation of the filtering algorithm function is relatively time-consuming, the mapping function is often transformed into a lookup table after recognition begins. The lookup table is calculated during initialization, and the lookup table is used again when updating the display point position to improve operational efficiency. During the initialization of the lookup table for the mapping function, the image processing method of this application embodiment can be used to accelerate the calculation speed.
[0069] The first batch of multiple computation points can be predetermined. These first batch of multiple computation points are the computation points for which the algorithm solution needs to be calculated. The digital signal processing chip can obtain the algorithm solution for each computation point in the first batch of multiple computation points according to the image processing algorithm. For example, taking the algorithm used in the initialization process of the above image filtering algorithm as an example, during the initialization process, it is necessary to repeatedly calculate the function f(i), and the total number of computation points (all required computation points) n is the same each time. It should be noted that the value of n can be the same or different for different images. If the value of n is large, the computational load required to calculate the n algorithm solutions of the function f(i) once is large. In the embodiments of this application, a portion of the computation points (the first batch of multiple computation points) can be selected from n to obtain the algorithm solution, and another portion of the computation points (one or more in the second batch) can be used to obtain the interpolation solution.
[0070] In this embodiment, the digital signal processing chip can determine the first batch of multiple calculation points for which the image processing algorithm needs to obtain an algorithmic solution based on the accuracy requirements of the image processing algorithm. The image processing algorithm then obtains the algorithmic solution for each of these first batch of multiple calculation points. Since the value of n is fixed, the higher the accuracy requirement, the larger the number of calculation points for which an algorithmic solution needs to be obtained, and the smaller the number of calculation points for which an interpolation solution needs to be obtained. The accuracy requirement can be preset as needed. For example, the accuracy requirement of the image processing algorithm may include: the absolute value of the difference between the algorithmic solution and the interpolation solution at the same calculation point is less than a first threshold.
[0071] Optionally, before performing step 201, the following steps may also be included:
[0072] The digital signal processing chip determines the first batch of multiple calculation points required to obtain the algorithm solution for the image processing algorithm. Two adjacent calculation points in the first batch of multiple calculation points include: a first starting calculation point and a first target truncation calculation point. Among the calculation points between the first starting calculation point and the first calculation point, there are calculation points where the interpolation solution does not meet the interpolation requirements. The difference between the point number of the first target truncation calculation point and the point number of the first calculation point is 1. When the difference between the point number of the first target truncation calculation point and the point number of the first starting calculation point is equal to 1, no interpolation calculation is needed between the first target truncation calculation point and the first starting calculation point. When the difference between the point number of the first target truncation calculation point and the point number of the first starting calculation point is greater than or equal to an integer of 2, the interpolation solutions of the calculation points between the first starting calculation point and the first target truncation calculation point all meet the interpolation requirements.
[0073] In this embodiment, the digital signal processing chip can first determine two adjacent computation points from the first batch of multiple computation points required for the image processing algorithm to obtain the algorithm solution. Generally, the smaller the difference between the indexes of two adjacent computation points in the first batch of multiple computation points, the better the interpolation solution of all computation points between these two computation points meets the interpolation requirements. To obtain the algorithm solution using as few computation points as possible, two adjacent computation points with the largest possible difference in indexes can be determined, thereby requiring as few computation points as possible to obtain the algorithm solution, further reducing the computational load and improving the image processing speed.
[0074] The difference between calculation points refers to the difference between the point numbers. For example, if 10,000 calculation points need to be calculated, the point numbers of these 10,000 calculation points can be numbered from 1 to 10,000.
[0075] For example, if the point numbers of two adjacent calculation points in the first batch of multiple calculation points are calculation point 100 and calculation point 110 respectively, then the interpolation solutions of all calculation points between calculation point 100 and calculation point 110 meet the interpolation requirements, but there are calculation points that do not meet the interpolation requirements in the interpolation solutions of all calculation points between calculation point 100 and calculation point 111.
[0076] Optionally, the digital signal processing chip determines the first batch of multiple calculation points for which the image processing algorithm needs to obtain the algorithm solution, including:
[0077] (11) Set the position number of the first starting calculation point to a, and set the position number of the first initial cutoff calculation point to b, ba = 2;
[0078] (12) Calculate the interpolation solution for the calculation points between a and b;
[0079] (13) If the interpolation solution of the calculation point between a and b meets the interpolation requirements, add 1 to b to get a new b, and perform the calculation of the interpolation solution of the calculation point between a and b.
[0080] (14) If there is a calculation point in the interpolation solution between a and b that does not meet the interpolation requirements, the calculation point with the point number b-1 shall be used as the first target truncated calculation point.
[0081] In this embodiment of the application, the point numbers of the calculation points can be numbered from 1 to n. For example, calculation point 1 is first set as the point number of the first starting calculation point a (a=1). Once the first starting calculation point a is fixed, it will not change in the subsequent step of determining the first target truncation calculation point. Then, calculation point 3 is used as the first initial truncation calculation point number b (b=3). Based on the algorithmic solutions for calculation point a (a=1) and calculation point b (b=3), the interpolation solutions for all calculation points between calculation point a and calculation point b are calculated: the interpolation solution for calculation point 2. If the interpolation solution for calculation point 2 does not meet the interpolation requirements, calculation point 1 and calculation point 2 are designated as two adjacent calculation points (in this case, interpolation cannot occur between calculation point 1 and calculation point 2). If the interpolation solution for calculation point 2 meets the interpolation requirements, b+1 is used as the new b (new b=4). Based on the algorithmic solutions for calculation point a (a=1) and calculation point b (b=4), the interpolation solution for calculation point 2 is calculated. Interpolation solutions for all calculation points between calculation point a and calculation point b: interpolation solutions for calculation point 2 and calculation point 3. If there is an interpolation solution that does not meet the interpolation requirements in the interpolation solutions for calculation point 2 and calculation point 3, then calculation point 1 and calculation point 3 are considered as two adjacent calculation points. If the interpolation solutions for calculation point 2 and calculation point 3 both meet the interpolation requirements, then b+1 is taken as the new b (new b=5). Based on the algorithmic solutions for calculation point a (a=1) and calculation point b (b=5), the interpolation solutions for all calculation points between calculation point a and calculation point b are calculated as follows: interpolation solutions for calculation point 2, calculation point 3, and calculation point 4. This process continues until two adjacent computation points are found that satisfy the following conditions: all interpolation solutions between the two adjacent computation points meet the interpolation requirements; when the number of the computation point with the larger number among the two adjacent computation points increases by 1, all interpolation solutions between the two adjacent computation points meet the interpolation requirements, but there are computation points that do not meet the interpolation requirements. For example, taking computation point 100 as the starting point, if all interpolation solutions between computation points 100 and 110 meet the interpolation requirements, and there are computation points that do not meet the interpolation requirements among all interpolation solutions between computation points 100 and 111, then computation points 100 and 110 are considered adjacent computation points. Then, computation point 110 is taken as the next starting computation point, and the process continues to find the next computation point adjacent to computation point 110 using the above method.
[0082] If steps (11) to (14) above are executed for the first time, then the first starting calculation point a is calculation point 1. If steps (11) to (14) above are not executed for the first time, then the first target truncation calculation point determined in the previous execution of steps (11) to (14) is taken as the first starting calculation point a of the current execution of steps (11) to (14).
[0083] For example, first set calculation point 1 as the first starting calculation point a. If the first target cutoff calculation point is determined as calculation point 5 according to the above steps (11) to (14), then set calculation point 5 as the next first starting calculation point a. Then, determine the next first target cutoff calculation point according to the above steps (11) to (14), and so on, until all calculation points are found.
[0084] In this embodiment, two adjacent calculation points with the largest possible difference can be determined by cyclically increasing the initial truncation calculation points. This allows for obtaining the algorithm solution using as few calculation points as possible, thereby further reducing the computational load and improving image processing speed.
[0085] Optionally, the interpolation requirement includes: the absolute value of the difference between the algorithm solution and the interpolation solution at the same calculation point is less than a first threshold.
[0086] In this embodiment, to ensure the effectiveness of the interpolation calculation, the absolute value of the difference between the algorithm solution and the interpolation solution needs to be less than a first threshold. The first threshold can be determined according to the needs of the algorithm. For example, an initial first threshold can be set, and the difference between the final image result and the original result (without interpolation calculation) can be considered. If the difference is within the error range, it is considered appropriate.
[0087] The first threshold can be preset and stored in the memory (non-volatile memory) of the digital signal processing chip. The absolute value of the difference between the interpolation solution and the algorithm solution at each interpolation calculation point must be less than the first threshold.
[0088] The interpolation requirement in this application embodiment is that the absolute value of the difference between the algorithm solution and the interpolation solution at the same calculation point is less than a first threshold, which can improve the reliability of the interpolation result at the calculation point and ensure the effect of the interpolation calculation.
[0089] 202. The digital signal processing chip calculates the interpolation solution of one or more calculation points in the second batch between two adjacent calculation points in the first batch of multiple calculation points. The color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution or interpolation solution of the calculation point.
[0090] In this embodiment, linear interpolation can be used to calculate the interpolation solution for one or more calculation points in a second batch between two adjacent calculation points in the first batch of multiple calculation points. Since linear interpolation does not involve calculations such as power functions and square roots in the process of calculating the algorithm solution, it can greatly improve operating efficiency.
[0091] The color group can include either the RGB color group or the YUV color group. The color mapping table can include the correspondence between the position of the color group of the image pixels and the algorithmic solution or interpolation solution of each calculation point. In the color mapping table, some calculation points use the algorithmic solution and others use the interpolation solution.
[0092] 203, a digital signal processing chip processes digital images at least in part based on interpolation solutions of one or more computation points in a second batch.
[0093] In this embodiment of the application, digital images are processed at least in part based on the interpolation solutions of one or more calculation points in the second batch. Since the computational amount of calculating the interpolation solution is less than that of calculating the algorithm solution, compared with using the algorithm solution for all calculations, the computational amount of the image processing algorithm can be reduced and the image processing speed can be improved, thereby achieving the effect of accelerating image processing.
[0094] Optionally, in step 202, the digital signal processing chip calculates the interpolation solution for one or more second-batch computation points located between two adjacent computation points in the first batch of multiple computation points, which may include the following steps:
[0095] The digital signal processing chip, based on the parallel computing instruction set supported by the digital signal processing chip, calculates the interpolation solution of one or more computing points in the second batch between two adjacent computing points in the first batch of multiple computing points.
[0096] In this embodiment of the application, the parallel computing instruction set can be a single instruction multiple data (SIMD) dataset. The SIMD dataset can be a multi-bit (e.g., 16-bit, 32-bit, 64-bit, or 128-bit) instruction set, which can support 16-bit, 32-bit, 64-bit, or 128-bit parallel computing, thereby improving the computational efficiency of interpolation calculation through parallel computing.
[0097] The image processing method of this application embodiment processes digital images at least in part based on the interpolation solution of one or more calculation points in the second batch. Since the computational amount of calculating the interpolation solution is less than that of calculating the algorithm solution, the computational amount of the image processing algorithm can be reduced, the image processing speed can be improved, and thus the effect of accelerating image processing can be achieved.
[0098] Please see Figure 3 , Figure 3 This is a schematic flowchart of another image processing method provided in an embodiment of this application. Figure 3 As shown, the method may include the following steps.
[0099] 301. During the filtering process of the first image, the digital signal processing chip determines the number of calculation points required by the image filtering algorithm based on the value range of the pixels in the first image.
[0100] The first image is a digital image, and the image processing algorithm includes an image filtering algorithm.
[0101] In this embodiment of the application, when filtering the first image, there is an initialization process for the image filtering algorithm. This process requires obtaining a set of vector tables with an initial length of n according to the parameters. Each set of data in the table is as follows:
[0102]
[0103] Here, b is a constant, determined each time the image is output, and n is related to the image size (approximately 256*256*3). Since the function f(i) needs to be repeatedly calculated multiple times during the initialization of this vector, the computational efficiency is low. However, depth map generation requires higher efficiency; therefore, it is necessary to improve the efficiency of this part. When repeatedly calculating the function f(i), the image processing method of this application embodiment can be used to accelerate the calculation speed.
[0104] The size of 'n' is related to the value range of all pixels in the first image. For example, if the red, green, and blue values of each pixel in the first image are distributed between 0 and 255 (minimum value 0, maximum value 255), and the image filtering algorithm needs to calculate the difference between any two pixels, then the size of 'n' is 256 * 256 * 3. Alternatively, if the red, green, and blue values of each pixel in the first image are distributed between 1 and 250 (minimum value 1, maximum value 250), then the size of 'n' is 250 * 250 * 3. The number of calculation points required by the image filtering algorithm can be determined based on the value range of all pixels in the image, allowing for an accurate determination of the total number of calculation points.
[0105] The embodiments of this application can determine the number of all calculation points required by the image filtering algorithm based on the value range of the pixels in the first image, thereby accurately determining the number of all calculation points and avoiding omissions or over-calculations of calculation points.
[0106] The calculated point refers to the position in the color map table, with a range of [0-256*256*3]. Assuming the lookup table mapping is f(x), x∈[0,256*256*3], x is the position of the calculated point, and f(x) is the value to be looked up at that calculated point. In an image, x represents the "difference" or "distance" between two pixels. For example, the RGB data of a pixel A is (r1, g1, b1), where r1, g1, and b1 are each stored using 8 bits. Therefore, r1, g1, and b1 are all between 0 and 256 (2...). 8 Given that pixel B has RGB data of (r2, g2, b2), the "distance" between pixels A and B can be calculated as follows:
[0107] (r1-r2) 2 +(g1-g2) 2 +(b1-b2) 2 (1)
[0108] Since r1, g1, and b1 are all between 0 and 256 (2 8 Therefore, the maximum value of x is 3.256. 2 .
[0109] In addition, since the image is not necessarily in RGB format, the calculation method of x is not exactly the same for different images (not necessarily completely consistent with formula (1)). However, the general process requires calculating x and then finding the corresponding f(x) from the color map table for subsequent calculations.
[0110] 302. The digital signal processing chip obtains the algorithm solution for each of the first batch of multiple calculation points through image processing algorithms. The calculation points are used to represent the corresponding positions of the color groups of image pixels in the color mapping table.
[0111] 303, the digital signal processing chip calculates the interpolation solution of one or more second batches of calculation points between two adjacent calculation points in the first batch of multiple calculation points. The color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution or interpolation solution of the calculation point.
[0112] 304, a digital signal processing chip processes digital images based at least in part on the interpolation solution of one or more computation points in a second batch.
[0113] The specific implementation of steps 302 to 304 can be found in the description of steps 201 to 203 above, and will not be repeated here.
[0114] In this embodiment, during the initialization process of the image filtering algorithm, all the calculation points required by the image filtering algorithm can be determined based on the value range of the image pixels. It can be determined which of the calculation points required by the image filtering algorithm need to calculate the algorithm solution and which need to calculate the interpolation solution. Since the computational amount of calculating the interpolation solution is less than that of calculating the algorithm solution, the computational amount in the initialization process of the image filtering algorithm can be reduced, the image processing speed can be improved, and thus the effect of accelerating image processing can be achieved.
[0115] The following explanation uses image filtering algorithms as an example of image processing algorithms.
[0116] When a camera on a terminal device captures portraits or other still scenes, a blurring operation is required. This blurring operation relies on the image's depth map information (the depth map is captured by the camera, and each pixel value represents the distance from the object to the camera's xy plane, in mm). The depth map processing involves initialization, requiring the use of a digital signal processing chip to accelerate the algorithm's processing speed.
[0117] During the depth map generation process, there is an initialization process for the image filtering algorithm. This process requires initializing a set of vector tables of length n according to the parameters. Each set of data in the table is as follows:
[0118]
[0119] Here, b is a constant, determined each time the image is output, and n is related to the image size. Since the function f(i) needs to be calculated repeatedly when initializing the vector, the computational efficiency is low. However, the generation of the depth map requires higher efficiency, so it is necessary to improve the running efficiency of this part. When repeatedly calculating the function f(i), the image processing method of this application embodiment can be used to speed up the calculation.
[0120] Since this image filtering algorithm allows for a certain degree of error, an approximate solution can be used to replace the algorithm solution. The actual steps are as follows:
[0121] Step 1: Determine the initial point and cutoff point for obtaining the solution using the algorithm. Observe the changing trend of the original function as shown below:
[0122]
[0123] Where 'a' is a parameter that varies from 1 to 256*256*3, and 'b' is a constant. The function's trend as 'a' changes from 0 to 256*256*3 is a gradual change from a negative number (-1) to an asymptote close to 0. Please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic diagram illustrating the changing trend of the original function of an image filtering algorithm provided in this application embodiment.
[0124] To reduce the computational load, instead of calculating for each point, the values of fixed points (precisely calculated points) are calculated, and then interpolation is performed. This reduces the computational load, and this method optimizes the computational load at the expense of some accuracy.
[0125] To ensure controllable error, an upper limit of V is set. This constraint requires that the error at each calculation point be less than V, while minimizing the number of fixed points (multiple calculation points in the first batch). Therefore, the following process is used when initially determining the location of fixed points: First, pre-determine the algorithmic solutions for all calculation points, with the first point set to 1. Starting from the third point, calculate the algorithmic solutions (for the first and third points). Then, use the first and third points to calculate the interpolation solution for the intermediate point (the second point). Calculate the error of the intermediate point based on the interpolation solution and the algorithmic solution. If the error of the intermediate point is less than the upper limit V, continue calculation from the fourth point until an intermediate point has an error greater than or equal to the upper limit V. At this point, the fixed point is determined, and calculation continues from that point as the next point. Please refer to [link to relevant documentation]. Figure 5 , Figure 5 This is a schematic diagram illustrating how a precise calculation point is determined using a cyclic iterative method, as provided in an embodiment of this application.
[0126] With n = 256 * 256 * 3, the positions of the first batch of multiple calculation points can be determined as follows. It can be seen that the positions are relatively dense at the beginning and relatively sparse at the end. This is because the function is increasing and asymptotically approaches 0. When the position reaches 12299, the subsequent points can be truncated.
[0127] {1,3,5,7,9,11,15,19,23,27,31,35,43,51,59,67,75,83,91,107,123,139,155,171,187,203,219,235,267,299,331,363,395,427,459,491,523, 587,651,715,779,843,907,971,1035,1163,1291,1419,1547,1675,1803,2059,2315,2571,2827,3083,3595,4107,4619,5131,6155,8203,12299};
[0128] In actual operation, since the algorithm solution needs to be known in advance, the initial point position is used as a known value and is not changed after the point position is determined in advance.
[0129] Step 2: After the initial points are determined, parallel computation is performed between the initial points using SIMD instructions. Taking points 4619 and 5131 in the table above as examples, the algorithmic solutions for these two points have been obtained in Step 1. Next, linear interpolation is needed to calculate the interpolation solution between points 4619 and 5131. Since SIMD can achieve parallel operation, 4619 and 5131 are divided into two parts with a step size of 64. Let's assume the algorithmic solution for these two positions is f(a). The calculation method for f(a) and f(c) at various positions from a to c is as follows: Divide [a, c] into m segments with a step size of 64, and perform m loops. Within one loop, for example, the value from position a to a+64 is calculated by adding vecInit to the product of vec and h. This method can be parallelized using dedicated instructions of the DSP (SIMD), allowing for 64-bit parallel computation at a time (in practice, one instruction can multiply and add each element of a vector containing 64 elements separately, improving computational efficiency). Please refer to [link to relevant documentation]. Figure 6 , Figure 6 This is a schematic diagram illustrating interpolation calculation using SIMD instructions, provided in an embodiment of this application.
[0130] h = [f(c) - f(a)] / (ca);
[0131] vecInit
[64] =[f(a),f(a),f(a)...f(a)];
[0132] vec
[64] = [0,1,2…64].
[0133] In the initialization process of the image filtering algorithm, the interpolation points and cutoff points are determined based on the error between the interpolated values (interpolation solution) and the actual values (algorithm solution). Linear interpolation is used to replace the numerical calculation for each element position, and SIMD is used for calculation between every two interpolation points, improving computational efficiency. Considering the allowable error in element values during operator initialization, approximate values generated by interpolation are used instead of precise values. In the initial selection of interpolation points, the position of the initial point is selected based on the error to calculate the algorithm solution. Then, linear interpolation is used between the initial points. Since linear interpolation does not involve calculations such as power functions and square roots, SIMD is used for acceleration, greatly improving running efficiency.
[0134] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the terminal device includes the corresponding hardware structure and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0135] This application embodiment can divide the terminal device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0136] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an image processing device provided in an embodiment of this application. The image processing device 700 is applied to a digital signal processing chip. The image processing device 700 may include a first computing unit 701, a second computing unit 702, and an image processing unit 703, wherein:
[0137] The first calculation unit 701 is used to obtain the algorithm solution for each calculation point in the first batch of multiple calculation points through an image processing algorithm; wherein, the calculation point is used to represent the corresponding position of the color group of the image pixel in the color mapping table, and the color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution;
[0138] The second calculation unit 702 is used to calculate the interpolation solution of one or more calculation points in the second batch between two adjacent calculation points in the first batch of multiple calculation points;
[0139] Image processing unit 703 is used to process the digital image at least in part based on the interpolation solution of one or more calculation points in the second batch.
[0140] Optionally, the image processing apparatus 700 may also include a determining unit 704.
[0141] The determining unit 704 is used to determine the first batch of multiple calculation points for which the image processing algorithm needs to obtain the algorithm solution; two adjacent calculation points in the first batch of multiple calculation points include: a first starting calculation point and a first target truncated calculation point; wherein, among the calculation points between the first starting calculation point and the first calculation point, there are calculation points whose interpolation solutions do not meet the interpolation requirements, and the difference between the point index of the first target truncated calculation point and the point index of the first calculation point is 1; when the difference between the point index of the first target truncated calculation point and the point index of the first starting calculation point is equal to 1, no interpolation calculation is required between the first target truncated calculation point and the first starting calculation point; when the difference between the point index of the first target truncated calculation point and the point index of the first starting calculation point is greater than or equal to an integer of 2, the interpolation solutions of the calculation points between the first starting calculation point and the first target truncated calculation point all meet the interpolation requirements.
[0142] Optionally, the determining unit 704 determines two adjacent calculation points among the first batch of multiple calculation points for which the image processing algorithm needs to obtain an algorithm solution, including: setting the point number of the first starting calculation point as position a, setting the point number of the first initial truncation calculation point as b, ba = 2; calculating the interpolation solution of the calculation points between a and b; if the interpolation solutions of the calculation points between a and b all meet the interpolation requirements, adding 1 to b to obtain a new b, and performing the calculation of the interpolation solution of the calculation points between a and b; if there is an interpolation solution of the calculation points between a and b that does not meet the interpolation requirements, taking the calculation point with point number b-1 as the first target truncation calculation point.
[0143] Optionally, the interpolation requirement includes: the absolute value of the difference between the algorithm solution and the interpolation solution at the same calculation point is less than a first threshold.
[0144] Optionally, the second calculation unit 702 calculates the interpolation solution for one or more calculation points in a second batch located between two adjacent calculation points in the first batch of multiple calculation points, including:
[0145] Based on the parallel computing instruction set supported by the digital signal processing chip, the interpolation solution of one or more computing points in the second batch is calculated between two adjacent computing points in the first batch of multiple computing points.
[0146] Optionally, the image processing algorithm includes an image filtering algorithm, and the determining unit 704 is further configured to determine the number of calculation points required by the image filtering algorithm based on the value range of the pixels in the first image during the filtering process of the first image.
[0147] In this embodiment, the first computing unit 701 and the second computing unit 702, the image processing unit 703 and the determination unit 704 can be processors in a digital signal processing chip.
[0148] Figure 7 For a detailed implementation of the image processing apparatus 700 shown, please refer to [link to relevant documentation]. Figures 2 to 3 The method embodiments shown are not described in detail here.
[0149] In this embodiment of the application, the digital image is processed at least in part based on the interpolation solution of one or more calculation points in the second batch. Since the computational amount of calculating the interpolation solution is less than that of calculating the algorithm solution, the computational amount of the image processing algorithm can be reduced and the image processing speed can be improved.
[0150] This application provides a chip, which includes a processor, the processor being configured to:
[0151] Acquire digital images;
[0152] The algorithmic solution for each of the first batch of multiple calculation points is obtained through image processing algorithms; wherein, the calculation point is used to represent the corresponding position of the color group of the image pixel in the color mapping table;
[0153] Calculate the interpolation solution for one or more calculation points in the second batch between two adjacent calculation points in the first batch of multiple calculation points. The color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution or interpolation solution of the calculation point.
[0154] The digital image is processed at least in part based on the interpolation solution of one or more calculation points in the second batch.
[0155] The chip processes digital images at least in part based on the interpolation solution of one or more computation points in the second batch. Since the computational cost of calculating the interpolation solution is less than that of calculating the algorithm solution, the computational cost of the image processing algorithm can be reduced, thereby improving the image processing speed.
[0156] Optionally, the processor is further configured to:
[0157] The image processing algorithm needs to obtain the first batch of multiple calculation points to determine the algorithm solution; two adjacent calculation points in the first batch of multiple calculation points include: a first starting calculation point and a first target truncation calculation point;
[0158] Wherein, among the calculation points between the first starting calculation point and the first calculation point, there are calculation points where the interpolation solution does not meet the interpolation requirements, and the difference between the point number of the first target truncated calculation point and the point number of the first calculation point is 1; when the difference between the point number of the first target truncated calculation point and the point number of the first starting calculation point is equal to 1, no interpolation calculation is required between the first target truncated calculation point and the first starting calculation point; when the difference between the point number of the first target truncated calculation point and the point number of the first starting calculation point is greater than or equal to an integer of 2, the interpolation solutions of the calculation points between the first starting calculation point and the first target truncated calculation point all meet the interpolation requirements.
[0159] Optionally, regarding determining two adjacent computation points among the first batch of multiple computation points for which the image processing algorithm needs to obtain an algorithm solution, the processor is configured to:
[0160] Set the position number of the first starting calculation point to a, and set the position number of the first initial cutoff calculation point to b, ba = 2;
[0161] Calculate the interpolation solution for the calculation point between a and b;
[0162] If the interpolation solutions for the calculation points between a and b all meet the interpolation requirements, add 1 to b to obtain a new b, and then perform the calculation of the interpolation solutions for the calculation points between a and b.
[0163] If there is an interpolation solution for the calculated point between a and b that does not meet the interpolation requirements, the calculated point with point number b-1 is taken as the first target truncated calculated point.
[0164] Optionally, the interpolation requirement includes: the absolute value of the difference between the algorithm solution and the interpolation solution at the same calculation point is less than a first threshold.
[0165] Optionally, in calculating the interpolation solution for one or more second-batch computation points located between two adjacent computation points in the first batch of computation points, the processor is configured to:
[0166] Based on the parallel computing instruction set supported by the digital signal processing chip, the interpolation solution of one or more computing points in the second batch is calculated between two adjacent computing points in the first batch of multiple computing points.
[0167] Optionally, the image processing algorithm includes an image filtering algorithm, and the processor is further configured to:
[0168] During the filtering process of the first image, the number of calculation points required by the image filtering algorithm is determined based on the value range of the pixels in the first image.
[0169] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a digital signal processing chip provided in an embodiment of this application, as shown below. Figure 8 As shown, the digital signal processing chip 800 includes a processor 801 and a memory 802, which are interconnected via a communication bus 803. The communication bus 803 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 803 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 8 The bus is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. Memory 802 stores computer programs, which include program instructions. Processor 801 is configured to call these program instructions, which include instructions for execution. Figures 2-3 Some or all of the steps in the method shown.
[0170] The processor 801 can be a digital signal processor (DSP).
[0171] The memory 802 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.
[0172] In this embodiment of the application, the digital image is processed at least in part based on the interpolation solution of one or more calculation points in the second batch. Since the computational amount of calculating the interpolation solution is less than that of calculating the algorithm solution, the computational amount of the image processing algorithm can be reduced and the image processing speed can be improved.
[0173] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange that causes a computer to perform some or all of the steps of any of the image processing methods described in the above method embodiments.
[0174] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0175] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0176] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0177] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0178] Furthermore, the functional units in the various embodiments of the application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software program module.
[0179] If the integrated unit is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0180] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: a flash drive, a read-only memory, a random access memory, a magnetic disk, or an optical disk, etc.
[0181] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An image processing method, characterized by, The method is applied by a digital signal processing chip to process digital images, and the method includes: The image processing algorithm requires obtaining a first batch of multiple computation points to solve the algorithm. Two adjacent computation points in this first batch include a first starting computation point and a first target truncation computation point. Among the computation points between the first starting computation point and the first computation point, there are computation points where the interpolation solution does not meet the interpolation requirements. The difference between the position number of the first target truncation computation point and the position number of the first computation point is 1. If the difference between the position number of the first target truncation computation point and the position number of the first starting computation point is equal to 1, no interpolation calculation is needed between the first target truncation computation point and the first starting computation point. If the difference between the position number of the first target truncation computation point and the position number of the first starting computation point is greater than or equal to an integer of 2, the interpolation solutions of the computation points between the first starting computation point and the first target truncation computation point all meet the interpolation requirements. The algorithmic solution for each of the first batch of multiple calculation points is obtained through the image processing algorithm; wherein, the calculation point is used to represent the corresponding position of the color group of the image pixel in the color mapping table; Calculate the interpolation solution for one or more calculation points in the second batch between two adjacent calculation points in the first batch of multiple calculation points. The color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution or interpolation solution of the calculation point. The digital image is processed at least in part based on the interpolation solution of one or more calculation points in the second batch.
2. The method of claim 1, wherein, Determining two adjacent computation points among the first batch of multiple computation points for which the image processing algorithm needs to obtain the algorithm solution includes: Set the position number of the first starting calculation point to a, and set the position number of the first initial cutoff calculation point to b, ba=2; Calculate the interpolation solution for the calculation point between a and b; If the interpolation solutions for the calculation points between a and b all meet the interpolation requirements, add 1 to b to obtain a new b, and then perform the calculation of the interpolation solutions for the calculation points between a and b. If there is an interpolation solution for the calculated point between a and b that does not meet the interpolation requirements, the calculated point with point number b-1 is taken as the first target truncated calculated point.
3. The method according to claim 1 or 2, characterized in that, The interpolation requirement includes: the absolute value of the difference between the algorithm solution and the interpolation solution at the same calculation point is less than a first threshold.
4. The method of claim 1, wherein, The calculation of the interpolation solution for one or more calculation points in a second batch located between two adjacent calculation points in the first batch of multiple calculation points includes: Based on the parallel computing instruction set supported by the digital signal processing chip, the interpolation solution of one or more computing points in the second batch is calculated between two adjacent computing points in the first batch of multiple computing points.
5. The method of claim 1, wherein, The image processing algorithm includes an image filtering algorithm. Before obtaining the algorithmic solution for each calculation point in the first batch of multiple calculation points through the image processing algorithm, the method further includes: During the filtering process of the first image, the number of calculation points required by the image filtering algorithm is determined based on the value range of the pixels in the first image.
6. An image processing apparatus characterized by comprising: The device uses a digital signal processing chip to process digital images, and the device includes: A determining unit is used to determine the first batch of multiple calculation points for which the image processing algorithm needs to obtain the algorithm solution; two adjacent calculation points in the first batch of multiple calculation points include: a first starting calculation point and a first target truncated calculation point; wherein, among the calculation points between the first starting calculation point and the first calculation point, there are calculation points whose interpolation solutions do not meet the interpolation requirements, and the difference between the point index of the first target truncated calculation point and the point index of the first calculation point is 1; when the difference between the point index of the first target truncated calculation point and the point index of the first starting calculation point is equal to 1, no interpolation calculation is required between the first target truncated calculation point and the first starting calculation point; when the difference between the point index of the first target truncated calculation point and the point index of the first starting calculation point is greater than or equal to an integer of 2, the interpolation solutions of the calculation points between the first starting calculation point and the first target truncated calculation point all meet the interpolation requirements. The first calculation unit is used to obtain the algorithm solution for each calculation point in the first batch of multiple calculation points through an image processing algorithm; wherein, the calculation point is used to represent the corresponding position of the color group of the image pixel in the color mapping table, and the color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution; The second calculation unit is used to calculate the interpolation solution of one or more calculation points in the second batch between two adjacent calculation points in the first batch of multiple calculation points; An image processing unit is used to process the digital image based at least in part on the interpolation solution of one or more computation points in the second batch.
7. A digital signal processing chip, characterized by The device includes a processor and a memory, the memory being used to store a computer program, the computer program including program instructions, and the processor being configured to invoke the program instructions to perform the method as described in any one of claims 1 to 5.
8. A terminal device, comprising: Includes digital signal processing chips and main processing chips; The digital signal processing chip is used to determine the first batch of multiple calculation points that the image processing algorithm needs to obtain the algorithm solution; The first batch of multiple calculation points includes two adjacent calculation points: a first starting calculation point and a first target truncation calculation point; wherein, among the calculation points between the first starting calculation point and the first calculation point, there are calculation points where the interpolation solution does not meet the interpolation requirements, and the difference between the point number of the first target truncation calculation point and the point number of the first calculation point is 1; when the difference between the point number of the first target truncation calculation point and the point number of the first starting calculation point is equal to 1, no interpolation calculation is required between the first target truncation calculation point and the first starting calculation point; when the difference between the point number of the first target truncation calculation point and the point number of the first starting calculation point is greater than or equal to an integer of 2, the interpolation solutions of the calculation points between the first starting calculation point and the first target truncation calculation point all meet the interpolation requirements. The digital signal processing chip is further configured to process digital images according to a color mapping table, obtain image processing results, and transmit the image processing results to the main processing chip; the color mapping table is used to represent the correspondence between the position of the color group of image pixels and the algorithm solution or interpolation solution of the calculation point, and the calculation point is used to represent the corresponding position of the color group in the color mapping table; The main processing chip is used to perform image post-processing based on the image processing results.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 5.
10. A chip including a processor, said processor being configured to: Acquire digital images; Determining a first plurality of calculation points for which a solution to the image processing algorithm is sought; adjacent two of the first plurality of calculation points comprise: A first starting calculation point and a first target truncation calculation point; wherein, among the calculation points between the first starting calculation point and the first calculation point, there are calculation points where the interpolation solution does not meet the interpolation requirements, and the difference between the point index of the first target truncation calculation point and the point index of the first calculation point is 1; when the difference between the point index of the first target truncation calculation point and the point index of the first starting calculation point is equal to 1, no interpolation calculation is required between the first target truncation calculation point and the first starting calculation point; when the difference between the point index of the first target truncation calculation point and the point index of the first starting calculation point is greater than or equal to an integer of 2, the interpolation solutions of the calculation points between the first starting calculation point and the first target truncation calculation point all meet the interpolation requirements; The algorithmic solution for each of the first batch of multiple calculation points is obtained through image processing algorithms; wherein, the calculation point is used to represent the corresponding position of the color group of the image pixel in the color mapping table; Calculate the interpolation solution for one or more calculation points in the second batch between two adjacent calculation points in the first batch of multiple calculation points. The color mapping table is used to represent the correspondence between the position of the color group and the algorithm solution or interpolation solution of the calculation point. processing the digital image based at least in part on the interpolated solution for the second batch of one or more computed point locations.