WO2018214769A1 - Image processing method, device and system - Google Patents

Image processing method, device and system Download PDF

Info

Publication number
WO2018214769A1
WO2018214769A1 PCT/CN2018/086648 CN2018086648W WO2018214769A1 WO 2018214769 A1 WO2018214769 A1 WO 2018214769A1 CN 2018086648 W CN2018086648 W CN 2018086648W WO 2018214769 A1 WO2018214769 A1 WO 2018214769A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
pixel
filtered
processed
parameter value
Prior art date
Application number
PCT/CN2018/086648
Other languages
French (fr)
Chinese (zh)
Inventor
王东
刘华平
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2018214769A1 publication Critical patent/WO2018214769A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20028Bilateral filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation

Definitions

  • the present application relates to the field of image processing, and more particularly to an image processing method, apparatus and system.
  • edge perseving can be obtained by bilateral filtering, and image noise can be removed at the same time.
  • the inventors found that only the influence of the gray-scale difference of adjacent pixel points on the filtered pixel is considered in the filtering process, and the edge-preserving effect and the denoising effect are still compared. Great room for improvement.
  • the main purpose of the present application is to provide an image processing method, apparatus and system for improving image denoising and edge preservation effects and improving image quality after filtering processing.
  • an image processing method comprising:
  • the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
  • an output image of the image to be processed is determined.
  • an image processing apparatus comprising:
  • the to-be-processed row/column of the image to be processed includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
  • a processing unit that performs a first bilateral exponential filtering process on the to-be-processed image from an endpoint of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: an image parameter value of the filtered pixel a difference from an image parameter value of a pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
  • the determining unit determines an output image of the image to be processed according to the result of the first bilateral exponential filtering process.
  • an electronic device comprising:
  • a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the following operations:
  • the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
  • an output image of the image to be processed is determined.
  • an image processing system comprising the image processing apparatus of the second aspect or the third aspect.
  • a computer readable storage medium storing one or more programs, the one or more programs comprising instructions that, when executed by an electronic device comprising a plurality of applications , enabling the electronic device to perform the following methods:
  • the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
  • an output image of the image to be processed is determined.
  • an image processing method comprising:
  • the to-be-processed row/column of the to-be-processed image includes a filtered pixel point and at least one pixel to be filtered;
  • an output image of the image to be processed is determined.
  • the embodiment of the present application performs bilateral exponential filtering processing according to the difference and distance of pixel points, which can improve image denoising and edge preservation effects, and improve image quality after filtering processing.
  • 1 is an impulse response diagram of an embodiment of the present application after bilateral exponential filtering.
  • FIG. 2 is a schematic diagram of an image to be processed of an embodiment of the present application.
  • FIG. 3 is a flow chart of a method of image processing in accordance with an embodiment of the present application.
  • 4 is a comparison diagram of the effect of processing the number of frames in one embodiment of the present application.
  • FIG. 5 is a comparison diagram of another processing frame number effect of one embodiment of the present application.
  • FIG. 6 is a comparison diagram of another processing frame number effect according to an embodiment of the present application.
  • FIG. 7 is a comparison diagram of filtering effects under an optimization method of an embodiment of the present application.
  • Figure 8 is a schematic illustration of parallel image processing of one embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
  • FIG. 11 is a flow chart of a method of image processing in another embodiment of the present application.
  • An embodiment of the present application provides an image processing method, apparatus, and system.
  • FIG. 1 is an impulse response diagram of an embodiment of the present application after bilateral exponential filtering.
  • the abscissa of the curve function in the figure represents the distance between the pixel points, and the ordinate represents the influence factor of the pixel point.
  • the curve decays rapidly after deviating from the centerline.
  • FIG. 2 shows a schematic diagram of an image to be processed of one embodiment of the present application.
  • the image to be processed may be subjected to bilateral filtering processing in the horizontal direction (the A and B directions shown in FIG. 2); or in the vertical direction (as shown in FIG. 2).
  • the image to be processed is subjected to bilateral filtering processing; or the image to be processed may be bilaterally filtered in both the horizontal direction and the vertical direction.
  • FIG. 3 is a flow chart of a method of image processing in accordance with an embodiment of the present application.
  • the method of Figure 3 is performed by an image processing device.
  • the image processing device may be a processor, a graphics processor, or a filter such as a finite-length unit impulse response (FIR) filter.
  • the method of Figure 3 can include:
  • the pending row/column of the to-be-processed image includes filtered pixel points at the endpoint and at least one pixel to be filtered.
  • the first bilateral exponential filtering process includes a first one-sided exponential filtering process in a first direction from a first end to a second end of the to-be-processed row/column of the image to be processed, and A second one-sided exponential filtering process in a second direction from the second end of the to-be-processed row/column of the image to be processed to the first end.
  • the to-be-processed row/column includes the filtered pixel points located at the endpoint, and may specifically include: a pixel point located at the first end and filtered, and filtered at the second end. pixel.
  • the filtered pixel points within a predetermined distance of the endpoint may be regarded as the filtered pixel points of the endpoint in the embodiment of the present application.
  • the pixel located at the endpoint in the row/column of the original image may be regarded as a filtered pixel to obtain a to-be-processed image; or, for example, a pending row/column of the original image may be adopted in some filtering manner.
  • the pixel located at the endpoint is filtered to obtain a filtered pixel, thereby obtaining a to-be-processed image, and the like.
  • the first bilateral index filtering processing is based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered.
  • the image to be processed is subjected to filtering processing, it may include filtering processing of rows, or filtering processing of columns, or filtering processing on rows and columns, respectively.
  • the image parameter value may be one or more color space indicators in any one color space.
  • the image parameter value may be a Y parameter of the YUV color space, that is, a brightness (Luminance), or a chromaticity U parameter or a V parameter of the YUV color space, and the image parameter value may also be simultaneously Includes three parameters for the YUV color space and more.
  • the image parameter value may be regarded as a multi-dimensional value, and the parameters in each dimension may be separately processed.
  • the color is converted into a black and white image of 0-255, and a gray value can be obtained, and the image parameter value can also be a gray value.
  • the first bilateral index filtering processing portion is based on the difference between the image parameter value of the filtered pixel point and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel point and the pixel to be filtered, which refers to the first bilateral index.
  • the filtering process may perform filtering processing based only on the difference and the distance, or may perform filtering processing based on a plurality of parameters including the difference and the distance.
  • the first bilateral exponential filtering processing portion is based on: a difference between an image parameter value of the filtered pixel point and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel point and the pixel to be filtered
  • the specific implementation is:
  • the range filtering kernel function of a bilateral exponential filtering process is based in part on the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered.
  • the range filter function of the first bilateral exponential filter processing is based in part on the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered.
  • the range filter function of the first one-sided exponential filter is partially based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
  • the range filter function of the second one-sided exponential filter is based in part on the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered.
  • the image parameter value of the pixel to be filtered refers to an image parameter value when the pixel to be filtered does not undergo any filtering process in the image to be processed; if the filtered pixel The point is not the initial filtered pixel point of the first one-sided exponential filtering process, and the image parameter value of the filtered pixel point refers to the image parameter value of the pixel of the image to be processed after the first one-sided exponential filtering process.
  • the image parameter value of the pixel to be filtered refers to an image parameter value when the pixel to be filtered does not undergo any filtering process in the image to be processed; if the filtered The pixel point is not the initial filtered pixel point of the second one-sided exponential filtering process, and the image parameter value of the filtered pixel point refers to the image parameter value of the pixel of the image to be processed after the second one-sided exponential filtering process.
  • the pixel to be filtered is the next pixel in the to-be-processed row/column where the filtered pixel is processed by the first one-sided exponential filtering;
  • the pixel to be filtered is the next pixel in the to-be-processed row/column in which the filtered pixel is subjected to the second one-sided exponential filtering.
  • the first bilateral exponential filtering process includes a first one-sided exponential filtering process from left to right and a second one-sided exponential filtering process from right to left.
  • the entire filtering process can include:
  • step S302 performing a first bilateral exponential filtering process on the to-be-processed image may specifically include:
  • the image parameter value of the first filtered pixel is the filtered image parameter value of the initial filtered pixel;
  • the image parameter value of the first filtered pixel is the image parameter of the first filtered pixel after the first one-sided exponential filtering process. value.
  • step S302 the first bilateral exponential filtering process is performed on the image to be processed, and specifically, the method further includes:
  • the image parameter value of the second filtered pixel is the filtered image parameter value of the initial filtered pixel;
  • the image parameter value of the second filtered pixel is the image parameter of the second filtered pixel after the second one-sided exponential filtering process. value.
  • step S302 performing the first bilateral exponential filtering process on the image to be processed may further include:
  • the image of the pixel point B after the first bilateral exponential filtering process can be determined.
  • Parameter value the image of the pixel point B after the first bilateral exponential filtering process.
  • the bilateral exponential filtering process is performed on the image to be processed according to the pixel point distance and the image parameter value of the pixel point, and the influence of the distance and the image parameter value on the pixel point filtering is fully considered, thereby making the output image better.
  • the edge protection effect and denoising effect improve the display quality of the output image.
  • the range filter function of the first one-sided exponential filter is partially based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a filtered pixel to be filtered.
  • the distance of the pixel point; the range filter function of the second single-sided exponential filter is based on: the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the filtered pixel and the pixel to be filtered The distance of the point.
  • the present application provides a method for determining a range filter kernel function for bilateral exponential filtering, as shown in equation (1):
  • r(u,v) represents the range filter kernel function of the bilateral exponential filter
  • uv represents the difference in image parameter values between two pixel points
  • represents the standard deviation of the range filter coefficient ⁇ [k]
  • dis(u , v) represents the distance between two pixel points.
  • the range filter coefficient ⁇ [k] can be expressed by the following formula (2):
  • the image parameter value of the pixel after the first one-sided exponential filtering process of the pixel point k is filtered.
  • d represents the spacing between pixel point k and pixel point k-1.
  • the image parameter value of the pixel point k after the first one-sided exponential filtering The image parameter value of the image parameter value x[k] before the pixel point k filtering and the previous pixel point k-1 of the pixel point k in the first direction may be subjected to the first one-sided exponential filtering process.
  • the range filter coefficient ⁇ [k] of the first one-sided exponential filter processing is expressed as shown in the formula (4):
  • the range filter coefficient ⁇ [k] can be expressed by the following formula (6):
  • the image point value ⁇ [k] of the pixel point k after the second one-sided exponential filtering may be the image parameter value x[k] before the pixel point k filtering, and the previous pixel of the pixel point k in the second direction.
  • the point k+1 is represented by the image parameter value ⁇ [k+1] after the second one-sided exponential filter processing and the range filter coefficient ⁇ [k] of the second one-sided exponential filter, as shown in the formula (7):
  • the image parameter value ⁇ [k] of the pixel point k after the second one-sided exponential filtering can be expressed by the formula (8):
  • the calculation efficiency can be optimized in various ways, the efficiency of image processing is improved, and a better image processing mode is provided for real-time beauty processing.
  • first single-sided exponential filtering process in the first direction is an example.
  • second single-sided exponential filtering process in the second direction may also adopt the same or similar method.
  • step S302 according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and the first filtered The distance of the pixel determines the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process, which can be implemented as follows:
  • the image parameter value after filtering the pixel to be filtered is obtained by looking up the table, which can greatly improve the calculation efficiency of the bilateral exponential filtering process.
  • the method of the embodiment of the present application can be applied to a real-time beauty scene, and can be applied to real-time video processing on the desktop or the mobile end to achieve real-time beauty effects.
  • the filter to be further determined according to the table lookup precision is to be determined.
  • the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the distance between the first pixel to be filtered and the first filtered pixel The lookup table determines image parameter values of the first pixel to be filtered after the first one-sided exponential filtering process, which can be implemented as follows:
  • determining, according to an image parameter value of the first pixel to be filtered, an image parameter value of the first filtered pixel, and a distance between the pixel to be filtered and the filtered pixel, can be implemented as follows:
  • determining, according to the image parameter value of the first pixel to be filtered, the image parameter value of the first filtered pixel, and the distance between the pixel to be filtered and the filtered pixel, can be implemented as follows:
  • the image parameter after the filtered pixel point is processed by the first one-sided exponential filter, and the distance between the pixel to be filtered and the filtered pixel, and determining the first pixel to be filtered by looking up the table
  • the image parameter value after the first one-sided exponential filtering is processed.
  • the look-up process can be accelerated in different ways according to different accuracy requirements.
  • the following is an example of determining the value of the second look-up table image parameter according to the second look-up table precision value and the image parameter value of the first filtered pixel point.
  • determining that the image parameter value of the first filtered pixel point is multiplied by an integer part of the image parameter value after 10 n is the second check.
  • the image parameter value of the first filtered pixel is a calculated value, it is usually expressed in floating point numbers.
  • the precision of a single-precision floating-point number is 7 digits after the decimal point, which is 0.0000001.
  • the accuracy of the algorithm can be appropriately reduced to improve the operation speed. Assume that the 3 digits after the decimal point are reserved, that is, the position to be positioned each time the table is looked up is Ok, where Stored as a single-precision floating point number.
  • the improvement effect of the calculation efficiency can be as shown in FIG. 4.
  • FIG. 4 is a comparison diagram of the effect of processing the number of frames in one embodiment of the present application.
  • the histogram of the original algorithm represents the number of processing frames obtained by directly calculating the filtered values
  • the histogram optimized by the table table indicates the number of processed frames obtained by the table matching optimization to obtain the filtered values. It can be seen from Fig. 4 that the calculation efficiency can be greatly optimized by looking up the table to improve the image processing efficiency and achieve the real-time beauty requirements.
  • determining that the image parameter value of the first filtered pixel point is shifted to the left by n bits is the second look-up table image parameter. value.
  • n is a positive integer.
  • FIG. 5 is a comparison diagram of the effect of processing the number of frames in one embodiment of the present application.
  • the meaning of the histogram corresponding to the original algorithm and table lookup optimization in Fig. 5 is the same as that of the corresponding histogram in Fig. 4.
  • the floating-point integer optimization of FIG. 5 represents the number of processed frames obtained by the look-up operation after the shift operation.
  • the direct shift operation is much faster than the multiplication operation.
  • the image processing efficiency can be further improved, thereby further improving the real-time performance of the image beauty.
  • determining that the image parameter value of the first filtered pixel point is shifted right by n bits is the second look-up table image parameter. value.
  • n is a positive integer.
  • the second lookup table accuracy value requirement is 4, then the second image parameter value needs to be shifted to the right by 2 bits.
  • the image to be processed may also be subjected to gain filtering processing.
  • the method before determining the output image of the image to be processed, the method further includes: determining, according to the image parameter value before filtering each pixel of the image to be processed, a gain filtering result of each pixel of the image to be processed;
  • the gain-filtered result g[k] can be expressed by the following formula (9):
  • the gain filtered value is only a multiplication operation, and is also suitable for table lookup optimization.
  • the gain filtering result of each pixel of the image to be processed is determined according to the image parameter value before filtering of each pixel of the image to be processed, and the specific implementation may be:
  • the gain filtering result of each pixel of the image to be processed is determined by looking up the table according to the image parameter value before filtering of each pixel of the image to be processed.
  • the result of the lookup mapping table can be shifted by 10 bits to the left, which not only ensures the accuracy requirement but also avoids the multiplication operation.
  • the gain filtering process is performed by looking up the table, thereby further improving the image processing efficiency, thereby further improving the real-time performance of the image beauty.
  • FIG. 6 is a comparison diagram of the effect of processing the number of frames in still another embodiment of the present application.
  • the meaning of the histogram corresponding to the original algorithm and the table lookup optimization in FIG. 6 is the same as that of the corresponding histogram in FIG. 4.
  • the floating point integer optimization in FIG. 6 has the same meaning as the corresponding histogram in FIG.
  • the optimization of FIG. 6 indicates that the table is looked up after the shift operation, and the number of processing frames of the filtered value is also obtained by looking up the table in the gain filtering stage. As can be seen from Figure 6, in the case of optimization, it is nearly 10 times higher than the original algorithm.
  • the table below shows the time-to-time comparison of several algorithms for processing one frame of image on different operating platforms.
  • table lookup operation is only for the table lookup operation performed during the first one-sided exponential filter processing, but is also applicable to the second one-sided exponential filter processing.
  • look-up table method in the embodiment of the present application may also be used in other filtering algorithms such as Gaussian filtering, and details are not described herein again.
  • FIG. 7 is a comparison diagram of filtering effects under an optimization method of an embodiment of the present application. As can be seen from FIG. 7, the image processed by the image processing method of the embodiment of the present application has a very significant denoising and dermabrasion effect.
  • the direction of the first bilateral exponential filtering process is parallel to the row of the image to be processed; or the direction of the first bilateral exponential filtering process is parallel to the column of the image to be processed.
  • the above method may be performed by using an FIR filter.
  • a one-dimensional FIR filter can be used
  • a two-dimensional FIR filter can be used.
  • the FIR filter is well suited for parallel processing.
  • the image processing speed can be speeded up by simultaneously processing 2 or n image pixel rows or simultaneously processing 2 or n image pixel columns, thereby further improving the real-time performance of the image.
  • the step S301 is specifically implemented as: performing a fragmentation process on the input image according to the number of processors for image processing to obtain a plurality of the to-be-processed images, wherein the slice position of the slice processing of the input image is parallel to Processing direction when the first bilateral exponential filtering process is performed on the image to be processed;
  • the method further comprises: synthesizing the output image filtered by the input image according to the output images of the plurality of images to be processed.
  • FIG. 8 is a schematic illustration of parallel image processing of one embodiment of the present application. A specific implementation manner is shown in FIG. 8.
  • the image processing system in the embodiment of the present application can be divided into an algorithm initialization module and an algorithm processing module.
  • One to n processing threads are created according to the number of CPUs used for image processing.
  • algorithm initialization module only creates one processing thread, then obviously no parallel structure is needed; if the algorithm initialization module creates multiple processing threads, then a parallel structure is needed.
  • Image segmentation processing is performed depending on whether or not a parallel structure is used.
  • Step 4 is required if the initialization settings decide to use a parallel structure.
  • the processor also needs to combine the processed results of the multiple parallel threads to generate a processed image;
  • step 4 may not be performed.
  • each thread in the running module of FIG. 8 may refer to the method in the embodiment shown in FIG. 3, and details are not described herein again.
  • the above method is only filtering in one dimension direction.
  • it is often necessary to filter in two dimensions that is, in addition to lateral filtering of the pixels, the pixels need to be longitudinally filtered.
  • the specific algorithm of the longitudinal filtering can refer to the foregoing transverse filtering algorithm, and replace the horizontal coordinate parameter with the longitudinal coordinate parameter.
  • the to-be-processed column/row in the image to be processed that is perpendicular to the direction of the first bilateral index filtering process includes the filtered pixel at the endpoint and the at least one pixel to be filtered; before the step S303, the method further includes:
  • the processing part is based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
  • Determining the output image of the image to be processed according to the result of the first bilateral index filtering process comprises: determining an output of the image to be processed according to a result of the first bilateral exponential filtering process and a result of the second bilateral exponential filtering process image.
  • the image can be filtered from two different dimensions, so that the output image has better edge-preserving effect and denoising effect, and further Improve the display quality of the output image.
  • FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the electronic device includes a processor, optionally including an internal bus, a network interface, and a memory.
  • the memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.
  • RAM high-speed random access memory
  • non-volatile memory such as at least one disk memory.
  • the electronic device may also include hardware required for other services.
  • the processor, the network interface, and the memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended) Industry Standard Architecture, extending the industry standard structure) bus.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one double-headed arrow is shown in Figure 9, but it does not mean that there is only one bus or one type of bus.
  • the program can include program code, the program code including computer operating instructions.
  • the memory can include both memory and non-volatile memory and provides instructions and data to the processor.
  • the processor reads the corresponding computer program from the non-volatile memory into memory and then operates to form an image processing device at a logical level.
  • the processor executes the program stored in the memory and is specifically used to perform the following operations:
  • a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the following operations:
  • the to-be-processed row/column of the to-be-processed image includes the filtered pixel at the endpoint and at least one pixel to be filtered;
  • an output image of the image to be processed is determined.
  • the method performed by the image processing apparatus disclosed in the embodiment shown in FIG. 3 of the present application may be applied to a processor or implemented by a processor.
  • the processor may be an integrated circuit chip with signal processing capabilities.
  • each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software.
  • the above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processor (DSP), dedicated integration.
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • other programmable logic device discrete gate or transistor logic device, discrete hardware component.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method.
  • the electronic device can also perform the method of FIG. 3 and implement the functions of the image processing apparatus in the embodiment shown in FIG. 3.
  • the embodiments of the present application are not described herein again.
  • the electronic device of the present application does not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc., that is, the execution body of the following processing flow is not limited to each logical unit. It can also be hardware or logic.
  • the embodiment of the present application further provides a computer readable storage medium storing one or more programs, the one or more programs including instructions that are executed by an electronic device including a plurality of applications
  • the electronic device can be caused to perform the method of the embodiment shown in FIG.
  • FIG. 10 is a schematic structural diagram of an image processing apparatus 1000 according to an embodiment of the present application.
  • the image processing apparatus may include:
  • the obtaining unit 1010 is configured to obtain an image to be processed, where the to-be-processed row/column of the image to be processed includes the filtered pixel at the endpoint and at least one pixel to be filtered;
  • the processing unit 1020 performs a first bilateral exponential filtering process on the to-be-processed image from the endpoint of the to-be-processed row/column of the to-be-processed image, where the first bilateral exponential filtering process is based on: image parameters of the filtered pixel The difference between the value and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered;
  • the determining unit 1030 determines an output image of the image to be processed according to the result of the first bilateral index filtering process.
  • the image processing apparatus 1000 performs bilateral exponential filtering processing on the image to be processed according to the pixel point distance and the image parameter value of the pixel point, fully considering the influence of the distance and the image parameter value on the pixel point filtering, thereby enabling the output to be made.
  • the image has better edge protection and denoising effects, which improves the display quality of the output image.
  • the image to be processed when performing the first bilateral exponential filtering process, may be preprocessed such that both ends of each to-be-processed row/column of the to-be-processed image respectively include a first bilateral index.
  • the first bilateral exponential filtering process includes a first one-sided exponential filtering process in a first direction from a first end to a second end of the to-be-processed row/column of the image to be processed, and from the image to be processed Processing a second one-sided exponential filtering process in a second direction from the second end of the row/column to the first end;
  • the processing unit 1020 is specifically configured according to the image parameter value of the first pixel to be filtered and the image of the first filtered pixel a difference between the parameter values, and a distance between the first pixel to be filtered and the first filtered pixel, determining an image parameter value of the first pixel to be filtered after the first one-sided exponential filtering, wherein the first to be filtered The pixel is the next pixel to be filtered in the first direction of the first filtered pixel.
  • the processing unit 1020 is specifically configured to: according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and the first filtered pixel The distance, the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process is determined by looking up the table.
  • the processing unit 1020 is configured to: according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and the first The distance of a filtered pixel point is determined by looking up the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process, and the specific implementation is:
  • the processing unit 1020 determines a first look-up table image parameter value according to the first table lookup precision value and the image parameter value of the first pixel to be filtered;
  • the processing unit 1020 determines a second look-up table image parameter value according to the second table lookup precision value and the image parameter value of the first filtered pixel point;
  • the processing unit 1020 determines, according to the first look-up table image parameter value, the second look-up table image parameter value, and the distance, the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process.
  • the processing unit 1020 is configured to: according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and The distance of the first filtered pixel point is determined by looking up the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process, and the specific implementation is:
  • the processing unit 1020 determines a second look-up table image parameter value according to the second table lookup precision value and the image parameter value of the first filtered pixel point;
  • the processing unit 1020 determines, according to the image parameter value of the first pixel to be filtered, the second look-up table image parameter value, and the distance, the image parameter of the first pixel to be filtered after the first one-sided exponential filtering process is determined by looking up the table. value.
  • the processing unit 1020 is configured to: according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and The distance of the first filtered pixel point is determined by looking up the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process, and the specific implementation is:
  • the processing unit 1020 determines a first look-up table image parameter value according to the first table lookup precision value and the image parameter value of the first pixel to be filtered;
  • the processing unit 1020 determines, according to the first look-up table image parameter value, the image parameter after the filtered pixel point passes the first one-sided exponential filtering process, and the distance between the pixel to be filtered and the filtered pixel point, and determines the first by looking up the table.
  • the image parameter value after the first pixel is subjected to the first one-sided exponential filtering.
  • processing unit 1020 determines the second look-up table image parameter value according to the second table lookup precision value and the image parameter value of the first filtered pixel point, which may be specifically implemented as:
  • the processing unit 1020 determines that the image parameter value of the first filtered pixel point is multiplied by 10 n and the integer part of the image parameter value is the second look-up table image parameter value;
  • the processing unit 1020 determines that the integer part of the image parameter value of the first filtered pixel point is shifted to the left by n bits as the second look-up table image parameter value;
  • the processing unit 1020 determines that the integer part of the image parameter value of the first filtered pixel point is shifted to the right by n bits, and is the second look-up table image parameter value;
  • n is a positive integer.
  • the processing unit 1020 further determines, according to the difference between the image parameter value of the second pixel to be filtered and the image parameter value of the second filtered pixel, and the distance between the second pixel to be filtered and the second filtered pixel.
  • the image parameter value after the second pixel to be filtered is subjected to the second one-sided exponential filtering; the image parameter value after the pixel is subjected to the first one-sided exponential filtering, and the pixel is subjected to the second one-sided exponential filtering process
  • the image parameter value determines an image parameter value of the pixel after the first bilateral exponential filtering process.
  • the first bilateral index filtering processing is based on: a difference between an image parameter value of the filtered pixel point and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel point and the pixel to be filtered, which may be specifically implemented as :
  • the range filter function of the first bilateral exponential filter processing is based in part on the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered.
  • the range filter function of the first one-sided exponential filter is partially based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a filtered pixel and a pixel to be filtered.
  • the range of the second-sided exponential filter processing is based on: the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the filtered pixel and the pixel to be filtered. distance.
  • the processing unit 1020 further performs a second bilateral exponential filtering process on the image to be processed in a direction perpendicular to a direction of the first bilateral exponential filtering process, where the second bilateral exponential filtering process is partially based on: the filtered pixel The difference between the image parameter value of the point and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel point and the pixel to be filtered;
  • the determining unit 1030 determines an output image of the image to be processed according to the result of the first bilateral exponential filtering process and the result of the second bilateral exponential filtering process.
  • the processing unit 1020 performs the second bilateral exponential filtering process, and may also perform preprocessing on the processing, so that both ends of each to-be-processed column/row of the to-be-processed image respectively include the second bilateral exponential filtering process.
  • An initial filtered pixel that is processed by the one-sided exponential filtering that starts at the end; or, in the image to be processed acquired by the acquiring unit 1010, both ends of each to-be-processed column/row of the image to be processed include a second bilateral index
  • the direction of the first bilateral exponential filtering process is parallel to the row of the image to be processed; or the direction of the first bilateral exponential filtering process is parallel to the column of the image to be processed.
  • the image processing apparatus may further include a synthesizing unit 1040.
  • the obtaining unit 1010 performs a fragmentation process on the input image according to the number of processors used for image processing to obtain a plurality of the to-be-processed images, wherein the sliced position of the sliced image of the input image is parallel to the image to be processed.
  • the processing direction when the first bilateral exponential filtering process is performed; the synthesizing unit 1040 synthesizes the output image filtered by the input image according to the output images of the plurality of to-be-processed images.
  • the determining unit 1030 further determines a gain filtering result of each pixel of the to-be-processed image according to the image parameter value before filtering the pixel of the image to be processed; wherein the determining unit 1030 is configured according to the first bilateral exponential filtering
  • the output image of the image to be processed is determined by determining the output image of the image to be processed according to the result of the first bilateral index filtering process and the gain filtering result of each pixel of the image to be processed.
  • the determining unit 1030 may determine, according to the image parameter value before filtering each pixel of the image to be processed, a gain filtering result of each pixel of the image to be processed by using a lookup table.
  • the embodiment of the present application further provides an image processing system including the image processing device 1000 in the embodiment shown in FIG. 10 or the image processing device stored in the electronic device in the embodiment shown in FIG.
  • FIG. 11 is a flow chart of a method of image processing according to an embodiment of the present application.
  • the method of Figure 11 is performed by an image processing device.
  • the image processing device may be a processor, a graphics processor, or a filter such as a finite-length unit impulse response (FIR) filter.
  • the method of Figure 11 can include:
  • S1101 Acquire an image to be processed, where the to-be-processed row/column includes a filtered pixel point and at least one pixel to be processed;
  • S1102 Perform a first bilateral exponential filtering process on the to-be-processed row/column of the image to be processed, where the first bilateral exponential filtering process is partially based on: an image parameter value of the filtered pixel point and an image parameter value of the pixel to be filtered. Difference, and the distance between the filtered pixel and the pixel to be filtered;
  • S1103. Determine an output image of the image to be processed according to the result of the first bilateral index filtering process.
  • the bilateral exponential filtering process is performed on the image to be processed according to the pixel point distance and the image parameter value of the pixel point, and the influence of the distance and the image parameter value on the pixel point filtering is fully considered, thereby making the output image better.
  • the edge protection effect and denoising effect improve the display quality of the output image.
  • the filtered node in the image to be processed is not limited to the end position of the row/column to be processed, and the pixel position to be processed is not limited to the end position of the row/column to be processed, other execution steps are performed. For example, performing a first bilateral exponential filtering process on the to-be-processed row/column of the image to be processed, and determining an output image of the to-be-processed image according to the result of the first bilateral exponential filtering process, and referring to the embodiment shown in FIG. The embodiments of the present application are not described herein again.
  • An embodiment of the present application further provides an electronic device, including a processor
  • a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of the embodiment shown in FIG.
  • the embodiment of the present application further provides a computer readable storage medium storing one or more programs, the one or more programs, when executed by an electronic device, enable the electronic device to execute The method in the embodiment shown in FIG.
  • the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
  • a typical implementation device is a computer.
  • the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

Disclosed in embodiments of the present application are an image processing method, device and system. The method comprises: obtaining a to-be-processed image, a to-be-processed row/column of the to-be-processed image comprising a filtered pixel and at least one to-be-filtered pixel at an end point; starting from the end point of the to-be-processed row/column of the to-be-processed image, performing first bilateral exponential filtering processing on the to-be-processed image, the first bilateral exponential filtering processing being partially based on a difference between an image parameter value of the filtered pixel and an image parameter value of the to-be-filtered pixel and a distance between the filtered pixel and the to-be-filtered pixel; and determining an output image of the to-be-processed image according to the result of the first bilateral exponential filtering processing. The solution in the embodiments of the present application can further improve the image denoising and edge preservation effects, and can improve the image quality after filtering processing.

Description

图像处理方法、装置和系统Image processing method, device and system
本申请要求2017年05月24日递交的申请号为201710375442.8、发明名称为“图像处理方法、装置和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Japanese Patent Application Serial No. No. No. No. No. No. No. Publication No
技术领域Technical field
本申请涉及图像处理领域,更具体地,涉及一种图像处理方法、装置和系统。The present application relates to the field of image processing, and more particularly to an image processing method, apparatus and system.
背景技术Background technique
现阶段有很多成熟的图像去噪算法,应用于实时美颜中。简单的去噪不能在去噪的同时保持图像边缘的清晰度,以达到较好的美颜效果。At this stage, there are many mature image denoising algorithms applied to real-time beauty. Simple denoising can not preserve the sharpness of the edges of the image while denoising, in order to achieve a better beauty effect.
在现有的双边滤波算法中,通过双边滤波可以得到保边效果(edge perseving),同时能去除图像噪声。但是,发明人在仔细研究现有技术的双边滤波算法后,发现其滤波过程中只考虑了相邻像素点的灰度差值对滤波像素点的影响,保边效果和去噪效果还存在较大的改进空间。In the existing bilateral filtering algorithm, edge perseving can be obtained by bilateral filtering, and image noise can be removed at the same time. However, after carefully studying the bilateral filtering algorithm of the prior art, the inventors found that only the influence of the gray-scale difference of adjacent pixel points on the filtered pixel is considered in the filtering process, and the edge-preserving effect and the denoising effect are still compared. Great room for improvement.
如何提升滤波处理后的图像质量,是本申请实施例所要解决的技术问题。How to improve the image quality after the filtering process is a technical problem to be solved by the embodiment of the present application.
发明内容Summary of the invention
本申请的主要目的在于提供一种图像处理方法、装置和系统,以提高图像去噪和保边效果,提升滤波处理后的图像质量。The main purpose of the present application is to provide an image processing method, apparatus and system for improving image denoising and edge preservation effects and improving image quality after filtering processing.
为解决上述技术问题,本申请实施例是这样实现的:To solve the above technical problem, the embodiment of the present application is implemented as follows:
第一方面,提出了一种图像处理方法,该方法包括:In a first aspect, an image processing method is proposed, the method comprising:
获取待处理图像,该待处理图像的待处理行/列包括位于端点的已滤波像素点和至少一个待滤波像素点;Obtaining a to-be-processed image, the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
从该待处理图像的待处理行/列的端点开始对该待处理图像进行第一双边指数滤波处理,其中,该第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Performing a first bilateral exponential filtering process on the to-be-processed image from the end of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: image parameter values of the filtered pixel point and to be filtered The difference between the image parameter values of the pixel and the distance between the filtered pixel and the pixel to be filtered;
根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像。Based on the result of the first bilateral exponential filtering process, an output image of the image to be processed is determined.
第二方面,提出了一种图像处理装置,该装置包括:In a second aspect, an image processing apparatus is proposed, the apparatus comprising:
获取单元,获取待处理图像,该待处理图像的待处理行/列包括位于端点的已滤波像 素点和至少一个待滤波像素点;Acquiring a unit to obtain an image to be processed, where the to-be-processed row/column of the image to be processed includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
处理单元,从该待处理图像的待处理行/列的端点开始对该待处理图像进行第一双边指数滤波处理,其中,该第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;a processing unit that performs a first bilateral exponential filtering process on the to-be-processed image from an endpoint of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: an image parameter value of the filtered pixel a difference from an image parameter value of a pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
确定单元,根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像。The determining unit determines an output image of the image to be processed according to the result of the first bilateral exponential filtering process.
第三方面,提出了一种电子设备,该电子设备包括:In a third aspect, an electronic device is proposed, the electronic device comprising:
处理器;以及Processor;
被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行以下操作:A memory arranged to store computer executable instructions that, when executed, cause the processor to perform the following operations:
获取待处理图像,该待处理图像的待处理行/列包括位于端点的已滤波像素点和至少一个待滤波像素点;Obtaining a to-be-processed image, the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
从该待处理图像的待处理行/列的端点开始对该待处理图像进行第一双边指数滤波处理,其中,该第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Performing a first bilateral exponential filtering process on the to-be-processed image from the end of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: image parameter values of the filtered pixel point and to be filtered The difference between the image parameter values of the pixel and the distance between the filtered pixel and the pixel to be filtered;
根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像。Based on the result of the first bilateral exponential filtering process, an output image of the image to be processed is determined.
第四方面,提出了一种图像处理系统,该系统包括第二方面或第三方面中的图像处理装置。In a fourth aspect, an image processing system is provided, the system comprising the image processing apparatus of the second aspect or the third aspect.
第五方面,提出了一种计算机可读存储介质,该计算机可读存储介质存储一个或多个程序,该一个或多个程序包括指令,该指令当被包括多个应用程序的电子设备执行时,能够使该电子设备执行以下方法:In a fifth aspect, a computer readable storage medium is presented, the computer readable storage medium storing one or more programs, the one or more programs comprising instructions that, when executed by an electronic device comprising a plurality of applications , enabling the electronic device to perform the following methods:
获取待处理图像,该待处理图像的待处理行/列包括位于端点的已滤波像素点和至少一个待滤波像素点;Obtaining a to-be-processed image, the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
从该待处理图像的待处理行/列的端点开始对该待处理图像进行第一双边指数滤波处理,其中,该第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Performing a first bilateral exponential filtering process on the to-be-processed image from the end of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: image parameter values of the filtered pixel point and to be filtered The difference between the image parameter values of the pixel and the distance between the filtered pixel and the pixel to be filtered;
根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像。Based on the result of the first bilateral exponential filtering process, an output image of the image to be processed is determined.
第六方面,提出了一种图像处理方法,该方法包括:In a sixth aspect, an image processing method is proposed, the method comprising:
获取待处理图像,该待处理图像的待处理行/列包括已滤波像素点和至少一个待滤波像素点;Obtaining a to-be-processed image, the to-be-processed row/column of the to-be-processed image includes a filtered pixel point and at least one pixel to be filtered;
对该待处理图像的待处理行/列进行第一双边指数滤波处理,其中,该第一双边指数 滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Performing a first bilateral exponential filtering process on the to-be-processed row/column of the image to be processed, wherein the first bilateral exponential filtering processing portion is based on: a difference between an image parameter value of the filtered pixel point and an image parameter value of the pixel to be filtered And the distance between the filtered pixel and the pixel to be filtered;
根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像。Based on the result of the first bilateral exponential filtering process, an output image of the image to be processed is determined.
由以上本申请实施例提供的技术方案可见,本申请实施例根据像素点的差异和距离进行双边指数滤波处理,可以提高图像去噪和保边效果,提升滤波处理后的图像质量。As can be seen from the technical solutions provided by the embodiments of the present application, the embodiment of the present application performs bilateral exponential filtering processing according to the difference and distance of pixel points, which can improve image denoising and edge preservation effects, and improve image quality after filtering processing.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only It is a few embodiments described in the present application, and other drawings can be obtained from those skilled in the art without any inventive labor.
图1是本申请的一个实施例经过双边指数滤波处理后的冲击响应图。1 is an impulse response diagram of an embodiment of the present application after bilateral exponential filtering.
图2是本申请的一个实施例待处理图像的示意图。2 is a schematic diagram of an image to be processed of an embodiment of the present application.
图3是本申请的一个实施例图像处理的方法流程图。3 is a flow chart of a method of image processing in accordance with an embodiment of the present application.
图4是本申请的一个实施例的处理帧数效果对比图。4 is a comparison diagram of the effect of processing the number of frames in one embodiment of the present application.
图5是本申请的一个实施例的另一个处理帧数效果对比图。FIG. 5 is a comparison diagram of another processing frame number effect of one embodiment of the present application.
图6是本申请的一个实施例的再一个处理帧数效果对比图。FIG. 6 is a comparison diagram of another processing frame number effect according to an embodiment of the present application.
图7是本申请的一个实施例最优化方法下的滤波效果对比图。FIG. 7 is a comparison diagram of filtering effects under an optimization method of an embodiment of the present application.
图8是本申请的一个实施例并行图像处理的示意图。Figure 8 is a schematic illustration of parallel image processing of one embodiment of the present application.
图9是本申请的一个实施例电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
图10是本申请的一个实施例图像处理装置的结构示意图。FIG. 10 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
图11是本申请的另一个实施例图像处理的方法流程图。11 is a flow chart of a method of image processing in another embodiment of the present application.
具体实施方式detailed description
本申请实施例提供一种图像处理方法、装置和系统。An embodiment of the present application provides an image processing method, apparatus, and system.
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following, in which the technical solutions in the embodiments of the present application are clearly and completely described. The embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope shall fall within the scope of the application.
发明人在对现有双边滤波处理技术的研究过程中发现,发现像素点距离滤波像素点越近,其对滤波像素点的影响就越大;反之,其对滤波像素点的影响就越小。图1是本申请的一个实施例经过双边指数滤波处理后的冲击响应图。图中的曲线函数的横坐标表示像素点之间的距离,纵坐标表示像素点的影响因子。从图1可以看出,曲线在偏离中心线后迅速衰减。发明人认真研究了距离与滤波的影响关系后,对双边指数滤波处理的值域滤波核函数进行了改进,从而提高了图像处理的效果。In the research process of the existing bilateral filtering processing technology, the inventor found that the closer the pixel points are to the filtering pixel point, the greater the influence on the filtering pixel point; on the contrary, the smaller the effect on the filtering pixel point. 1 is an impulse response diagram of an embodiment of the present application after bilateral exponential filtering. The abscissa of the curve function in the figure represents the distance between the pixel points, and the ordinate represents the influence factor of the pixel point. As can be seen from Figure 1, the curve decays rapidly after deviating from the centerline. After inventing the relationship between distance and filtering, the inventor improved the range filter kernel function of the double-index filter, which improved the image processing effect.
为便于理解本申请实施例的图像处理方法,图2示出了本申请的一个实施例待处理图像的示意图。如图2所示,在本申请实施例的图像处理方法中,可沿水平方向(如图2所示的A、B方向)对待处理图像进行双边滤波处理;或者沿垂直方向(如图2所示的C、D方向)对待处理图像进行双边滤波处理;或者还可以同时沿水平方向和垂直方向都对待处理图像进行双边滤波处理。To facilitate understanding of the image processing method of the embodiment of the present application, FIG. 2 shows a schematic diagram of an image to be processed of one embodiment of the present application. As shown in FIG. 2, in the image processing method of the embodiment of the present application, the image to be processed may be subjected to bilateral filtering processing in the horizontal direction (the A and B directions shown in FIG. 2); or in the vertical direction (as shown in FIG. 2). In the C and D directions, the image to be processed is subjected to bilateral filtering processing; or the image to be processed may be bilaterally filtered in both the horizontal direction and the vertical direction.
图3是本申请的一个实施例图像处理的方法流程图。图3的方法由图像处理装置执行。在本申请实施例中,该图像处理装置可以是处理器,图形处理器,或者是滤波器如有限长单位冲激响应(Finite Impulse Response,FIR)滤波器等。图3的方法可包括:3 is a flow chart of a method of image processing in accordance with an embodiment of the present application. The method of Figure 3 is performed by an image processing device. In the embodiment of the present application, the image processing device may be a processor, a graphics processor, or a filter such as a finite-length unit impulse response (FIR) filter. The method of Figure 3 can include:
S301,获取待处理图像。S301. Acquire an image to be processed.
其中,该待处理图像的待处理行/列包括位于端点的已滤波像素点和至少一个待滤波像素点。The pending row/column of the to-be-processed image includes filtered pixel points at the endpoint and at least one pixel to be filtered.
应理解,在本申请实施例中,第一双边指数滤波处理包括从待处理图像的待处理行/列的第一端到第二端的第一方向上的第一单边指数滤波处理,以及从待处理图像的待处理行/列的第二端到第一端的第二方向上的第二单边指数滤波处理。It should be understood that, in the embodiment of the present application, the first bilateral exponential filtering process includes a first one-sided exponential filtering process in a first direction from a first end to a second end of the to-be-processed row/column of the image to be processed, and A second one-sided exponential filtering process in a second direction from the second end of the to-be-processed row/column of the image to be processed to the first end.
应理解,在本申请实施例中,待处理行/列包括位于端点的已滤波像素点,具体可包括:位于第一端且经过滤波处理的像素点,以及位于第二端且经过滤波处理的像素点。当然,应理解,在本申请实施例中,在端点预定距离内的已滤波像素点,都可视为本申请实施例的位于端点的已滤波像素点。It should be understood that, in the embodiment of the present application, the to-be-processed row/column includes the filtered pixel points located at the endpoint, and may specifically include: a pixel point located at the first end and filtered, and filtered at the second end. pixel. Of course, it should be understood that, in the embodiment of the present application, the filtered pixel points within a predetermined distance of the endpoint may be regarded as the filtered pixel points of the endpoint in the embodiment of the present application.
应理解,在本申请实施例中,如何得到位于端点的已滤波像素点,本申请实施例对此不作限定。例如,可以将原始图像的待处理行/列中位于端点的像素点当作已滤波像素点,从而得到待处理图像;或者,例如,可以采用某种滤波方式对原始图像的待处理行/列中位于端点的像素点进行滤波处理得到滤波像素点,从而得到待处理图像,等等。It should be understood that, in the embodiment of the present application, how to obtain the filtered pixel points located at the endpoints is not limited in this embodiment of the present application. For example, the pixel located at the endpoint in the row/column of the original image may be regarded as a filtered pixel to obtain a to-be-processed image; or, for example, a pending row/column of the original image may be adopted in some filtering manner. The pixel located at the endpoint is filtered to obtain a filtered pixel, thereby obtaining a to-be-processed image, and the like.
S302,从该待处理图像的待处理行/列的端点开始对该待处理图像进行第一双边指数滤波处理。S302. Perform a first bilateral exponential filtering process on the to-be-processed image from an endpoint of the to-be-processed row/column of the to-be-processed image.
其中,第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离。The first bilateral index filtering processing is based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered.
应理解,在对待处理图像进行滤波处理时,可包括行的滤波处理,或者是列的滤波处理,或者包括分别在行、列上的滤波处理。It should be understood that when the image to be processed is subjected to filtering processing, it may include filtering processing of rows, or filtering processing of columns, or filtering processing on rows and columns, respectively.
应理解,在本申请实施例中,该图像参数值可以是任意一种颜色空间中的一项或多项颜色空间指标。例如,以YUV色彩空间为例,该图像参数值可以是YUV色彩空间的Y参数,即明亮度(Luminance),或者是YUV色彩空间的色度U参数或V参数,该图像参数值还可以同时包括YUV色彩空间的三个参数等等。当该图像参数值包括多个参数时,可将该图像参数值视为多维数值,对其每个维度上的参数分别进行处理即可。又例如,在RBG颜色空间中,将色彩转换为0-255的黑白图,可以得到灰度值,该图像参数值也可以是灰度值。It should be understood that in the embodiment of the present application, the image parameter value may be one or more color space indicators in any one color space. For example, taking the YUV color space as an example, the image parameter value may be a Y parameter of the YUV color space, that is, a brightness (Luminance), or a chromaticity U parameter or a V parameter of the YUV color space, and the image parameter value may also be simultaneously Includes three parameters for the YUV color space and more. When the image parameter value includes a plurality of parameters, the image parameter value may be regarded as a multi-dimensional value, and the parameters in each dimension may be separately processed. For another example, in the RBG color space, the color is converted into a black and white image of 0-255, and a gray value can be obtained, and the image parameter value can also be a gray value.
应理解,第一双边指数滤波处理部分基于已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离,是指第一双边指数滤波处理可以只基于该差异和距离进行滤波处理,也可以基于包括该差异和距离在内的多个参数进行滤波处理。It should be understood that the first bilateral index filtering processing portion is based on the difference between the image parameter value of the filtered pixel point and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel point and the pixel to be filtered, which refers to the first bilateral index. The filtering process may perform filtering processing based only on the difference and the distance, or may perform filtering processing based on a plurality of parameters including the difference and the distance.
应理解,第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离,具体实现为:第一双边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离。It should be understood that the first bilateral exponential filtering processing portion is based on: a difference between an image parameter value of the filtered pixel point and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel point and the pixel to be filtered, and the specific implementation is: The range filtering kernel function of a bilateral exponential filtering process is based in part on the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered.
应理解,第一双边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离,包括:It should be understood that the range filter function of the first bilateral exponential filter processing is based in part on the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered. ,include:
第一单边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;The range filter function of the first one-sided exponential filter is partially based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
第二单边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离。The range filter function of the second one-sided exponential filter is based in part on the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered.
其中,对于第一单边指数滤波处理来说,该待滤波像素点的图像参数值是指该待滤波像素点在待处理图像中未经过任何滤波处理时的图像参数值;如果该已滤波像素点不是第一单边指数滤波处理的初始已滤波像素点,则该已滤波像素点的图像参数值指待处理图像的像素点经过第一单边指数滤波处理后的图像参数值。For the first one-sided exponential filtering process, the image parameter value of the pixel to be filtered refers to an image parameter value when the pixel to be filtered does not undergo any filtering process in the image to be processed; if the filtered pixel The point is not the initial filtered pixel point of the first one-sided exponential filtering process, and the image parameter value of the filtered pixel point refers to the image parameter value of the pixel of the image to be processed after the first one-sided exponential filtering process.
类似的,对于第二单边指数滤波处理来说,该待滤波像素点的图像参数值是指该待滤波像素点在待处理图像中未经过任何滤波处理时的图像参数值;如果该已滤波像素点不是第二单边指数滤波处理的初始已滤波像素点,该已滤波像素点的图像参数值指待处理图像的像素点经过第二单边指数滤波处理后的图像参数值。Similarly, for the second one-sided exponential filtering process, the image parameter value of the pixel to be filtered refers to an image parameter value when the pixel to be filtered does not undergo any filtering process in the image to be processed; if the filtered The pixel point is not the initial filtered pixel point of the second one-sided exponential filtering process, and the image parameter value of the filtered pixel point refers to the image parameter value of the pixel of the image to be processed after the second one-sided exponential filtering process.
应理解,对于第一单边指数滤波处理来说,该待滤波像素点是该已滤波像素点所在的待处理行/列中下一个经过第一单边指数滤波处理的像素点;对于第二单边指数滤波处理来说,该待滤波像素点是该已滤波像素点所在的待处理行/列中下一个经过第二单边指数滤波处理的像素点。It should be understood that, for the first one-sided exponential filtering process, the pixel to be filtered is the next pixel in the to-be-processed row/column where the filtered pixel is processed by the first one-sided exponential filtering; In the case of the one-sided exponential filtering process, the pixel to be filtered is the next pixel in the to-be-processed row/column in which the filtered pixel is subjected to the second one-sided exponential filtering.
例如,假设待处理图像的某个待处理行,从左到右包括A、B、C共3个像素点。假设第一双边指数滤波处理包括从左到右的第一单边指数滤波处理以及从右到左的第二单边指数滤波处理。则整个滤波处理过程可包括:For example, suppose a certain pending line of the image to be processed includes 3 pixels of A, B, and C from left to right. It is assumed that the first bilateral exponential filtering process includes a first one-sided exponential filtering process from left to right and a second one-sided exponential filtering process from right to left. Then the entire filtering process can include:
(1)对像素点A处理得到像素点A的滤波图像参数值1,其中A为第一单边指数滤波处理的初始已滤波像素点;(1) processing pixel A to obtain a filtered image parameter value of pixel A, where A is the initial filtered pixel of the first one-sided exponential filtering process;
(2)根据已滤波像素点A的滤波图像参数值1、待滤波像素点B的图像参数值,以及像素点A、B的距离,得到经过第一单边指数滤波处理的像素点B的滤波图像参数值2;(2) According to the filtered image parameter value of the filtered pixel point A, the image parameter value of the pixel point B to be filtered, and the distance between the pixel points A and B, the filtering of the pixel point B after the first one-sided exponential filtering process is obtained. Image parameter value 2;
(3)根据已滤波像素点B的滤波图像参数值2、待滤波像素点C的图像参数值,以及像素点B、C的距离,得到经过第一单边指数滤波处理的像素点C的滤波图像参数值3;(3) According to the filtered image parameter value of the filtered pixel point B, the image parameter value of the pixel point C to be filtered, and the distance between the pixel points B and C, the filtering of the pixel point C after the first single-sided exponential filtering process is obtained. Image parameter value 3;
(4)对像素点C处理得到像素点C的滤波图像参数值4,其中C为第二单边指数滤波处理的初始已滤波像素点;(4) processing the pixel point C to obtain a filtered image parameter value 4 of the pixel point C, where C is the initial filtered pixel point of the second one-sided exponential filtering process;
(5)根据已滤波像素点C的滤波图像参数值4、待滤波像素点B的图像参数值,以及像素点B、C的距离,得到经过第二单边指数滤波处理的像素点B的滤波图像参数值5;(5) According to the filtered image parameter value 4 of the filtered pixel point C, the image parameter value of the pixel point B to be filtered, and the distance between the pixel points B and C, the filtering of the pixel point B after the second one-sided exponential filtering process is obtained. Image parameter value 5;
(6)根据已滤波像素点B的滤波图像参数值5、待滤波像素点A的图像参数值,以及像素点A、B的距离,得到经过第二单边指数滤波处理的像素点A的滤波图像参数值6。(6) According to the filtered image parameter value 5 of the filtered pixel point B, the image parameter value of the pixel point A to be filtered, and the distance between the pixel points A and B, the filtering of the pixel point A after the second one-sided exponential filtering process is obtained. Image parameter value 6.
当然,应理解,在上述第一单边指数滤波处理和第二单边指数滤波处理过程中,二者互不干扰且可以并行执行,即步骤(1)-(3)与(4)-(6)两组步骤可以并行执行。Of course, it should be understood that in the first single-sided exponential filtering process and the second one-sided exponential filtering process described above, the two do not interfere with each other and can be executed in parallel, that is, steps (1)-(3) and (4)-( 6) The two sets of steps can be performed in parallel.
应理解,步骤S302中,对该待处理图像进行第一双边指数滤波处理,具体可包括:It should be understood that, in step S302, performing a first bilateral exponential filtering process on the to-be-processed image may specifically include:
根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,其中,该第一待滤波像素点为该第一已滤波像素点在第一方向上进行第一单边指数滤波处理的下一个待滤波像素点。Determining, according to a difference between an image parameter value of the first pixel to be filtered and an image parameter value of the first filtered pixel, and a distance between the first pixel to be filtered and the first filtered pixel, determining that the first pixel to be filtered passes The image parameter value after the first one-sided exponential filtering, wherein the first pixel to be filtered is the next pixel to be filtered in which the first filtered pixel is subjected to the first one-sided exponential filtering in the first direction. .
应理解,如果第一已滤波像素点是第一单边指数滤波处理的初始滤波像素点,则第一已滤波像素点的图像参数值是初始滤波像素点经滤波后的图像参数值;如果第一已滤波像素点不是第一单边指数滤波处理的初始滤波像素点时,则第一已滤波像素点的图像参数值是第一已滤波像素点经过第一单边指数滤波处理后的图像参数值。It should be understood that if the first filtered pixel is the initial filtered pixel of the first one-sided exponential filtering process, the image parameter value of the first filtered pixel is the filtered image parameter value of the initial filtered pixel; When the filtered pixel is not the initial filtered pixel of the first one-sided exponential filtering process, the image parameter value of the first filtered pixel is the image parameter of the first filtered pixel after the first one-sided exponential filtering process. value.
应理解,步骤S302中,对该待处理图像进行第一双边指数滤波处理,具体还可包括:It should be understood that, in step S302, the first bilateral exponential filtering process is performed on the image to be processed, and specifically, the method further includes:
根据第二待滤波像素点的图像参数值与第二已滤波像素点的图像参数值的差异,以及第二待滤波像素点与第二已滤波像素点的距离,确定第二待滤波像素点经过第二单边指数滤波处理后的图像参数值,其中,该第二待滤波像素点为该第二已滤波像素点在第二方向上进行第二单边指数滤波处理的下一个待滤波像素点。Determining, according to a difference between an image parameter value of the second pixel to be filtered and an image parameter value of the second filtered pixel, and a distance between the second pixel to be filtered and the second filtered pixel, determining that the second pixel to be filtered passes a second single-sided exponentially filtered image parameter value, wherein the second pixel to be filtered is a next pixel to be filtered in which the second filtered pixel is subjected to the second one-sided exponential filtering in the second direction .
应理解,如果第二已滤波像素点是第二单边指数滤波处理的初始滤波像素点,则第二已滤波像素点的图像参数值是初始滤波像素点经滤波后的图像参数值;如果第二已滤波像素点不是第二单边指数滤波处理的初始滤波像素点时,则第二已滤波像素点的图像参数值是第二已滤波像素点经过第二单边指数滤波处理后的图像参数值。It should be understood that if the second filtered pixel is the initial filtered pixel of the second one-sided exponential filtering process, the image parameter value of the second filtered pixel is the filtered image parameter value of the initial filtered pixel; When the second filtered pixel is not the initial filtered pixel of the second one-sided exponential filtering process, the image parameter value of the second filtered pixel is the image parameter of the second filtered pixel after the second one-sided exponential filtering process. value.
当然,应理解,步骤S302中,对该待处理图像进行第一双边指数滤波处理还可包括:Of course, it should be understood that, in step S302, performing the first bilateral exponential filtering process on the image to be processed may further include:
根据像素点经过第一单边指数滤波处理后的图像参数值,以及所述像素点经过第二单边指数滤波处理后的图像参数值,确定所述像素点经过所述第一双边指数滤波处理后的图像参数值。Determining, according to the image parameter value after the pixel is subjected to the first one-sided exponential filtering process, and the image parameter value of the pixel point after the second one-sided exponential filtering process, determining that the pixel point passes the first bilateral exponential filtering process Image parameter values after.
例如,根据前述步骤(2)的像素点B的滤波图像参数值2,以及步骤(5)的像素点B的滤波图像参数值5,可确定像素点B经过第一双边指数滤波处理后的图像参数值。For example, according to the filtered image parameter value 2 of the pixel point B of the foregoing step (2) and the filtered image parameter value 5 of the pixel point B of the step (5), the image of the pixel point B after the first bilateral exponential filtering process can be determined. Parameter value.
S303,根据第一双边指数滤波处理的结果,确定该待处理图像的输出图像。S303. Determine an output image of the image to be processed according to a result of the first bilateral index filtering process.
本申请实施例中,通过根据像素点距离和像素点的图像参数值对待处理图像进行双边指数滤波处理,充分考虑了距离和图像参数值对像素点滤波的影响,从而能够使得输出图像具备更好的保边效果和去噪效果,进而提高输出图像的显示质量。In the embodiment of the present application, the bilateral exponential filtering process is performed on the image to be processed according to the pixel point distance and the image parameter value of the pixel point, and the influence of the distance and the image parameter value on the pixel point filtering is fully considered, thereby making the output image better. The edge protection effect and denoising effect improve the display quality of the output image.
为便于理解,下面采用公式对第一双边指数滤波的算法进行描述。For ease of understanding, the algorithm for the first bilateral exponential filtering is described below using a formula.
如步骤S302所述,第一单边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素 点的距离;第二单边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离。为便于理解,本申请提供了一种确定双边指数滤波的值域滤波核函数的方法,如公式(1)所示:As described in step S302, the range filter function of the first one-sided exponential filter is partially based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a filtered pixel to be filtered. The distance of the pixel point; the range filter function of the second single-sided exponential filter is based on: the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the filtered pixel and the pixel to be filtered The distance of the point. For ease of understanding, the present application provides a method for determining a range filter kernel function for bilateral exponential filtering, as shown in equation (1):
Figure PCTCN2018086648-appb-000001
Figure PCTCN2018086648-appb-000001
其中,r(u,v)表示双边指数滤波的值域滤波核函数,u-v表示两个像素点之间的图像参数值差异,σ表示值域滤波系数θ[k]的标准差,dis(u,v)表示两个像素点之间的距离。Where r(u,v) represents the range filter kernel function of the bilateral exponential filter, uv represents the difference in image parameter values between two pixel points, and σ represents the standard deviation of the range filter coefficient θ[k], dis(u , v) represents the distance between two pixel points.
对于第一方向上的第一单边指数滤波,其值域滤波系数θ[k]可用如下公式(2)表示:For the first one-sided exponential filtering in the first direction, the range filter coefficient θ[k] can be expressed by the following formula (2):
Figure PCTCN2018086648-appb-000002
Figure PCTCN2018086648-appb-000002
其中,
Figure PCTCN2018086648-appb-000003
表示像素点k的前一个经过第一单边指数滤波处理的像素点经过滤波处理后的图像参数值。
among them,
Figure PCTCN2018086648-appb-000003
The image parameter value of the pixel after the first one-sided exponential filtering process of the pixel point k is filtered.
结合公式(1)、公式(2),根据值域滤波系数θ[k]的标准差σ、空间相对延迟系数α、中间系数
Figure PCTCN2018086648-appb-000004
对于值域滤波系数θ[k],可用如下公式(3)表示:
Combining formula (1) and formula (2), according to the standard deviation σ of the range filter coefficient θ[k], the spatial relative delay coefficient α, and the intermediate coefficient
Figure PCTCN2018086648-appb-000004
For the range filter coefficient θ[k], it can be expressed by the following formula (3):
Figure PCTCN2018086648-appb-000005
Figure PCTCN2018086648-appb-000005
其中,d表示像素点k和像素点k-1之间的间距。Where d represents the spacing between pixel point k and pixel point k-1.
此外,像素点k经过第一单边指数滤波后的图像参数值
Figure PCTCN2018086648-appb-000006
可以用像素点k滤波前的图像参数值x[k]、像素点k在第一方向上的前一个像素点k-1经过第一单边指数滤波处理后的图像参数值
Figure PCTCN2018086648-appb-000007
以及第一单边指数滤波处理的值域滤波系数θ[k]表示,如公式(4)所示:
In addition, the image parameter value of the pixel point k after the first one-sided exponential filtering
Figure PCTCN2018086648-appb-000006
The image parameter value of the image parameter value x[k] before the pixel point k filtering and the previous pixel point k-1 of the pixel point k in the first direction may be subjected to the first one-sided exponential filtering process.
Figure PCTCN2018086648-appb-000007
And the range filter coefficient θ[k] of the first one-sided exponential filter processing is expressed as shown in the formula (4):
Figure PCTCN2018086648-appb-000008
Figure PCTCN2018086648-appb-000008
当然,应理解,如果像素点k-1是第一单边指数滤波处理的初始滤波像素点,则
Figure PCTCN2018086648-appb-000009
表示初始滤波像素点滤波后的图像参数值。
Of course, it should be understood that if pixel point k-1 is the initial filtered pixel of the first one-sided exponential filtering process, then
Figure PCTCN2018086648-appb-000009
Indicates the image parameter value after initial filtering pixel filtering.
结合公式(3)、(4),像素点k经过第一单边指数滤波后的图像参数值
Figure PCTCN2018086648-appb-000010
可用公式(5)表示:
Combining the formulas (3) and (4), the image parameter value of the pixel point k after the first one-sided exponential filtering
Figure PCTCN2018086648-appb-000010
It can be expressed by formula (5):
Figure PCTCN2018086648-appb-000011
Figure PCTCN2018086648-appb-000011
当然,对于第二方向上的第二单边指数滤波,其值域滤波系数ρ[k]可用如下公式(6)表示:Of course, for the second one-sided exponential filtering in the second direction, the range filter coefficient ρ[k] can be expressed by the following formula (6):
ρ[k]=r(x[k],φ[k+1])  (6)ρ[k]=r(x[k],φ[k+1]) (6)
此外,像素点k经过第二单边指数滤波后的图像参数值φ[k],可以用像素点k滤波前的图像参数值x[k]、像素点k在第二方向上的前一个像素点k+1经过第二单边指数滤波处理后的图像参数值φ[k+1]、以及第二单边指数滤波的值域滤波系数φ[k]表示,如公式(7)所示:In addition, the image point value φ[k] of the pixel point k after the second one-sided exponential filtering may be the image parameter value x[k] before the pixel point k filtering, and the previous pixel of the pixel point k in the second direction. The point k+1 is represented by the image parameter value φ[k+1] after the second one-sided exponential filter processing and the range filter coefficient φ[k] of the second one-sided exponential filter, as shown in the formula (7):
φ[k]=(1-ρ[k]λ)x[k]+ρ[k]λφ[k+1]  (7)Φ[k]=(1-ρ[k]λ)x[k]+ρ[k]λφ[k+1] (7)
类似地,如果像素点k+1是第二单边指数滤波处理的初始滤波像素点,则
Figure PCTCN2018086648-appb-000012
表示初始滤波像素点滤波后的图像参数值。
Similarly, if pixel point k+1 is the initial filtered pixel of the second one-sided exponential filtering process, then
Figure PCTCN2018086648-appb-000012
Indicates the image parameter value after initial filtering pixel filtering.
结合公式(1)、(6)、(7),像素点k经过第二单边指数滤波后的图像参数值φ[k]可用公式(8)表示:Combined with the formulas (1), (6), and (7), the image parameter value φ[k] of the pixel point k after the second one-sided exponential filtering can be expressed by the formula (8):
Figure PCTCN2018086648-appb-000013
Figure PCTCN2018086648-appb-000013
当然,从上述公式(5)、(8)可以看出,双边指数滤波处理在计算每个待滤波像素点时,涉及加法、减法、乘法、除法、幂运算等多次运算,其运算消耗较大,存在较大的计算效率提升空间。Of course, it can be seen from the above formulas (5) and (8) that the double-index filter processing involves multiple operations such as addition, subtraction, multiplication, division, and power operation when calculating each pixel to be filtered. Large, there is a large space for improvement in computing efficiency.
在本申请实施例中,可通过多种方式优化计算效率,提高图像处理的效率,为实时美颜处理提供了较好的图像处理方式。In the embodiment of the present application, the calculation efficiency can be optimized in various ways, the efficiency of image processing is improved, and a better image processing mode is provided for real-time beauty processing.
下面以第一方向上的第一单边指数滤波处理为例说明。当然,应理解,第二方向上的第二单边指数滤波处理也可以采用相同或类似的方法。The following describes the first single-sided exponential filtering process in the first direction as an example. Of course, it should be understood that the second single-sided exponential filtering process in the second direction may also adopt the same or similar method.
可选地,作为一个实施例,步骤S302中,根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,具体可实现为:Optionally, in an embodiment, in step S302, according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and the first filtered The distance of the pixel determines the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process, which can be implemented as follows:
根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。Determining the first pixel to be filtered according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the distance between the first pixel to be filtered and the first filtered pixel The image parameter value after the first one-sided exponential filtering is processed.
本申请实施例中,通过查表获取待滤波像素点滤波后的图像参数值,可以大大提升双边指数滤波处理的计算效率。本申请实施例的方法,可应用于实时美颜的场景中,能够应用于桌面端或移动端的实时视频处理,达到实时美颜的效果。In the embodiment of the present application, the image parameter value after filtering the pixel to be filtered is obtained by looking up the table, which can greatly improve the calculation efficiency of the bilateral exponential filtering process. The method of the embodiment of the present application can be applied to a real-time beauty scene, and can be applied to real-time video processing on the desktop or the mobile end to achieve real-time beauty effects.
当然,应理解,待滤波像素点的图像参数值、已滤波像素点的图像参数值等的精度要求和查表的精度要求可能存在差异。例如,以灰度值为例,假设待滤波像素点的图像参数值和已滤波像素点的图像参数值的精度都为0.01,而查表精度为0.25,则需要根据查表精度进一步确定待滤波像素点的图像参数值和已滤波像素点的图像参数值对应的查表图像参数值。Of course, it should be understood that there may be a difference in the accuracy requirements of the image parameter values of the pixels to be filtered, the image parameter values of the filtered pixels, and the accuracy requirements of the look-up table. For example, taking the gray value as an example, it is assumed that the image parameter value of the pixel to be filtered and the image parameter value of the filtered pixel point are both 0.01, and the table lookup precision is 0.25, then the filter to be further determined according to the table lookup precision is to be determined. The lookup image parameter value corresponding to the image parameter value of the pixel and the image parameter value of the filtered pixel.
在本申请实施例中,对于两个查表参数,可能存在如下几种查表方式:In the embodiment of the present application, for the two table lookup parameters, there may be the following methods for table lookup:
可选地,作为一个实施例,根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,具体可实现为:Optionally, as an embodiment, the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the distance between the first pixel to be filtered and the first filtered pixel The lookup table determines image parameter values of the first pixel to be filtered after the first one-sided exponential filtering process, which can be implemented as follows:
根据第一查表精度值和第一待滤波像素点的图像参数值确定第一查表图像参数值;Determining, according to the first lookup table precision value and the image parameter value of the first pixel to be filtered, a first lookup table image parameter value;
根据第二查表精度值和第一已滤波像素点的图像参数值确定第二查表图像参数值;Determining a second look-up table image parameter value according to the second look-up table precision value and the image parameter value of the first filtered pixel point;
根据该第一查表图像参数值、该第二查表图像参数值和该距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。And determining, according to the first look-up table image parameter value, the second look-up table image parameter value, and the distance, an image parameter value after the first single-sided exponential filtering process is performed on the first pixel to be filtered.
可选地,作为另一个实施例,根据第一待滤波像素点的图像参数值、第一已滤波像素点的图像参数值,以及待滤波像素点与已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,具体可实现为:Optionally, as another embodiment, determining, according to an image parameter value of the first pixel to be filtered, an image parameter value of the first filtered pixel, and a distance between the pixel to be filtered and the filtered pixel, The image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process can be implemented as follows:
根据第二查表精度值和第一已滤波像素点的图像参数值确定第二查表图像参数值;Determining a second look-up table image parameter value according to the second look-up table precision value and the image parameter value of the first filtered pixel point;
根据第一待滤波像素点的图像参数值,该第二查表图像参数值,以及该距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。And determining, according to the image parameter value of the first pixel to be filtered, the second look-up table image parameter value, and the distance, determining, by using a look-up table, the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process.
可选地,作为再一个实施例,根据第一待滤波像素点的图像参数值、第一已滤波像素点的图像参数值,以及待滤波像素点与已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,具体可实现为:Optionally, as another embodiment, determining, according to the image parameter value of the first pixel to be filtered, the image parameter value of the first filtered pixel, and the distance between the pixel to be filtered and the filtered pixel, The image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process can be implemented as follows:
根据第一查表精度值和第一待滤波像素点的图像参数值确定第一查表图像参数值;Determining, according to the first lookup table precision value and the image parameter value of the first pixel to be filtered, a first lookup table image parameter value;
根据该第一查表图像参数值,已滤波像素点经过该第一单边指数滤波处理后的图像 参数,以及待滤波像素点与已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。And determining, according to the first look-up table image parameter value, the image parameter after the filtered pixel point is processed by the first one-sided exponential filter, and the distance between the pixel to be filtered and the filtered pixel, and determining the first pixel to be filtered by looking up the table The image parameter value after the first one-sided exponential filtering is processed.
当然,应理解,根据不同的精度要求,可通过不同的方式加速查表过程。下面以根据第二查表精度值和第一已滤波像素点的图像参数值确定第二查表图像参数值为例进行说明。Of course, it should be understood that the look-up process can be accelerated in different ways according to different accuracy requirements. The following is an example of determining the value of the second look-up table image parameter according to the second look-up table precision value and the image parameter value of the first filtered pixel point.
可选地,作为一个实施例,如果该第二查表精度值为0.1 n,则可确定第一已滤波像素点的图像参数值乘以10 n后的图像参数值的整数部分为第二查表图像参数值。其中,n为正整数。 Optionally, as an embodiment, if the second table lookup precision value is 0.1 n , determining that the image parameter value of the first filtered pixel point is multiplied by an integer part of the image parameter value after 10 n is the second check. Table image parameter values. Where n is a positive integer.
由于第一已滤波像素点的图像参数值是计算后的数值,通常采用浮点数表示。单精度浮点数的精度是小数点后7位,即0.0000001。然而,对于图像算法来说,这样的精度往往是过高的,考虑到人眼对色阶的分辨率,可适当降低算法运行精度,以提升运算速度。假设保留小数点后3位,即每次查表需要定位的位置由
Figure PCTCN2018086648-appb-000014
确定,其中
Figure PCTCN2018086648-appb-000015
存储的为单精度浮点数。其计算效率的提高效果可如图4所示。
Since the image parameter value of the first filtered pixel is a calculated value, it is usually expressed in floating point numbers. The precision of a single-precision floating-point number is 7 digits after the decimal point, which is 0.0000001. However, for image algorithms, such precision is often too high. Considering the resolution of the human eye to the color gradation, the accuracy of the algorithm can be appropriately reduced to improve the operation speed. Assume that the 3 digits after the decimal point are reserved, that is, the position to be positioned each time the table is looked up is
Figure PCTCN2018086648-appb-000014
Ok, where
Figure PCTCN2018086648-appb-000015
Stored as a single-precision floating point number. The improvement effect of the calculation efficiency can be as shown in FIG. 4.
图4是本申请的一个实施例的处理帧数效果对比图。其中,原始算法的柱状图表示直接通过计算得到滤波值的处理帧数,查表优化的柱状图表示通过结合精度修正进行查表优化得到滤波值的处理帧数。从图4可见,通过查表可大大优化计算效率,以提高图像处理效率,达到实时美颜的要求。4 is a comparison diagram of the effect of processing the number of frames in one embodiment of the present application. The histogram of the original algorithm represents the number of processing frames obtained by directly calculating the filtered values, and the histogram optimized by the table table indicates the number of processed frames obtained by the table matching optimization to obtain the filtered values. It can be seen from Fig. 4 that the calculation efficiency can be greatly optimized by looking up the table to improve the image processing efficiency and achieve the real-time beauty requirements.
可选地,作为另一个实施例,如果该第二查表精度值为0.5 n,则可确定第一已滤波像素点的图像参数值左移n位后的整数部分为第二查表图像参数值。其中,n为正整数。 Optionally, as another embodiment, if the second table lookup precision value is 0.5 n , determining that the image parameter value of the first filtered pixel point is shifted to the left by n bits is the second look-up table image parameter. value. Where n is a positive integer.
由于计算机形成等的原因,以2的整数倍乘除只需要简单的移位即可。为此,上文所述的
Figure PCTCN2018086648-appb-000016
的精度,即第二图像参数值的精度可以进一步压缩。例如,可以取0.25的精度,此时只需要左移2位即可。实验证明,这样的精度范围足够满足人眼对色阶的分辨率的精度要求,既能够满足美颜的效果,也能够保证美颜的实时性。
For reasons such as computer formation, multiplication and division by an integer of 2 requires only a simple shift. To this end, as described above
Figure PCTCN2018086648-appb-000016
The accuracy of the second image parameter value can be further compressed. For example, you can take 0.25 precision, you only need to shift 2 bits to the left. Experiments have shown that such an accuracy range is sufficient to meet the accuracy requirements of the human eye for the resolution of the color gradation, which can satisfy the beauty effect and ensure the real-time beauty of the beauty.
具体的,根据x[k]∈[0,255],且为整数,
Figure PCTCN2018086648-appb-000017
精度为0.25,所以可以动态生成一张255*255*4的查找表。这样,每个滤波结果只需要一次查表和若干移位和加法操作即可,相比于原始算法,几乎不需要运算即可求得结果。如果左移10位,则等于乘以1024,与前面的0.001的精度要求相差无几,既保证了精度要求,也避免了乘法运算。其计算效率的提高效果可如图5所示。
Specifically, according to x[k]∈[0,255], and is an integer,
Figure PCTCN2018086648-appb-000017
The precision is 0.25, so a 255*255*4 lookup table can be dynamically generated. In this way, each filtering result only needs one table lookup and several shifting and adding operations. Compared with the original algorithm, almost no operation is needed to obtain the result. If the left shift is 10 bits, it is equal to multiplying by 1024, which is almost the same as the previous 0.001 precision requirement, which not only ensures the accuracy requirement but also avoids the multiplication operation. The improvement effect of the calculation efficiency can be as shown in FIG. 5.
图5是本申请的一个实施例的处理帧数效果对比图。图5中原始算法和查表优化对 应的柱状图的含义与图4中对应的柱状图的含义相同。此外,图5的浮点整型优化表示通过移位操作后再查表得到滤波值的处理帧数。从图5可以看出,直接进行移位操作要比乘法操作快很多。本申请实施例中,通过结合查表和移位操作,可以进一步提高图像处理效率,从而进一步提升图像美颜的实时性。FIG. 5 is a comparison diagram of the effect of processing the number of frames in one embodiment of the present application. The meaning of the histogram corresponding to the original algorithm and table lookup optimization in Fig. 5 is the same as that of the corresponding histogram in Fig. 4. In addition, the floating-point integer optimization of FIG. 5 represents the number of processed frames obtained by the look-up operation after the shift operation. As can be seen from Figure 5, the direct shift operation is much faster than the multiplication operation. In the embodiment of the present application, by combining the table lookup and the shift operation, the image processing efficiency can be further improved, thereby further improving the real-time performance of the image beauty.
可选地,作为另一个实施例,如果该第二查表精度值为2 n,则可确定第一已滤波像素点的图像参数值右移n位后的整数部分为第二查表图像参数值。其中,n为正整数。 Optionally, as another embodiment, if the second table lookup precision value is 2 n , determining that the image parameter value of the first filtered pixel point is shifted right by n bits is the second look-up table image parameter. value. Where n is a positive integer.
例如,如果第二查表精度值要求是4,则此时需要对该第二图像参数值右移2位。For example, if the second lookup table accuracy value requirement is 4, then the second image parameter value needs to be shifted to the right by 2 bits.
通过采用右移的方法,可以避免除法运算,也能够提高计算效率。By using the right shift method, the division operation can be avoided, and the calculation efficiency can be improved.
此外,应理解,在对待处理图像进行双边指数滤波处理的过程中,还可对待处理图像进行增益滤波处理。In addition, it should be understood that in the process of performing bilateral exponential filtering processing on the image to be processed, the image to be processed may also be subjected to gain filtering processing.
可选地,在确定待处理图像的输出图像之前,该方法还包括:根据该待处理图像各像素点滤波前的图像参数值,确定该待处理图像各像素点的增益滤波结果;Optionally, before determining the output image of the image to be processed, the method further includes: determining, according to the image parameter value before filtering each pixel of the image to be processed, a gain filtering result of each pixel of the image to be processed;
根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像,具体实现为:根据该第一双边指数滤波处理的结果,以及该待处理图像各像素点的增益滤波结果,确定该待处理图像的输出图像。Determining, according to the result of the first bilateral index filtering process, the output image of the image to be processed, according to the result of the first bilateral exponential filtering process, and the gain filtering result of each pixel of the image to be processed, determining the The output image of the image to be processed.
例如,对于像素点k,其增益滤波后的结果g[k]可用如下公式(9)表示:For example, for pixel k, the gain-filtered result g[k] can be expressed by the following formula (9):
g[k]=mu×x[k]  (9)g[k]=mu×x[k] (9)
其中,mu表示增益滤波系数。Where mu represents the gain filter coefficient.
最后,将滤波结果进行组和,从而得到像素点k最终输出的图像参数值a[k]。具体如公式(15)所示:Finally, the filtered results are grouped to obtain the image parameter value a[k] which is finally output by the pixel point k. Specifically, as shown in formula (15):
Figure PCTCN2018086648-appb-000018
Figure PCTCN2018086648-appb-000018
当然,应理解,对于给定的输入参数空间相对延迟来说,增益滤波后的值仅仅是一次乘法操作,同样适合查表优化。Of course, it should be understood that for a given input parameter space relative delay, the gain filtered value is only a multiplication operation, and is also suitable for table lookup optimization.
具体地,根据该待处理图像各像素点滤波前的图像参数值,确定该待处理图像各像素点的增益滤波结果,具体可实现为:Specifically, the gain filtering result of each pixel of the image to be processed is determined according to the image parameter value before filtering of each pixel of the image to be processed, and the specific implementation may be:
根据该待处理图像各像素点滤波前的图像参数值,通过查表确定该待处理图像各像素点的增益滤波结果。The gain filtering result of each pixel of the image to be processed is determined by looking up the table according to the image parameter value before filtering of each pixel of the image to be processed.
例如,为了与通过查表获取单边指数滤波处理后的滤波图像参数值的方法更好衔接,可将查找映射表结果经过左移10位放大,既保证了精度要求,也避免了乘法运算。本申 请实施例中,通过查表进行增益滤波处理,可以进一步提高图像处理效率,从而进一步提升图像美颜的实时性。For example, in order to better integrate with the method of obtaining the filtered image parameter value after the one-sided exponential filtering process by looking up the table, the result of the lookup mapping table can be shifted by 10 bits to the left, which not only ensures the accuracy requirement but also avoids the multiplication operation. In the embodiment of the present application, the gain filtering process is performed by looking up the table, thereby further improving the image processing efficiency, thereby further improving the real-time performance of the image beauty.
图6是本申请的再一个实施例的处理帧数效果对比图。图6中原始算法和查表优化对应的柱状图的含义与图4中对应的柱状图的含义相同,图6中浮点整型优化与图5中对应的柱状图的含义相同。此外,图6的最优化表示通过移位操作后再查表,并在增益滤波阶段也进行查表得到滤波值的处理帧数。从图6可以看出,最优化的情况下,要比最原始的算法提高近10倍。下表示出了几种算法在不同运行平台下处理一帧图像的用时对比。FIG. 6 is a comparison diagram of the effect of processing the number of frames in still another embodiment of the present application. The meaning of the histogram corresponding to the original algorithm and the table lookup optimization in FIG. 6 is the same as that of the corresponding histogram in FIG. 4. The floating point integer optimization in FIG. 6 has the same meaning as the corresponding histogram in FIG. In addition, the optimization of FIG. 6 indicates that the table is looked up after the shift operation, and the number of processing frames of the filtered value is also obtained by looking up the table in the gain filtering stage. As can be seen from Figure 6, in the case of optimization, it is nearly 10 times higher than the original algorithm. The table below shows the time-to-time comparison of several algorithms for processing one frame of image on different operating platforms.
Figure PCTCN2018086648-appb-000019
Figure PCTCN2018086648-appb-000019
从上述表格可以看出,采用不同的算法的用时对比相差极大。As can be seen from the above table, the time-of-use comparisons using different algorithms are extremely different.
当然,应理解,前述的查表操作虽然只是对第一单边指数滤波处理时进行的查表操作,但也适用于第二单边指数滤波处理。此外,本申请实施例的查表方法,也可用于高斯滤波等其它滤波算法中,本申请实施例在此不再赘述。Of course, it should be understood that the foregoing table lookup operation is only for the table lookup operation performed during the first one-sided exponential filter processing, but is also applicable to the second one-sided exponential filter processing. In addition, the look-up table method in the embodiment of the present application may also be used in other filtering algorithms such as Gaussian filtering, and details are not described herein again.
图7是本申请的一个实施例最优化方法下的滤波效果对比图。从图7可以看出,经过本申请实施例的图像处理方法处理的图像,具备非常明显的去噪磨皮效果。FIG. 7 is a comparison diagram of filtering effects under an optimization method of an embodiment of the present application. As can be seen from FIG. 7, the image processed by the image processing method of the embodiment of the present application has a very significant denoising and dermabrasion effect.
可选地,第一双边指数滤波处理的方向与该待处理图像的行平行;或者,第一双边指数滤波处理的方向与该待处理图像的列平行。Optionally, the direction of the first bilateral exponential filtering process is parallel to the row of the image to be processed; or the direction of the first bilateral exponential filtering process is parallel to the column of the image to be processed.
应理解,通过在水平方向或垂直方向上进行双边指数滤波处理,有利于待处理图像的分割,以便进行并行处理。It should be understood that by performing bilateral exponential filtering processing in the horizontal direction or the vertical direction, segmentation of an image to be processed is facilitated for parallel processing.
应理解,在本申请实施例中,上述方法可用FIR滤波器执行。对于一维方向的滤波处理,可采用一维FIR滤波器,对于二维方向上的滤波处理,可采用二维FIR滤波器。It should be understood that, in the embodiment of the present application, the above method may be performed by using an FIR filter. For the filtering process in the one-dimensional direction, a one-dimensional FIR filter can be used, and for the filtering process in the two-dimensional direction, a two-dimensional FIR filter can be used.
当然,应理解,对于图像,FIR滤波器非常适合并行处理。可以通过同时处理2个或n个图像像素行,或者同时处理2个或n个图像像素列,加快图像处理的速度,从而进一步提升图像美颜的实时性。Of course, it should be understood that for images, the FIR filter is well suited for parallel processing. The image processing speed can be speeded up by simultaneously processing 2 or n image pixel rows or simultaneously processing 2 or n image pixel columns, thereby further improving the real-time performance of the image.
此时,步骤S301具体可实现为:按照用于图像处理的处理器数量,对输入图像进行分片处理得到多个该待处理图像,其中,该输入图像的分片处理的分片位置平行于对该待处理图像进行该第一双边指数滤波处理时的处理方向;At this time, the step S301 is specifically implemented as: performing a fragmentation process on the input image according to the number of processors for image processing to obtain a plurality of the to-be-processed images, wherein the slice position of the slice processing of the input image is parallel to Processing direction when the first bilateral exponential filtering process is performed on the image to be processed;
在步骤S303之后,该方法还包括:根据该多个该待处理图像的输出图像,合成该输入图像滤波后的输出图像。After step S303, the method further comprises: synthesizing the output image filtered by the input image according to the output images of the plurality of images to be processed.
图8是本申请的一个实施例并行图像处理的示意图。一种具体的实现方式如图8所示,本申请实施例的图像处理系统可分为算法初始化模块和算法处理模块。Figure 8 is a schematic illustration of parallel image processing of one embodiment of the present application. A specific implementation manner is shown in FIG. 8. The image processing system in the embodiment of the present application can be divided into an algorithm initialization module and an algorithm processing module.
在算法初始化模块,在启动算法初始化后,可包括如下步骤:In the algorithm initialization module, after the startup algorithm is initialized, the following steps may be included:
(1)获取CPU个数。(1) Get the number of CPUs.
通过获取用于进行图像处理的CPU个数,可确定能够创建几个并行的线程。By taking the number of CPUs used for image processing, it can be determined that several parallel threads can be created.
(2)创建并行线程结构等。(2) Create a parallel thread structure, etc.
根据用于进行图像处理的CPU个数,创建1至n个处理线程。One to n processing threads are created according to the number of CPUs used for image processing.
(3)通过运行模块运行线程。(3) Run the thread by running the module.
如果存在多个线程,则通过运行模块运行多个并行线程,并将每个线程的输出结果汇总;如果只存在一个线程,则通过运行模块运行该线程。If there are multiple threads, run multiple parallel threads by running the module and summarize the output of each thread; if there is only one thread, run the module by running the module.
在算法处理模块,在输入图像后,可包括如下步骤:In the algorithm processing module, after inputting the image, the following steps may be included:
(1)根据初始化设定决定是否使用并行结构。(1) Determine whether or not to use the parallel structure based on the initialization settings.
如果算法初始化模块只创建了1个处理线程,则显然不需要使用并行结构;如果算法初始化模块创建了多个处理线程,则需要使用并行结构。If the algorithm initialization module only creates one processing thread, then obviously no parallel structure is needed; if the algorithm initialization module creates multiple processing threads, then a parallel structure is needed.
(2)根据是否使用并行结构进行图像分片处理。(2) Image segmentation processing is performed depending on whether or not a parallel structure is used.
如果只有一个线程,则不需要分片,或者说只分成一片;如果有n个线程,则把输入图像分成n片。If there is only one thread, no fragmentation is required, or only one slice is divided; if there are n threads, the input image is divided into n slices.
(3)将分片后的图像发给运行模块处理。(3) Send the fragmented image to the running module for processing.
(4)接收各个线程的处理结果,并生成处理后图像。(4) Receive the processing result of each thread and generate a processed image.
如果初始化设定决定使用并行结构,则步骤4是必需的。处理器还需要对多个并行 线程处理后的结果进行合并处理,生成处理后图像;Step 4 is required if the initialization settings decide to use a parallel structure. The processor also needs to combine the processed results of the multiple parallel threads to generate a processed image;
如果初始化设定决定不使用并行结构,则步骤4可不执行。If the initialization setting decides not to use the parallel structure, step 4 may not be performed.
(5)输出图像(5) Output image
当然,应理解,图8的运行模块中每个线程执行的方法可参考图3所示实施例的方法,本申请实施例在此不再赘述。Of course, it should be understood that the method performed by each thread in the running module of FIG. 8 may refer to the method in the embodiment shown in FIG. 3, and details are not described herein again.
当然,应理解,上述方法只是对一个维度方向上的滤波。对于二维图像,往往需要在两个维度上进行滤波,即除了对像素横向滤波,还需对像素进行纵向滤波。纵向滤波的具体算法可参考前述横向滤波的算法,将其中的横向坐标参数替换成纵向坐标参数。Of course, it should be understood that the above method is only filtering in one dimension direction. For two-dimensional images, it is often necessary to filter in two dimensions, that is, in addition to lateral filtering of the pixels, the pixels need to be longitudinally filtered. The specific algorithm of the longitudinal filtering can refer to the foregoing transverse filtering algorithm, and replace the horizontal coordinate parameter with the longitudinal coordinate parameter.
可选地,该待处理图像中与该第一双边指数滤波处理方向垂直的待处理列/行包括位于端点的已滤波像素和至少一个待滤波像素点;在步骤S303之前,该方法还包括:Optionally, the to-be-processed column/row in the image to be processed that is perpendicular to the direction of the first bilateral index filtering process includes the filtered pixel at the endpoint and the at least one pixel to be filtered; before the step S303, the method further includes:
在与第一双边指数滤波处理的方向垂直的方向上,从该待处理图像的待处理列/行的端点开始对该待处理图像进行第二双边指数滤波处理,其中,该第二双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;And in a direction perpendicular to a direction of the first bilateral exponential filtering process, performing a second bilateral exponential filtering process on the to-be-processed image from an endpoint of the to-be-processed column/row of the image to be processed, wherein the second bilateral exponential filtering The processing part is based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像包括:根据该第一双边指数滤波处理的结果,以及该第二双边指数滤波处理的结果,确定该待处理图像的输出图像。Determining the output image of the image to be processed according to the result of the first bilateral index filtering process comprises: determining an output of the image to be processed according to a result of the first bilateral exponential filtering process and a result of the second bilateral exponential filtering process image.
本申请实施例中,通过在相互垂直的两个方向上进行双边指数滤波处理,从而能够从两个不同维度对图像进行滤波处理,使得输出图像具备更好的保边效果和去噪效果,进而提高输出图像的显示质量。In the embodiment of the present application, by performing bilateral exponential filtering processing in two directions perpendicular to each other, the image can be filtered from two different dimensions, so that the output image has better edge-preserving effect and denoising effect, and further Improve the display quality of the output image.
图9是本申请的一个实施例电子设备的结构示意图。请参考图9,在硬件层面,该电子设备包括处理器,可选地还包括内部总线、网络接口、存储器。其中,存储器可能包含内存,例如高速随机存取存储器(Random-Access Memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少1个磁盘存储器等。当然,该电子设备还可能包括其他业务所需要的硬件。FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to FIG. 9, at the hardware level, the electronic device includes a processor, optionally including an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. Of course, the electronic device may also include hardware required for other services.
处理器、网络接口和存储器可以通过内部总线相互连接,该内部总线可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA(Extended Industry Standard Architecture,扩展工业标准结构)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。The processor, the network interface, and the memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended) Industry Standard Architecture, extending the industry standard structure) bus. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one double-headed arrow is shown in Figure 9, but it does not mean that there is only one bus or one type of bus.
存储器,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器可以包括内存和非易失性存储器,并向处理器提供指令和数据。Memory for storing programs. In particular, the program can include program code, the program code including computer operating instructions. The memory can include both memory and non-volatile memory and provides instructions and data to the processor.
处理器从非易失性存储器中读取对应的计算机程序到内存中然后运行,在逻辑层面上形成图像处理装置。处理器,执行存储器所存放的程序,并具体用于执行以下操作:The processor reads the corresponding computer program from the non-volatile memory into memory and then operates to form an image processing device at a logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:
被安排成存储计算机可执行指令的存储器,该可执行指令在被执行时使该处理器执行以下操作:A memory arranged to store computer executable instructions that, when executed, cause the processor to perform the following operations:
获取待处理图像,该待处理图像的待处理行/列包括位于端点的已滤波像素和至少一个待滤波像素点;Obtaining a to-be-processed image, the to-be-processed row/column of the to-be-processed image includes the filtered pixel at the endpoint and at least one pixel to be filtered;
从该待处理图像的待处理行/列的端点开始对该待处理图像进行第一双边指数滤波处理,其中,该第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Performing a first bilateral exponential filtering process on the to-be-processed image from the end of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: image parameter values of the filtered pixel point and to be filtered The difference between the image parameter values of the pixel and the distance between the filtered pixel and the pixel to be filtered;
根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像。Based on the result of the first bilateral exponential filtering process, an output image of the image to be processed is determined.
上述如本申请图3所示实施例揭示的图像处理装置执行的方法可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。The method performed by the image processing apparatus disclosed in the embodiment shown in FIG. 3 of the present application may be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processor (DSP), dedicated integration. Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method.
该电子设备还可执行图3的方法,并实现图像处理装置在图3所示实施例的功能,本申请实施例在此不再赘述。The electronic device can also perform the method of FIG. 3 and implement the functions of the image processing apparatus in the embodiment shown in FIG. 3. The embodiments of the present application are not described herein again.
当然,除了软件实现方式之外,本申请的电子设备并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个 逻辑单元,也可以是硬件或逻辑器件。Of course, in addition to the software implementation, the electronic device of the present application does not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc., that is, the execution body of the following processing flow is not limited to each logical unit. It can also be hardware or logic.
本申请实施例还提出了一种计算机可读存储介质,该计算机可读存储介质存储一个或多个程序,该一个或多个程序包括指令,该指令当被包括多个应用程序的电子设备执行时,能够使该电子设备执行图3所示实施例的方法。The embodiment of the present application further provides a computer readable storage medium storing one or more programs, the one or more programs including instructions that are executed by an electronic device including a plurality of applications The electronic device can be caused to perform the method of the embodiment shown in FIG.
图10是本申请的一个实施例图像处理装置1000的结构示意图。请参考图10,在一种软件实施方式中,图像处理装置可包括:FIG. 10 is a schematic structural diagram of an image processing apparatus 1000 according to an embodiment of the present application. Referring to FIG. 10, in a software implementation, the image processing apparatus may include:
获取单元1010,获取待处理图像,该待处理图像的待处理行/列包括位于端点的已滤波像素和至少一个待滤波像素点;The obtaining unit 1010 is configured to obtain an image to be processed, where the to-be-processed row/column of the image to be processed includes the filtered pixel at the endpoint and at least one pixel to be filtered;
处理单元1020,从该待处理图像的待处理行/列的端点开始对该待处理图像进行第一双边指数滤波处理,其中,该第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;The processing unit 1020 performs a first bilateral exponential filtering process on the to-be-processed image from the endpoint of the to-be-processed row/column of the to-be-processed image, where the first bilateral exponential filtering process is based on: image parameters of the filtered pixel The difference between the value and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered;
确定单元1030,根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像。The determining unit 1030 determines an output image of the image to be processed according to the result of the first bilateral index filtering process.
本申请实施例中,图像处理装置1000通过根据像素点距离和像素点的图像参数值对待处理图像进行双边指数滤波处理,充分考虑了距离和图像参数值对像素点滤波的影响,从而能够使得输出图像具备更好的保边效果和去噪效果,进而提高输出图像的显示质量。In the embodiment of the present application, the image processing apparatus 1000 performs bilateral exponential filtering processing on the image to be processed according to the pixel point distance and the image parameter value of the pixel point, fully considering the influence of the distance and the image parameter value on the pixel point filtering, thereby enabling the output to be made. The image has better edge protection and denoising effects, which improves the display quality of the output image.
应理解,在本申请实施例中,在进行第一双边指数滤波处理时,可对待处理图像进行预处理,使得该待处理图像的每个待处理行/列的两端分别包括第一双边指数滤波处理中以该端开始的单边指数滤波处理的初始已滤波像素点;或者,在获取单元获取的待处理图像中,该待处理图像的每个待处理行/列的两端分别包括第一双边指数滤波处理中以该端开始的单边指数滤波处理的初始已滤波像素点。It should be understood that, in the embodiment of the present application, when performing the first bilateral exponential filtering process, the image to be processed may be preprocessed such that both ends of each to-be-processed row/column of the to-be-processed image respectively include a first bilateral index. The initial filtered pixel point of the single-sided exponential filtering process starting from the end in the filtering process; or, in the image to be processed acquired by the acquiring unit, the two ends of each to-be-processed row/column of the image to be processed respectively include the first The initial filtered pixel of the one-sided exponential filtering process starting with the end in a bilateral exponential filtering process.
应理解,第一双边指数滤波处理包括从该待处理图像的待处理行/列的第一端到第二端的第一方向上的第一单边指数滤波处理,以及从该待处理图像的待处理行/列的第二端到第一端的第二方向上的第二单边指数滤波处理;处理单元1020具体根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,其中,该第一待滤波像素点为该第一已滤波像素点在第一方向上的下一个待滤波像素点。It should be understood that the first bilateral exponential filtering process includes a first one-sided exponential filtering process in a first direction from a first end to a second end of the to-be-processed row/column of the image to be processed, and from the image to be processed Processing a second one-sided exponential filtering process in a second direction from the second end of the row/column to the first end; the processing unit 1020 is specifically configured according to the image parameter value of the first pixel to be filtered and the image of the first filtered pixel a difference between the parameter values, and a distance between the first pixel to be filtered and the first filtered pixel, determining an image parameter value of the first pixel to be filtered after the first one-sided exponential filtering, wherein the first to be filtered The pixel is the next pixel to be filtered in the first direction of the first filtered pixel.
进一步地,处理单元1020具体用于:根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离, 通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。Further, the processing unit 1020 is specifically configured to: according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and the first filtered pixel The distance, the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process is determined by looking up the table.
可选地,在一种具体的实现方式中,处理单元1020根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,具体实现为:Optionally, in a specific implementation manner, the processing unit 1020 is configured to: according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and the first The distance of a filtered pixel point is determined by looking up the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process, and the specific implementation is:
处理单元1020根据第一查表精度值和第一待滤波像素点的图像参数值确定第一查表图像参数值;The processing unit 1020 determines a first look-up table image parameter value according to the first table lookup precision value and the image parameter value of the first pixel to be filtered;
处理单元1020根据第二查表精度值和第一已滤波像素点的图像参数值确定第二查表图像参数值;The processing unit 1020 determines a second look-up table image parameter value according to the second table lookup precision value and the image parameter value of the first filtered pixel point;
处理单元1020根据该第一查表图像参数值、该第二查表图像参数值和该距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。The processing unit 1020 determines, according to the first look-up table image parameter value, the second look-up table image parameter value, and the distance, the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process.
可选地,在另一种具体的实现方式中,处理单元1020根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,具体实现为:Optionally, in another specific implementation manner, the processing unit 1020 is configured to: according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and The distance of the first filtered pixel point is determined by looking up the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process, and the specific implementation is:
处理单元1020根据第二查表精度值和第一已滤波像素点的图像参数值确定第二查表图像参数值;The processing unit 1020 determines a second look-up table image parameter value according to the second table lookup precision value and the image parameter value of the first filtered pixel point;
处理单元1020根据第一待滤波像素点的图像参数值,该第二查表图像参数值,以及该距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。The processing unit 1020 determines, according to the image parameter value of the first pixel to be filtered, the second look-up table image parameter value, and the distance, the image parameter of the first pixel to be filtered after the first one-sided exponential filtering process is determined by looking up the table. value.
可选地,在再一种具体的实现方式中,处理单元1020根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,具体实现为:Optionally, in another specific implementation, the processing unit 1020 is configured to: according to the difference between the image parameter value of the first pixel to be filtered and the image parameter value of the first filtered pixel, and the first pixel to be filtered and The distance of the first filtered pixel point is determined by looking up the image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process, and the specific implementation is:
处理单元1020根据第一查表精度值和第一待滤波像素点的图像参数值确定第一查表图像参数值;The processing unit 1020 determines a first look-up table image parameter value according to the first table lookup precision value and the image parameter value of the first pixel to be filtered;
处理单元1020根据该第一查表图像参数值,已滤波像素点经过该第一单边指数滤波处理后的图像参数,以及待滤波像素点与已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。The processing unit 1020 determines, according to the first look-up table image parameter value, the image parameter after the filtered pixel point passes the first one-sided exponential filtering process, and the distance between the pixel to be filtered and the filtered pixel point, and determines the first by looking up the table. The image parameter value after the first pixel is subjected to the first one-sided exponential filtering.
进一步地,处理单元1020根据第二查表精度值和第一已滤波像素点的图像参数值确定第二查表图像参数值,具体可实现为:Further, the processing unit 1020 determines the second look-up table image parameter value according to the second table lookup precision value and the image parameter value of the first filtered pixel point, which may be specifically implemented as:
当该第二查表精度值为0.1 n时,处理单元1020确定第一已滤波像素点的图像参数值乘以10 n后的图像参数值的整数部分为第二查表图像参数值; When the second lookup table precision value is 0.1 n , the processing unit 1020 determines that the image parameter value of the first filtered pixel point is multiplied by 10 n and the integer part of the image parameter value is the second look-up table image parameter value;
或者,当该第二查表精度值为0.5 n时,处理单元1020确定第一已滤波像素点的图像参数值左移n位后的整数部分为第二查表图像参数值; Alternatively, when the second table lookup precision value is 0.5 n , the processing unit 1020 determines that the integer part of the image parameter value of the first filtered pixel point is shifted to the left by n bits as the second look-up table image parameter value;
或者,当该第二查表精度值为2 n时,处理单元1020确定第一已滤波像素点的图像参数值右移n位后的整数部分为第二查表图像参数值; Alternatively, when the second table lookup precision value is 2 n , the processing unit 1020 determines that the integer part of the image parameter value of the first filtered pixel point is shifted to the right by n bits, and is the second look-up table image parameter value;
其中,n为正整数。Where n is a positive integer.
应理解,处理单元1020还根据第二待滤波像素点的图像参数值与第二已滤波像素点的图像参数值的差异,以及第二待滤波像素点与第二已滤波像素点的距离,确定第二待滤波像素点经过第二单边指数滤波处理后的图像参数值;根据像素点经过第一单边指数滤波处理后的图像参数值,以及该像素点经过第二单边指数滤波处理后的图像参数值,确定该像素点经过该第一双边指数滤波处理后的图像参数值。It should be understood that the processing unit 1020 further determines, according to the difference between the image parameter value of the second pixel to be filtered and the image parameter value of the second filtered pixel, and the distance between the second pixel to be filtered and the second filtered pixel. The image parameter value after the second pixel to be filtered is subjected to the second one-sided exponential filtering; the image parameter value after the pixel is subjected to the first one-sided exponential filtering, and the pixel is subjected to the second one-sided exponential filtering process The image parameter value determines an image parameter value of the pixel after the first bilateral exponential filtering process.
应理解,该第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离,具体可实现为:It should be understood that the first bilateral index filtering processing is based on: a difference between an image parameter value of the filtered pixel point and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel point and the pixel to be filtered, which may be specifically implemented as :
该第一双边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离。The range filter function of the first bilateral exponential filter processing is based in part on the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel and the pixel to be filtered.
更具体地,第一单边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;第二单边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离。More specifically, the range filter function of the first one-sided exponential filter is partially based on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a filtered pixel and a pixel to be filtered. The range of the second-sided exponential filter processing is based on: the difference between the image parameter value of the filtered pixel and the image parameter value of the pixel to be filtered, and the filtered pixel and the pixel to be filtered. distance.
可选地,处理单元1020还在与第一双边指数滤波处理的方向垂直的方向上对该待处理图像进行第二双边指数滤波处理,其中,该第二双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Optionally, the processing unit 1020 further performs a second bilateral exponential filtering process on the image to be processed in a direction perpendicular to a direction of the first bilateral exponential filtering process, where the second bilateral exponential filtering process is partially based on: the filtered pixel The difference between the image parameter value of the point and the image parameter value of the pixel to be filtered, and the distance between the filtered pixel point and the pixel to be filtered;
确定单元1030具体根据该第一双边指数滤波处理的结果,以及该第二双边指数滤波处理的结果,确定该待处理图像的输出图像。The determining unit 1030 determines an output image of the image to be processed according to the result of the first bilateral exponential filtering process and the result of the second bilateral exponential filtering process.
当然,应理解,处理单元1020在进行第二双边指数滤波处理,还可对待处理进行预处理,使得该待处理图像的每个待处理列/行的两端分别包括第二双边指数滤波处理中以该端开始的单边指数滤波处理的初始已滤波像素点;或者,获取单元1010获取的待处理图像中,该待处理图像的每个待处理列/行的两端分别包括第二双边指数滤波处理中以该 端开始的单边指数滤波处理的初始已滤波像素点。Of course, it should be understood that the processing unit 1020 performs the second bilateral exponential filtering process, and may also perform preprocessing on the processing, so that both ends of each to-be-processed column/row of the to-be-processed image respectively include the second bilateral exponential filtering process. An initial filtered pixel that is processed by the one-sided exponential filtering that starts at the end; or, in the image to be processed acquired by the acquiring unit 1010, both ends of each to-be-processed column/row of the image to be processed include a second bilateral index The initial filtered pixel point of the filtering process that is processed by the one-sided exponential filtering starting at the end.
可选地,该第一双边指数滤波处理的方向与该待处理图像的行平行;或者,该第一双边指数滤波处理的方向与该待处理图像的列平行。Optionally, the direction of the first bilateral exponential filtering process is parallel to the row of the image to be processed; or the direction of the first bilateral exponential filtering process is parallel to the column of the image to be processed.
可选地,图像处理装置还可包括合成单元1040。其中,获取单元1010按照用于图像处理的处理器数量,对输入图像进行分片处理得到多个该待处理图像,其中,该输入图像的分片处理的分片位置平行于对该待处理图像进行该第一双边指数滤波处理时的处理方向;合成单元1040根据该多个该待处理图像的输出图像,合成该输入图像滤波后的输出图像。Alternatively, the image processing apparatus may further include a synthesizing unit 1040. The obtaining unit 1010 performs a fragmentation process on the input image according to the number of processors used for image processing to obtain a plurality of the to-be-processed images, wherein the sliced position of the sliced image of the input image is parallel to the image to be processed. The processing direction when the first bilateral exponential filtering process is performed; the synthesizing unit 1040 synthesizes the output image filtered by the input image according to the output images of the plurality of to-be-processed images.
可选地,确定单元1030还根据该待处理图像各像素点滤波前的图像参数值,确定该待处理图像各像素点的增益滤波结果;其中,确定单元1030根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像,具体实现为:根据该第一双边指数滤波处理的结果,以及该待处理图像各像素点的增益滤波结果,确定该待处理图像的输出图像。Optionally, the determining unit 1030 further determines a gain filtering result of each pixel of the to-be-processed image according to the image parameter value before filtering the pixel of the image to be processed; wherein the determining unit 1030 is configured according to the first bilateral exponential filtering As a result, the output image of the image to be processed is determined by determining the output image of the image to be processed according to the result of the first bilateral index filtering process and the gain filtering result of each pixel of the image to be processed.
进一步地,确定单元1030可根据该待处理图像各像素点滤波前的图像参数值,通过查表确定该待处理图像各像素点的增益滤波结果。Further, the determining unit 1030 may determine, according to the image parameter value before filtering each pixel of the image to be processed, a gain filtering result of each pixel of the image to be processed by using a lookup table.
本申请实施例还提供了一种图像处理系统,该系统包括图10所示实施例中的图像处理装置1000,或者包括图9所示实施例中的电子设备存储的图像处理装置。The embodiment of the present application further provides an image processing system including the image processing device 1000 in the embodiment shown in FIG. 10 or the image processing device stored in the electronic device in the embodiment shown in FIG.
图11是本申请的一个实施例图像处理的方法流程图。图11的方法由图像处理装置执行。在本申请实施例中,该图像处理装置可以是处理器,图形处理器,或者是滤波器如有限长单位冲激响应(Finite Impulse Response,FIR)滤波器等。图11的方法可包括:11 is a flow chart of a method of image processing according to an embodiment of the present application. The method of Figure 11 is performed by an image processing device. In the embodiment of the present application, the image processing device may be a processor, a graphics processor, or a filter such as a finite-length unit impulse response (FIR) filter. The method of Figure 11 can include:
S1101,获取待处理图像,该待处理图像的待处理行/列包括已滤波像素点和至少一个待滤波像素点;S1101: Acquire an image to be processed, where the to-be-processed row/column includes a filtered pixel point and at least one pixel to be processed;
S1102,对该待处理图像的待处理行/列进行第一双边指数滤波处理,其中,该第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;S1102: Perform a first bilateral exponential filtering process on the to-be-processed row/column of the image to be processed, where the first bilateral exponential filtering process is partially based on: an image parameter value of the filtered pixel point and an image parameter value of the pixel to be filtered. Difference, and the distance between the filtered pixel and the pixel to be filtered;
S1103,根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像。S1103. Determine an output image of the image to be processed according to the result of the first bilateral index filtering process.
本申请实施例中,通过根据像素点距离和像素点的图像参数值对待处理图像进行双边指数滤波处理,充分考虑了距离和图像参数值对像素点滤波的影响,从而能够使得输出图像具备更好的保边效果和去噪效果,进而提高输出图像的显示质量。In the embodiment of the present application, the bilateral exponential filtering process is performed on the image to be processed according to the pixel point distance and the image parameter value of the pixel point, and the influence of the distance and the image parameter value on the pixel point filtering is fully considered, thereby making the output image better. The edge protection effect and denoising effect improve the display quality of the output image.
应理解,本申请实施例中,除了待处理图像中已过滤节点不限于待处理行/列的端点位置、开始处理的像素点位置不限于待处理行/列的端点位置外,其它的执行步骤,例如 对该待处理图像的待处理行/列进行第一双边指数滤波处理,以及根据该第一双边指数滤波处理的结果,确定该待处理图像的输出图像,可参考图3所示实施例及其扩展实施例,本申请实施例在此不再赘述。It should be understood that, in the embodiment of the present application, except that the filtered node in the image to be processed is not limited to the end position of the row/column to be processed, and the pixel position to be processed is not limited to the end position of the row/column to be processed, other execution steps are performed. For example, performing a first bilateral exponential filtering process on the to-be-processed row/column of the image to be processed, and determining an output image of the to-be-processed image according to the result of the first bilateral exponential filtering process, and referring to the embodiment shown in FIG. The embodiments of the present application are not described herein again.
本申请实施例还提供了一种电子设备,包括处理器;以及An embodiment of the present application further provides an electronic device, including a processor;
被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行图11所示实施例中的方法。A memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of the embodiment shown in FIG.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序当被电子设备执行时,能够使所述电子设备执行图11所示实施例中的方法。The embodiment of the present application further provides a computer readable storage medium storing one or more programs, the one or more programs, when executed by an electronic device, enable the electronic device to execute The method in the embodiment shown in FIG.
总之,以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。In summary, the above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application are intended to be included within the scope of the present application.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media includes both permanent and non-persistent, removable and non-removable media. Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排 除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It is also to be understood that the terms "comprises" or "comprising" or "comprising" or any other variations are intended to encompass a non-exclusive inclusion, such that a process, method, article, Other elements not explicitly listed, or elements that are inherent to such a process, method, commodity, or equipment. An element defined by the phrase "comprising a ...", without further limitation, does not exclude the presence of additional equivalent elements in the process, method, article, or device that comprises the element.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

Claims (18)

  1. 一种图像处理方法,其特征在于,包括:An image processing method, comprising:
    获取待处理图像,所述待处理图像的待处理行/列包括位于端点的已滤波像素点和至少一个待滤波像素点;Obtaining a to-be-processed image, the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
    从所述待处理图像的待处理行/列的端点开始对所述待处理图像进行第一双边指数滤波处理,其中,所述第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Performing a first bilateral exponential filtering process on the to-be-processed image from an endpoint of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: an image parameter value of the filtered pixel a difference from an image parameter value of a pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
    根据所述第一双边指数滤波处理的结果,确定所述待处理图像的输出图像。And determining an output image of the image to be processed according to a result of the first bilateral index filtering process.
  2. 如权利要求1所述的方法,其特征在于,The method of claim 1 wherein
    第一双边指数滤波处理包括从所述待处理图像的待处理行/列的第一端到第二端的第一方向上的第一单边指数滤波处理,以及从所述待处理图像的待处理行/列的第二端到第一端的第二方向上的第二单边指数滤波处理;The first bilateral exponential filtering process includes a first one-sided exponential filtering process in a first direction from a first end to a second end of the to-be-processed row/column of the image to be processed, and a to-be-processed image from the to-be-processed image a second one-sided exponential filtering process in a second direction from the second end of the row/column to the first end;
    对所述待处理图像进行第一双边指数滤波处理,包括:根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,其中,所述第一待滤波像素点为所述第一已滤波像素点在第一方向上的下一个待滤波像素点。Performing a first bilateral exponential filtering process on the image to be processed, including: a difference between an image parameter value of the first pixel to be filtered and an image parameter value of the first filtered pixel, and a first pixel to be filtered and the first Determining, by the distance of a filtered pixel, an image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process, wherein the first pixel to be filtered is the first filtered pixel The next pixel to be filtered in one direction.
  3. 如权利要求2所述的方法,其特征在于,The method of claim 2 wherein
    对所述待处理图像进行第一双边指数滤波处理,包括:根据第一待滤波像素点的图像参数值与第一已滤波像素点的图像参数值的差异,以及第一待滤波像素点与第一已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。Performing a first bilateral exponential filtering process on the image to be processed, including: a difference between an image parameter value of the first pixel to be filtered and an image parameter value of the first filtered pixel, and a first pixel to be filtered and the first The distance of a filtered pixel point is determined by looking up a table to determine an image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process.
  4. 如权利要求3所述的方法,其特征在于,The method of claim 3 wherein:
    根据第一待滤波像素点的图像参数值、第一已滤波像素点的图像参数值,以及待滤波像素点与已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,包括:Determining, according to the image parameter value of the first pixel to be filtered, the image parameter value of the first filtered pixel, and the distance between the pixel to be filtered and the filtered pixel, determining, by using a table look, that the first pixel to be filtered passes the first single Image parameter values after edge index filtering, including:
    根据第一查表精度值和第一待滤波像素点的图像参数值确定第一查表图像参数值;Determining, according to the first lookup table precision value and the image parameter value of the first pixel to be filtered, a first lookup table image parameter value;
    根据第二查表精度值和第一已滤波像素点的图像参数值确定第二查表图像参数值;Determining a second look-up table image parameter value according to the second look-up table precision value and the image parameter value of the first filtered pixel point;
    根据所述第一查表图像参数值、所述第二查表图像参数值和所述距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。And determining, according to the first look-up table image parameter value, the second look-up table image parameter value, and the distance, an image parameter value after the first single-sided exponential filtering process is performed on the first pixel to be filtered.
  5. 如权利要求3所述的方法,其特征在于,The method of claim 3 wherein:
    根据第一待滤波像素点的图像参数值、第一已滤波像素点的图像参数值,以及待滤波像素点与已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,包括:Determining, according to the image parameter value of the first pixel to be filtered, the image parameter value of the first filtered pixel, and the distance between the pixel to be filtered and the filtered pixel, determining, by using a table look, that the first pixel to be filtered passes the first single Image parameter values after edge index filtering, including:
    根据第二查表精度值和第一已滤波像素点的图像参数值确定第二查表图像参数值;Determining a second look-up table image parameter value according to the second look-up table precision value and the image parameter value of the first filtered pixel point;
    根据第一待滤波像素点的图像参数值,所述第二查表图像参数值,以及所述距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。Determining, according to an image parameter value of the first pixel to be filtered, the second table-view image parameter value, and the distance, determining, by using a look-up table, an image parameter value of the first pixel to be filtered after the first one-sided exponential filtering process .
  6. 如权利要求3所述的方法,其特征在于,The method of claim 3 wherein:
    根据第一待滤波像素点的图像参数值、第一已滤波像素点的图像参数值,以及待滤波像素点与已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值,包括:Determining, according to the image parameter value of the first pixel to be filtered, the image parameter value of the first filtered pixel, and the distance between the pixel to be filtered and the filtered pixel, determining, by using a table look, that the first pixel to be filtered passes the first single Image parameter values after edge index filtering, including:
    根据第一查表精度值和第一待滤波像素点的图像参数值确定第一查表图像参数值;Determining, according to the first lookup table precision value and the image parameter value of the first pixel to be filtered, a first lookup table image parameter value;
    根据所述第一查表图像参数值,已滤波像素点经过所述第一单边指数滤波处理后的图像参数,以及待滤波像素点与已滤波像素点的距离,通过查表确定第一待滤波像素点经过第一单边指数滤波处理后的图像参数值。And determining, according to the first look-up table image parameter value, the image parameter after the filtered pixel point is processed by the first one-sided exponential filtering, and the distance between the pixel to be filtered and the filtered pixel, and determining the first waiting by searching the table The image parameter value after filtering the pixel point through the first one-sided exponential filtering process.
  7. 如权利要求5或6所述的方法,其特征在于,A method according to claim 5 or claim 6 wherein:
    根据第二查表精度值和第一已滤波像素点的图像参数值确定第二查表图像参数值,包括:Determining the second look-up table image parameter value according to the second look-up table precision value and the image parameter value of the first filtered pixel point, including:
    当所述第二查表精度值为0.1n时,确定第一已滤波像素点的图像参数值乘以10n后的图像参数值的整数部分第二查表图像参数值;或者When the second table lookup precision value is 0.1n, determining an image parameter value of the first filtered pixel point multiplied by an integer part of the image parameter value after 10n, a second lookup table image parameter value; or
    当所述第二查表精度值为0.5n时,确定第一已滤波像素点的图像参数值左移n位后的整数部分为第二查表图像参数值;或者When the second table lookup precision value is 0.5n, determining that the image parameter value of the first filtered pixel point is shifted to the left by n bits is the second look-up table image parameter value; or
    当所述第二查表精度值为2n时,确定第一已滤波像素点的图像参数值右移n位后的整数部分为第二查表图像参数值;When the second table lookup precision value is 2n, determining that the image parameter value of the first filtered pixel point is shifted right by n bits is the second look-up table image parameter value;
    其中,n为正整数。Where n is a positive integer.
  8. 如权利要求2-6中任一项所述的方法,其特征在于,A method according to any of claims 2-6, wherein
    对所述待处理图像进行第一双边指数滤波处理,还包括:Performing a first bilateral exponential filtering process on the to-be-processed image further includes:
    根据第二待滤波像素点的图像参数值与第二已滤波像素点的图像参数值的差异,以及第二待滤波像素点与第二已滤波像素点的距离,确定第二待滤波像素点经过第二单边指数滤波处理后的图像参数值;Determining, according to a difference between an image parameter value of the second pixel to be filtered and an image parameter value of the second filtered pixel, and a distance between the second pixel to be filtered and the second filtered pixel, determining that the second pixel to be filtered passes Image parameter values after the second one-sided exponential filter processing;
    根据像素点经过第一单边指数滤波处理后的图像参数值,以及所述像素点经过第二单边指数滤波处理后的图像参数值,确定所述像素点经过所述第一双边指数滤波处理后的图像参数值。Determining, according to the image parameter value after the pixel is subjected to the first one-sided exponential filtering process, and the image parameter value of the pixel point after the second one-sided exponential filtering process, determining that the pixel point passes the first bilateral exponential filtering process Image parameter values after.
  9. 如权利要求1-6中任一项所述的方法,其特征在于,The method of any of claims 1-6, wherein
    所述第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离,具体实现为:The first bilateral index filtering processing part is based on: a difference between an image parameter value of the filtered pixel point and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel point and the pixel to be filtered, and the specific implementation is:
    所述第一双边指数滤波处理的值域滤波核函数部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离。The range filter function of the first bilateral exponential filter processing is based in part on a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered.
  10. 如权利要求1-6中任一项所述的方法,其特征在于,The method of any of claims 1-6, wherein
    所述待处理图像中与所述第一双边指数滤波处理方向垂直的待处理列/行包括位于端点的已滤波像素点和至少一个待滤波像素点;The to-be-processed column/row in the image to be processed that is perpendicular to the first bilateral exponential filtering processing direction includes a filtered pixel located at the endpoint and at least one pixel to be filtered;
    在根据所述第一双边指数滤波处理的结果,确定所述待处理图像的输出图像之前,所述方法还包括:Before determining the output image of the image to be processed according to the result of the first bilateral index filtering process, the method further includes:
    在与第一双边指数滤波处理的方向垂直的方向上,从所述待处理图像的待处理列/行的端点开始对所述待处理图像进行第二双边指数滤波处理,其中,所述第二双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;And performing, in a direction perpendicular to a direction of the first bilateral exponential filtering process, a second bilateral exponential filtering process on the image to be processed starting from an endpoint of the to-be-processed column/row of the image to be processed, wherein the second The bilateral index filtering processing is based in part on: a difference between an image parameter value of the filtered pixel and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
    根据所述第一双边指数滤波处理的结果,确定所述待处理图像的输出图像包括:根据所述第一双边指数滤波处理的结果,以及所述第二双边指数滤波处理的结果,确定所述待处理图像的输出图像。Determining, according to a result of the first bilateral exponential filtering process, the output image of the image to be processed includes: determining, according to a result of the first bilateral exponential filtering process, and a result of the second bilateral exponential filtering process The output image of the image to be processed.
  11. 如权利要求1-6中任一项所述的方法,其特征在于,The method of any of claims 1-6, wherein
    所述第一双边指数滤波处理的方向与所述待处理图像的行平行;或者The direction of the first bilateral exponential filtering process is parallel to the row of the image to be processed; or
    所述第一双边指数滤波处理的方向与所述待处理图像的列平行。The direction of the first bilateral exponential filtering process is parallel to the column of the image to be processed.
  12. 如权利要求11所述的方法,其特征在于,The method of claim 11 wherein:
    获取待处理图像包括:按照用于图像处理的处理器数量,对输入图像进行分片处理得到多个所述待处理图像,其中,所述输入图像的分片处理的分片位置平行于对所述待处理图像进行所述第一双边指数滤波处理时的处理方向;Acquiring the image to be processed includes: performing a fragmentation process on the input image according to the number of processors used for image processing to obtain a plurality of the to-be-processed images, wherein a slice position of the slice processing of the input image is parallel to the opposite Treating a processing direction when the processed image performs the first bilateral exponential filtering process;
    其中,在确定所述待处理图像的输出图像之后,所述方法还包括:The method further includes: after determining the output image of the image to be processed, the method further includes:
    根据所述多个所述待处理图像的输出图像,合成所述输入图像滤波后的输出图像。And outputting the output image filtered by the input image according to the output images of the plurality of the to-be-processed images.
  13. 如权利要求1-6中任一项所述的方法,其特征在于,The method of any of claims 1-6, wherein
    在确定所述待处理图像的输出图像之前,所述方法还包括:根据所述待处理图像各像素点滤波前的图像参数值,确定所述待处理图像各像素点的增益滤波结果;Before determining the output image of the image to be processed, the method further includes: determining a gain filtering result of each pixel of the image to be processed according to the image parameter value before filtering of each pixel of the image to be processed;
    根据所述第一双边指数滤波处理的结果,确定所述待处理图像的输出图像包括:根据所述第一双边指数滤波处理的结果,以及所述待处理图像各像素点的增益滤波结果,确定所述待处理图像的输出图像。Determining, according to a result of the first bilateral exponential filtering process, the output image of the image to be processed includes: determining, according to a result of the first bilateral exponential filtering process, and a gain filtering result of each pixel of the image to be processed, An output image of the image to be processed.
  14. 如权利要求13所述的方法,其特征在于,根据所述待处理图像各像素点滤波前的图像参数值,确定所述待处理图像各像素点的增益滤波结果包括:The method according to claim 13, wherein determining a gain filtering result of each pixel of the image to be processed according to the image parameter value before filtering of each pixel of the image to be processed comprises:
    根据所述待处理图像各像素点滤波前的图像参数值,通过查表确定所述待处理图像各像素点的增益滤波结果。And determining, according to the image parameter value before filtering each pixel of the image to be processed, a gain filtering result of each pixel of the image to be processed by using a lookup table.
  15. 一种图像处理装置,其特征在于,包括:An image processing apparatus, comprising:
    获取单元,获取待处理图像,所述待处理图像的待处理行/列包括位于端点的已滤波像素点和至少一个待滤波像素点;Acquiring a unit to obtain a to-be-processed image, where the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
    处理单元,从所述待处理图像的待处理行/列的端点开始对所述待处理图像进行第一双边指数滤波处理,其中,所述第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;a processing unit that performs a first bilateral exponential filtering process on the to-be-processed image from an endpoint of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: a filtered pixel point a difference between an image parameter value and an image parameter value of the pixel to be filtered, and a distance between the filtered pixel point and the pixel to be filtered;
    确定单元,根据所述第一双边指数滤波处理的结果,确定所述待处理图像的输出图像。a determining unit that determines an output image of the image to be processed according to a result of the first bilateral index filtering process.
  16. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    处理器;以及Processor;
    被安排成存储计算机可执行指令的存储器,所述可执行指令在被执行时使所述处理器执行以下操作:A memory arranged to store computer executable instructions that, when executed, cause the processor to perform the following operations:
    获取待处理图像,所述待处理图像的待处理行/列包括位于端点的已滤波像素点和至少一个待滤波像素点;Obtaining a to-be-processed image, the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
    从所述待处理图像的待处理行/列的端点开始对所述待处理图像进行第一双边指数滤波处理,其中,所述第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Performing a first bilateral exponential filtering process on the to-be-processed image from an endpoint of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: an image parameter value of the filtered pixel a difference from an image parameter value of a pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
    根据所述第一双边指数滤波处理的结果,确定所述待处理图像的输出图像。And determining an output image of the image to be processed according to a result of the first bilateral index filtering process.
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储一个或多个程序,所述一个或多个程序包括指令,所述指令当被包括多个应用程序的电子设备执 行时,使得所述电子设备执行以下操作:A computer readable storage medium, wherein the computer readable storage medium stores one or more programs, the one or more programs comprising instructions that are executed by an electronic device that includes a plurality of applications When the electronic device is caused to perform the following operations:
    获取待处理图像,所述待处理图像的待处理行/列包括位于端点的已滤波像素点和至少一个待滤波像素点;Obtaining a to-be-processed image, the to-be-processed row/column of the to-be-processed image includes a filtered pixel point at the endpoint and at least one pixel to be filtered;
    从所述待处理图像的待处理行/列的端点开始对所述待处理图像进行第一双边指数滤波处理,其中,所述第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Performing a first bilateral exponential filtering process on the to-be-processed image from an endpoint of the to-be-processed row/column of the to-be-processed image, wherein the first bilateral exponential filtering processing portion is based on: an image parameter value of the filtered pixel a difference from an image parameter value of a pixel to be filtered, and a distance between the filtered pixel and the pixel to be filtered;
    根据所述第一双边指数滤波处理的结果,确定所述待处理图像的输出图像。And determining an output image of the image to be processed according to a result of the first bilateral index filtering process.
  18. 一种图像处理方法,其特征在于,包括:An image processing method, comprising:
    获取待处理图像,所述待处理图像的待处理行/列包括已滤波像素点和至少一个待滤波像素点;Obtaining a to-be-processed image, the to-be-processed row/column of the to-be-processed image includes a filtered pixel point and at least one pixel to be filtered;
    对所述待处理图像的待处理行/列进行第一双边指数滤波处理,其中,所述第一双边指数滤波处理部分基于:已滤波像素点的图像参数值与待滤波像素点的图像参数值的差异,以及已滤波像素点与待滤波像素点的距离;Performing a first bilateral exponential filtering process on the to-be-processed row/column of the image to be processed, wherein the first bilateral exponential filtering process is partially based on: an image parameter value of the filtered pixel point and an image parameter value of the pixel to be filtered Difference, and the distance between the filtered pixel and the pixel to be filtered;
    根据所述第一双边指数滤波处理的结果,确定所述待处理图像的输出图像。And determining an output image of the image to be processed according to a result of the first bilateral index filtering process.
PCT/CN2018/086648 2017-05-24 2018-05-14 Image processing method, device and system WO2018214769A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710375442.8A CN108961170B (en) 2017-05-24 2017-05-24 Image processing method, device and system
CN201710375442.8 2017-05-24

Publications (1)

Publication Number Publication Date
WO2018214769A1 true WO2018214769A1 (en) 2018-11-29

Family

ID=64395261

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/086648 WO2018214769A1 (en) 2017-05-24 2018-05-14 Image processing method, device and system

Country Status (3)

Country Link
CN (1) CN108961170B (en)
TW (1) TW201901616A (en)
WO (1) WO2018214769A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109767385A (en) * 2018-12-20 2019-05-17 深圳市资福医疗技术有限公司 A kind of method and apparatus removing image chroma noise
CN111833259A (en) * 2020-05-28 2020-10-27 北京迈格威科技有限公司 Image definition determining method, device, equipment and storage medium
CN111915478A (en) * 2020-07-14 2020-11-10 厦门真景科技有限公司 Beautifying method, device and equipment based on edge-preserving blur and computer-readable storage medium
CN113382276A (en) * 2021-06-09 2021-09-10 湖南快乐阳光互动娱乐传媒有限公司 Picture processing method and system

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112446911A (en) * 2019-08-29 2021-03-05 阿里巴巴集团控股有限公司 Centerline extraction, interface interaction and model training method, system and equipment
CN111192218B (en) * 2019-12-31 2023-11-24 深圳市商汤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN111724326B (en) * 2020-06-28 2023-08-01 深圳市慧鲤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN112464801B (en) * 2020-11-26 2023-04-18 配天机器人技术有限公司 Robot data processing method and device
CN113658066A (en) * 2021-08-09 2021-11-16 维沃移动通信有限公司 Image processing method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006180268A (en) * 2004-12-22 2006-07-06 Sony Corp Image processing apparatus, image processing method, program, and recording medium
CN101902562A (en) * 2009-05-29 2010-12-01 索尼公司 Filter circuit, image processing equipment, imaging device and image processing method
CN102819837A (en) * 2012-07-12 2012-12-12 清华大学 Method and device for depth map processing based on feedback control
CN104685539A (en) * 2012-09-28 2015-06-03 株式会社岛津制作所 Digital image processing method and imaging device
CN106651783A (en) * 2016-09-29 2017-05-10 厦门美图之家科技有限公司 Image filtering method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6683994B1 (en) * 2000-11-28 2004-01-27 Xerox Corporation HVQ-based filtering method
CN103020914B (en) * 2012-12-18 2016-01-20 华侨大学 Based on the rapid image defogging method capable of spatial continuity principle
CN103177429A (en) * 2013-04-16 2013-06-26 南京理工大学 FPGA (field programmable gate array)-based infrared image detail enhancing system and method
CN104869387B (en) * 2015-04-19 2017-01-11 中国传媒大学 Method for acquiring binocular image maximum parallax based on optical flow method
CN106373095B (en) * 2016-08-29 2017-11-17 广东欧珀移动通信有限公司 A kind of image processing method and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006180268A (en) * 2004-12-22 2006-07-06 Sony Corp Image processing apparatus, image processing method, program, and recording medium
CN101902562A (en) * 2009-05-29 2010-12-01 索尼公司 Filter circuit, image processing equipment, imaging device and image processing method
CN102819837A (en) * 2012-07-12 2012-12-12 清华大学 Method and device for depth map processing based on feedback control
CN104685539A (en) * 2012-09-28 2015-06-03 株式会社岛津制作所 Digital image processing method and imaging device
CN106651783A (en) * 2016-09-29 2017-05-10 厦门美图之家科技有限公司 Image filtering method and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109767385A (en) * 2018-12-20 2019-05-17 深圳市资福医疗技术有限公司 A kind of method and apparatus removing image chroma noise
CN109767385B (en) * 2018-12-20 2023-04-28 深圳市资福医疗技术有限公司 Method and device for removing image chroma noise
CN111833259A (en) * 2020-05-28 2020-10-27 北京迈格威科技有限公司 Image definition determining method, device, equipment and storage medium
CN111833259B (en) * 2020-05-28 2024-05-07 北京迈格威科技有限公司 Image definition determining method, device, equipment and storage medium
CN111915478A (en) * 2020-07-14 2020-11-10 厦门真景科技有限公司 Beautifying method, device and equipment based on edge-preserving blur and computer-readable storage medium
CN111915478B (en) * 2020-07-14 2023-06-23 厦门真景科技有限公司 Beautifying method, device and equipment based on edge protection blurring and computer readable storage medium
CN113382276A (en) * 2021-06-09 2021-09-10 湖南快乐阳光互动娱乐传媒有限公司 Picture processing method and system

Also Published As

Publication number Publication date
CN108961170B (en) 2022-05-03
TW201901616A (en) 2019-01-01
CN108961170A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
WO2018214769A1 (en) Image processing method, device and system
KR101639852B1 (en) Pixel value compaction for graphics processing
US9286653B2 (en) System and method for increasing the bit depth of images
US9773297B2 (en) System and method for supporting image denoising based on neighborhood block dimensionality reduction
CN109885407B (en) Data processing method and device, electronic equipment and storage medium
US11899741B2 (en) Memory device and method
US10402196B2 (en) Multi-dimensional sliding window operation for a vector processor, including dividing a filter into a plurality of patterns for selecting data elements from a plurality of input registers and performing calculations in parallel using groups of the data elements and coefficients
JP2007535066A (en) Image processing apparatus and method
JP2015062270A (en) Image processing apparatus
US20200327638A1 (en) Connected component detection method, circuit, device and computer-readable storage medium
TWI681361B (en) Application processor, system and data processing system
Hashimoto et al. An fpga-based fully pipelined bilateral grid for real-time image denoising
US8983223B2 (en) Low-complexity bilateral filter (BF) implementation in a data processing device
US20210279839A1 (en) Image processing apparatus configured to perform edge preserving smoothing and image processing method thereof
US9679363B1 (en) System and method for reducing image noise
Li et al. CUDA-based acceleration of collateral filtering in brain MR images
CN114723796A (en) Three-dimensional point cloud generation method and device and electronic equipment
EP3671637B1 (en) Double-angle gradients
TWI776733B (en) Data processing method for rapidly suppressing high-frequency noises in digitized image
TWI493476B (en) Image processing circuit and method thereof
CN113052771B (en) Image processing method, device, electronic equipment and storage medium
CN113542808B (en) Video processing method, apparatus, device and computer readable medium
US20220189031A1 (en) Method and apparatus with optimization and prediction for image segmentation
US20240104822A1 (en) Multicore system for neural rendering
US20240135506A1 (en) Adaptive sharpening for blocks of pixels

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18806309

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18806309

Country of ref document: EP

Kind code of ref document: A1